Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Can i Add a filter in product search vision api like i did min_Score 50%

 

{
{
  "requests": [
    {
      "image": {
        "source": {
          "gcsImageUri": "gs://cloud-ai-vision-data/product-search-tutorial/images/468f782e70ba11e8941fd20059124800.jpg"
        }
      },
      "features": [
        { "type": "PRODUCT_SEARCH" }
      ],
      "imageContext": {
        "productSearchParams": {
          "productSet": "projects/PROJECT_ID/locations/LOCATION_ID/productSets/PRODUCT_SET_ID",
          "productCategories": [ "apparel-v2" ],
          "filter": "style=womens OR style=women",
          "min_score": 0.5  // This is the new field for filtering
        }
      }
    }
  ]
}
"requests": [ { "image": { "source": { "gcsImageUri": "gs://cloud-ai-vision-data/product-search-tutorial/images/468f782e70ba11e8941fd20059124800.jpg" } }, "features": [ { "type": "PRODUCT_SEARCH" } ], "imageContext": { "productSearchParams": { "productSet": "projects/PROJECT_ID/locations/LOCATION_ID/productSets/PRODUCT_SET_ID", "productCategories": [ "apparel-v2" ], "filter": "style=womens OR style=women", "min_score": 0.5 // This is the new field for filtering } } } ] }
2 1 302
1 REPLY 1

Your JSON request for a product search using the Google Cloud Vision API has some duplication. Here's the corrected version with proper JSON formatting and without duplication:

Show More
{
"requests": [
{
"image": {
"source": {
"gcsImageUri": "gs://cloud-ai-vision-data/product-search-tutorial/images/468f782e70ba11e8941fd20059124800.jpg"
}
},
"features": [
{
"type": "PRODUCT_SEARCH"
}
],
"imageContext": {
"productSearchParams": {
"productSet": "projects/PROJECT_ID/locations/LOCATION_ID/productSets/PRODUCT_SET_ID",
"productCategories": ["apparel-v2"],
"filter": "style=womens OR style=women",
"min_score": 0.5
}
}
}
]
}