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 Likes

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

{

Show More

“requests”: [

Show More

{

Show More

“image”: {

Show More

“source”: {

Show More

“gcsImageUri”: “gs://cloud-ai-vision-data/product-search-tutorial/images/468f782e70ba11e8941fd20059124800.jpg”

Show More

}

Show More

},

Show More

“features”: [

Show More

{

Show More

“type”: “PRODUCT_SEARCH”

Show More

}

Show More

],

Show More

“imageContext”: {

Show More

“productSearchParams”: {

Show More

“productSet”: “projects/PROJECT_ID/locations/LOCATION_ID/productSets/PRODUCT_SET_ID”,

Show More

“productCategories”: [“apparel-v2”],

Show More

“filter”: “style=womens OR style=women”,

Show More

“min_score”: 0.5

Show More

}

Show More

}

Show More

}

Show More

]

Show More

}

1 Like