reference_images
Creates, updates, deletes, gets or lists a reference_images
resource.
Overview
Name | reference_images |
Type | Resource |
Id | google.vision.reference_images |
Fields
Name | Datatype | Description |
---|---|---|
name | string | The resource name of the reference image. Format is: projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID . This field is ignored when creating a reference image. |
boundingPolys | array | Optional. Bounding polygons around the areas of interest in the reference image. If this field is empty, the system will try to detect regions of interest. At most 10 bounding polygons will be used. The provided shape is converted into a non-rotated rectangle. Once converted, the small edge of the rectangle must be greater than or equal to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not). |
uri | string | Required. The Google Cloud Storage URI of the reference image. The URI must start with gs:// . |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
projects_locations_products_reference_images_get | SELECT | locationsId, productsId, projectsId, referenceImagesId | Gets information associated with a ReferenceImage. Possible errors: * Returns NOT_FOUND if the specified image does not exist. |
projects_locations_products_reference_images_list | SELECT | locationsId, productsId, projectsId | Lists reference images. Possible errors: Returns NOT_FOUND if the parent product does not exist. Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1. |
projects_locations_products_reference_images_create | INSERT | locationsId, productsId, projectsId | Creates and returns a new ReferenceImage resource. The bounding_poly field is optional. If bounding_poly is not specified, the system will try to detect regions of interest in the image that are compatible with the product_category on the parent product. If it is specified, detection is ALWAYS skipped. The system converts polygons into non-rotated rectangles. Note that the pipeline will resize the image if the image resolution is too large to process (above 50MP). Possible errors: Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 characters. Returns INVALID_ARGUMENT if the product does not exist. Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing compatible with the parent product's product_category is detected. Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. |
projects_locations_products_reference_images_delete | DELETE | locationsId, productsId, projectsId, referenceImagesId | Permanently deletes a reference image. The image metadata will be deleted right away, but search queries against ProductSets containing the image may still work until all related caches are refreshed. The actual image files are not deleted from Google Cloud Storage. |
SELECT
examples
Lists reference images. Possible errors: Returns NOT_FOUND if the parent product does not exist. Returns INVALID_ARGUMENT if the page_size is greater than 100, or less than 1.
SELECT
name,
boundingPolys,
uri
FROM google.vision.reference_images
WHERE locationsId = '{{ locationsId }}'
AND productsId = '{{ productsId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new reference_images
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.vision.reference_images (
locationsId,
productsId,
projectsId,
name,
uri,
boundingPolys
)
SELECT
'{{ locationsId }}',
'{{ productsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ uri }}',
'{{ boundingPolys }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: uri
value: string
- name: boundingPolys
value:
- - name: vertices
value:
- - name: x
value: integer
- name: 'y'
value: integer
- name: normalizedVertices
value:
- - name: x
value: number
- name: 'y'
value: number
DELETE
example
Deletes the specified reference_images
resource.
/*+ delete */
DELETE FROM google.vision.reference_images
WHERE locationsId = '{{ locationsId }}'
AND productsId = '{{ productsId }}'
AND projectsId = '{{ projectsId }}'
AND referenceImagesId = '{{ referenceImagesId }}';