HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/current/lib/surface/ml/vision/detect_product.yaml
- release_tracks: [BETA, ALPHA]

  help_text:
    brief: detect products within an image
    description: |
      detect products within an image
    examples: |
      To detect product in image 'gs://my-bucket/my-image.jpg' by searching in product set
      'my-product-set', in category 'toys', run:

        $ {command} gs://my-bucket/my-image.jpg --product-set='my-product-set' --product-set-location=us-east1 --category='toys'

  request:
    _COMMON_: request
    static_fields:
      requests.features.type: PRODUCT_SEARCH
    modify_request_hooks:
    - googlecloudsdk.command_lib.ml.vision.product_search.utils:AddProductSetToDetectProductRequest
    - googlecloudsdk.command_lib.ml.vision.product_search.utils:AddBoundingPolygonToDetectProductRequest

  response:
    _COMMON_: response

  arguments:
    params:
    - _COMMON_: args.image_field
    - _COMMON_: args.max_results_field
    - api_field: requests.imageContext.productSearchParams.productCategories
      arg_name: category
      help_text: Product category to search in.
      required: true
      choices:
      - arg_value: apparel
        enum_value: apparel
      - arg_value: homegoods
        enum_value: homegoods
      - arg_value: toys
        enum_value: toys
    - api_field: requests.imageContext.productSearchParams.filter
      arg_name: filter
      help_text: |-
        Filter expression to restrict search results based on product labels. ANDs of ORs of
        key-value expressions are supported, where expressions within an OR must
        have the same key. Expressions separated by AND must have different keys.
        An '=' should be used to connect the key and value. For example,
        '(color = red OR color = blue) AND brand = Google' is acceptable, but not
        '(color = red OR brand = Google)' or 'color: red'.
    - arg_name: bounding-polygon
      help_text: |-
        Bounding polygon around the areas of interest in the image. If it is not specified, system
        discretion will be applied. A bounding polygon can be specified by a list of vertices or
        normalized vertices. A vertex (x, y) represents a 2D point in the image. x, y are integers
        and are in the same scale as the original image. The normalized vertex coordinates are
        relative to orginal image and range from 0 to 1. For example,
        --bounding-polygon=0.,0.,0.,0.3,0.3,0.,0.3,0.3 specifies a polygon with 4 normalized
        vertices - (0., 0.), (0., 0.3), (0.3, 0.), (0.3, 0.3). Notice that the decimal point is
        needed for normalized vertex coordindates.
    additional_arguments_hook: googlecloudsdk.command_lib.ml.vision.product_search.utils:ProductSetArgsForDetectProduct
  output:
    format: json