商品识别器模型可帮助您识别和了解所提供图片或货架上显示的商品。
此模型可以用作分析和解读零售店内商品图片数据的主要 AI 构建块。例如,您可以将此模型用于本地摄像头或移动设备拍摄的货架图片。
标记识别器和商品识别器用例
商品识别器模型和条形码识别器模型可用作主要 AI 构建块,用于分析和解读零售店中商品和条形码周围的图片数据,例如安装的摄像头或移动设备 / 平台拍摄的货架扫描图片。
商品识别器和条形码识别器模型采用了多项 Google AI 核心建模和数据功能,可帮助零售商和/或技术合作伙伴解决了解零售货架时遇到的关键问题,包括:
- 检测、识别图片或货架上的产品,从而了解这些产品。
- 根据用户定义的键值对实体提取架构,检测、识别和解析标签(例如价格标签或任何其他文本标签)。
值得注意的是,货架检查解决方案中包含多种具有差异性的 Google AI 模型,可支持解决这些应用场景问题,例如
- 商品检测模型(由 Google 预训练,但您仍可以对其进行自定义)。
- 商品缩略图视觉嵌入模型,用于将商品缩略图图片转换为数值特征空间表示法。
- Google OCR 模型,用于提取图片中可见的所有文本。
- Google 实体提取模型(可供您自定义),用于将原始文本转换为用户定义的键值对命名实体。
除了这些 Google AI 模型之外,货架检查解决方案还利用 Google 庞大的产品信息数据库。此商品数据库中的商品数据包括商品的 GTIN/UPC 标识、商品品牌、商品名、多语言说明、商品徽标以及各种包装款式/规格的图片。借助包含前面提到的商品缩略图视觉嵌入模型的商品数据库,商品识别器模型能够立即识别许多商品。
例如,假设拍摄到了如下搁架图片,搁架检查解决方案旨在:
- 检测和定位图片中的所有商品条状盒(可见,未严重遮挡),并在 GTIN / UPC 级别识别每个单独商品条状盒的商品身份。
- 检测并定位图片中的所有标签框(可见),识别标签中的所有文本字符串,然后尝试将文本解析为用户定义的键值对实体提取架构,例如商品项说明、价格值。
实现这些解决方案的两大 AI 功能是商品识别器模型和链接识别器模型,我们将在以下部分详细介绍这两种模型。这两个主要提供图片推理服务的 API 中,每个 API 都有一个或多个可供您自定义的组件。我们将首先介绍 API 使用情况的推理路径,然后简要介绍您可以如何通过某些用户配置或您进行的某些模型训练来自定义相关组件。
商品识别器功能
此模型可在全球贸易项目代码 (GTIN) 级别或通用商品代码 (UPC) 级别识别单个商品的身份。商品识别器中包含多种具有差异性的 Google AI 模型,可帮助解决这些应用场景中的问题,例如:
- 商品视觉嵌入模型,用于将商品图片转换为数字特征空间表示法。
- Google OCR 技术,用于提取图片中可见的所有文字。
- 将 Google 商品数据库与商品缩略图视觉嵌入模型搭配使用,可让商品识别器模型立即识别许多商品。
输出 JSON 对象示例
{ "imageUri": "gs://test_bucket/test_image.jpg", "productRecognitionAnnotations": [ { "detectedText": "Bolthouse Farms Perfectly Protein Tea & Soy Beverage", "recognitionResults": [ { "confidence": 0.9420832, "productMetadata": { "brand": "Bolthouse Farms", "gtins": [ "00071464260804" ], "locale": "en-US", "title": "Bolthouse Farms Perfectly Protein Tea & Soy Beverage, Vanilla Chai Tea - 52 fl oz" }, } ] } ] }
API 概念
我们提供了 6 个 API 资源,可帮助您构建商品目录、管理商品数据集、构建索引以及部署商品识别服务。具体说明如下:
目录:根资源,表示零售商提供的所有商品的容器。
商品:表示商家提供的商品。Product
是 Catalog
的子资源。
ProductImage:表示一件商品的视图的图片。ProductImage
是 Product
的子资源。
ProductSet:一种更精细的容器,用于整理和分组同一 Catalog
中的商品。一个 ProductSet
可以包含一个或多个 Product
,但它并不“拥有”包含的 Product
,而是维护与它们的“链接”。
ProductRecognitionIndex:包含用于商品识别算法的图片嵌入列表。ProductRecognitionIndex
可以基于整个 Catalog
或 ProductSet
(Catalog
中的 Product
的子集)创建。
端点:包含执行商品识别或代码识别推理所需的所有配置的展示位置。对于商品识别,必须指定商品检测模型并部署 ProductRecognitionIndex
。对于代码识别,必须同时指定代码检测和代码实体解析模型。
环境设置
本部分介绍了如何与 Store Vision AI RESTful API 交互。
API_ENDPOINT=visionai.googleapis.com
PROJECT_ID=your project ID
所有 create
方法都需要明确指定要创建的资源名称/ID。您可以使用有意义的字符串标识符(例如“product-ABC”),也可以使用随机生成的标识符(例如 UUID)。
如需向个人角色授予使用 Store Vision API 的编辑者访问权限,请运行以下 IAM 绑定命令:
gcloud projects add-iam-policy-binding PROJECT_ID --member='user:USER_ACCOUNT' --role='roles/visionai.editor'
如需向服务账号授予编辑者访问权限,请使用以下命令:
gcloud projects add-iam-policy-binding PROJECT_ID --member='serviceAccount:SERVICE_ACCOUNT' --role='roles/visionai.editor'
商品识别器用户体验历程
- 创建目录。
- 将商品和(可选)
ProductImages
导入Catalog
。 - 查看和修改
Product
和ProductImages
,并可选择创建ProductSet
以更精细地整理商品列表。 - 从整个
Catalog
或ProductSet
创建Index
。 - 创建具有所需商品识别配置的
Endpoint
,并将Index
部署到该Endpoint
。 - 使用
ProductRecognition
功能执行BatchAnalyze
。在后端,系统将从每个输入图片中识别商品,并使用视觉和 OCR 文本信号从指定索引中检索前 K 个相似商品。
API 资源管理(目录和索引集)
目录
创建目录
- CATALOG_ID=您的目录 ID。
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" -d '{}' https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs?retail_catalog_id=CATALOG_ID
输出示例
{
"name": "projects/cloud-store-vision-test/locations/us-central1/operations/operation-1655157982362-5e15b7f95fa6f-d30364c6-dc3a3714",
"done": false
}
拉取操作,直到完成
- OPERATION_ID=您的输出操作,例如 operation-1655157982362-5e15b7f95fa6f-d30364c6-dc3a3714
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/operations/OPERATION_ID
输出示例
{
"name": "projects/cloud-store-vision-test/locations/us-central1/operations/operation-1655157982362-5e15b7f95fa6f-d30364c6-dc3a3714",
"done": true
}
ImportProduct
支持两种导入格式:
- TXT:每行是要导入的商品的 GTIN
- JSONL:每行都是 RetailProductIoFormat 的 JSON 格式,例如
{"retailProduct":{"name":"00040094314034","gtins":["00040094314034"]},"retailProductImages":[{"name":"1","gcsUri":"gs://shelfchecking-integration-test-data/products-data/00040094314034/1.jpg"}]}
{"retailProduct": {"name":"00123", "thirdPartyIds": {"id": "test-id", "owner": "test-owner"}}}
如需详细了解 RetailProductIoFormat,请参阅 API 参考文档。目前,每次 ImportProduct 操作最多支持导入 10,000 件商品。
另请注意,“retailProductImages”中的“name”只需在父级“retailProduct”资源的范围内保持唯一性,这意味着,只要 2 个“retailProductImages”属于不同的“retailProduct”资源,它们就可以具有相同的“name”。
- IMPORT_FILE_URI=导入文件的 Cloud Storage URI,例如 gs://mybucket/my_import_file.jsonl
- IMPORT_FORMAT=导入文件格式,即 FORMAT_JSONL 或 FORMAT_TXT
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID:importRetailProducts \
-d '{
"gcs_source": {
"uris": "IMPORT_FILE_URI"
},
"format": "IMPORT_FORMAT"
}'
列出目录
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs
GetCatalog
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID
DeleteCatalog
curl -sS -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID
产品
使用 GTIN 调用 CreateProduct
我们支持 GTIN-8、GTIN-13、GTIN-14 和 UPC(也称为 GTIN-12)格式。如需详细了解 GTIN 格式,请点击此处。
- PRODUCT_ID=您的商品 ID
- GTIN=商品的 gtin,例如 50735854797459、00040094314034
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProducts?retail_product_id=PRODUCT_ID \
-d '{"gtins": "GTIN"}'
使用第三方 ID 创建 CreateProduct
- PRODUCT_ID=您的商品 ID
- THIRD_PARTY_ID=第三方 ID
- OWNER=拥有第三方标识符的实体
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProducts?retail_product_id=PRODUCT_ID \
-d '
{
"third_party_ids": {
"id": "THIRD_PARTY_ID",
"owner": "OWNER",
}
}'
ListProducts
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProducts
GetProducts
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProducts/PRODUCT_ID
DeleteProduct
curl -sS -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProducts/PRODUCT_ID
ProductImage
CreateProductImage
- PRODUCT_IMAGE_ID=您的商品图片 ID
- IMAGE_GCS_URI=图片的 Cloud Storage URI,例如 gs://mybucket/my_img.jpg
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProducts/PRODUCT_ID/retailProductImages?retail_product_image_id=PRODUCT_IMAGE_ID \
-d '{
"source_type": "SOURCE_TYPE_HAND_HELD_CAMERA",
"gcs_uri": "IMAGE_GCS_URI"
}'
ListProductImages
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProducts/PRODUCT_ID/retailProductImages
GetProductImages
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProducts/PRODUCT_ID/retailProductImages/PRODUCT_IMAGE_ID
DeleteProductImage
curl -sS -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProducts/PRODUCT_ID/retailProductImages/PRODUCT_IMAGE_ID
ProductSet
CreateProductSet
- PRODUCT_SET_ID=您的商品集 ID
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" -d '{}' https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductSets?retail_product_set_id=PRODUCT_SET_ID
ListProductSet
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductSets
GetProductSet
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductSets/PRODUCT_SET_ID
AddProductsToProductSet
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductSets/PRODUCT_SET_ID:add \
-d '{"product_ids": "PRODUCT_ID"}'
RemoveProductsFromProductSet
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductSets/PRODUCT_SET_ID:remove \
-d '{"product_ids": "PRODUCT_ID"}'
DeleteProductSet
curl -sS -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductSets/PRODUCT_SET_ID
ProductRecognitionIndex
创建 ProductRecognitionIndex
您可以通过两种方式创建 ProductRecognitionIndex,一种是从目录创建(将使用此目录中包含的所有内容),另一种是从 ProductSet 创建(将仅使用关联的商品和商品图片)。
- INDEX_ID=您的索引 ID
- COVERAGE_CSV_OUTPUT_DIRECTORY=<将索引覆盖率文件写入到的目录的 Cloud Storage 位置
# Create from Catalog
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductRecognitionIndexes?retail_product_recognition_index_id=INDEX_ID
# Create from Catalog and output index coverage CSV file to a Cloud Storage directory.
# This API method is especially useful when you want to understand the
# actual number of images used to construct the index per imported GTIN, and
# the image can be sourced from the Google Product database, your own importing,
# and other means (such as with the Google Data Labeling service.
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductRecognitionIndexes?retail_product_recognition_index_id=INDEX_ID&coverage_output.output_uri_prefix=COVERAGE_CSV_OUTPUT_DIRECTORY"
# Create from ProductSet, by adding the following to the previous Curl command
-d '{"retail_product_set": "projects/PROJECT_ID/locations/us-central1/retailCatalogs/'CATALOG_ID'/retailProductSets/PRODUCT_SET_ID"}'
获取 ProductRecognitionIndex
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductRecognitionIndexes/INDEX_ID
列出 ProductRecognitionIndex
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductRecognitionIndexes
删除 ProductRecognitionIndex
curl -sS -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailCatalogs/CATALOG_ID/retailProductRecognitionIndexes/INDEX_ID
端点
创建端点
- ENDPOINT_ID=您的端点 ID
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailEndpoints?retail_endpoint_id=ENDPOINT_ID -d '{
"productRecognitionConfig": {
"recognitionConfidenceThreshold": 0.4
}
}'
DeployProductRecognitionIndex
一个端点只能部署一个 ProductRecognitionIndex,但一个 ProductRecognitionIndex 可以部署到多个端点。
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailEndpoints/ENDPOINT_ID:deployRetailProductRecognitionIndex \
-d '{
"retail_product_recognition_index": "projects/PROJECT_ID/locations/us-central1/retailCatalogs/'CATALOG_ID'/retailProductRecognitionIndexes/INDEX_ID"
}'
GetEndpoint
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailEndpoints/ENDPOINT_ID
ListEndpoints
curl -sS -X GET -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailEndpoints
UndeployProductRecognitionIndex
取消部署只会从当前调用端点中移除已部署的 ProductRecognitionIndex,如果此 ProductRecognitionIndex 也部署到了其他端点,则不会影响其他端点。
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailEndpoints/ENDPOINT_ID:undeployRetailProductRecognitionIndex
DeleteEndpoint
curl -sS -X DELETE -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailEndpoints/ENDPOINT_ID
批量分析推理(商品识别)
gs://my-bucket/input-file.csv
中的输入文件示例:
gs://my-bucket/my-image1.jpg
gs://my-bucket/my-image2.jpg
gs://my-bucket/my-image3.jpg
- INPUT_FILE_URI=输入文件的 Cloud Storage URI> 输入文件中的每一行只是要处理的图片的 Cloud Storage URI,例如 gs://my-bucket/my-image.jpg
- OUTPUT_URI_PREFIX=输出结果文件的 Cloud Storage URI 前缀,例如 gs://my-bucket/my-output-dir
curl -sS -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://visionai.googleapis.com/v1alpha1/projects/PROJECT_ID/locations/us-central1/retailEndpoints/ENDPOINT_ID:batchAnalyze -d '{
"gcsSource": {
"uris": ["INPUT_FILE_URI"]
},
"features": [
{
"type": "TYPE_PRODUCT_RECOGNITION",
}
],
"outputGcsDestination": {
"outputUriPrefix": "OUTPUT_URI_PREFIX"
}
}'
"features": [
{
"type": "TYPE_PRODUCT_RECOGNITION",
"productRecognitionConfig": {
"recognitionConfidenceThreshold": 0.4
}
}
],
您还可以在 productRecognitionConfig
(一个 RetailProductRecognitionConfig
对象)中设置和配置更多字段。如需了解详情,请参阅 API 参考文档中的资源说明。
API 参考文档
资源:projects.locations.retailCatalogs
JSON 表示法
{
"name": string,
"displayName": string,
"createTime": string,
"updateTime": string,
"resourceState": enum(RetailResourceState),
"labels": {
string: string,
...
}
}
字段
名称 |
字符串 |
仅供输出。RetailCatalog 的资源名称 |
---|---|---|
displayName |
字符串 |
可选。RetailCatalog 的显示名称。 |
createTime |
string(时间戳格式) |
仅供输出。创建此 RetailCatalog 时的时间戳。 |
updateTime |
string(时间戳格式) |
仅供输出。更新时间戳。 |
resourceState |
枚举 |
仅供输出。RetailCatalog 的状态。 |
标签 |
映射(键:字符串,值:字符串) |
带有用户定义元数据的标签,用于整理 RetailCatalog。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需详细了解标签以及标签示例,请访问 https://goo.gl/xmQnxf。 一个包含“键值对”列表的对象。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
方法:projects.locations.retailCatalogs.create
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/us-central1}/retailCatalogs
路径参数
父级 | 字符串 | 必需。父级标识符。 |
请求正文
请求正文包含一个 RetailCatalog
实例。
响应正文
如果成功,响应正文将包含一个新创建的 RetailCatalog
实例。
方法:projects.locations.retailCatalogs.get
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/us-central1/retailCatalogs/*}
路径参数
name | 字符串 | 必需。RetailCatalog 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文包含一个 RetailCatalog
实例。
方法:projects.locations.retailCatalogs.list
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/us-central1}/retailCatalogs
路径参数
父级 | 字符串 | 必需。父级标识符。 |
查询参数
过滤条件 | 字符串 | 可选。用于过滤请求结果的表达式。 |
---|---|---|
pageToken | 字符串 | 可选。标识服务器应返回的结果页面的令牌。 |
pageSize | 整数 | 可选。请求的页面大小。 服务器返回的项可能要比请求的少。如果未指定,服务器会选择相应的默认值。 |
orderBy | 字符串 | 可选。要按升序排序的字段的逗号分隔列表。在字段名称后面使用“desc”表示降序。 |
请求正文
请求正文必须为空。
响应正文
如果成功,响应正文将包含结构如下的数据: JSON 表示法
{
"retailCatalogs": [
{
object (RetailCatalog)
}
],
"nextPageToken": string
}
方法:projects.locations.retailCatalogs.delete
HTTP 请求
DELETE https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/us-central1/retailCatalogs/*}
路径参数
name | 字符串 | 必需。RetailCatalog 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文包含一个 Operation
实例。
方法:projects.locations.retailCatalogs.importRetailProducts
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/us-central1/retailCatalogs/*}:importRetailProducts
路径参数
name | 字符串 | 必需。RetailCatalog 资源名称。 |
请求正文
JSON 表示法
{
"gcsSource": { object(GcsSource) },
"format": enum(Format)
}
字段
gcsSource | 对象 | 必需。输入内容所在的 Cloud Storage 位置。
可以提供多个输入位置。所有输入位置的内容将一次性导入。支持的文件扩展名:1.
JSONL 文件。每行都是 RetailProductIoFormat 的 JSON 格式。 2. TXT 文件。每行是要导入的商品的 GTIN。 |
格式 | 枚举 | 必需。导入文件格式。 |
设置 ENUM 值的格式
FORMAT_UNSPECIFIED | 不应使用。 |
---|---|
FORMAT_TXT | TXT 格式。 |
FORMAT_JSONL | JSONL 格式。 |
响应正文
如果成功,则响应正文包含一个 Operation
实例。
资源:projects.locations.retailProducts
JSON 表示法
{
"name": string,
"gtins": [string],
"normalizedGtins": [string],
"thirdPartyIds": [ { object(ThirdPartyId) }],
"locale": string,
"brand": string,
"title": string,
"productUri": string,
"resourceState": enum(RetailResourceState),
"labels": {
string: string,
...
}
"createTime": string,
"updateTime": string
}
字段
名称 |
字符串 |
仅供输出。RetailProductImage 的资源名称 |
---|---|---|
displayName |
字符串 |
可选。RetailProductImage 的显示名称。 |
sourceType |
枚举 |
可选。来源类型 |
gcsUri |
字符串 |
可选。RetailProductImage 的 Cloud Storage 位置。除非图片由 Google 提供(例如,来源类型为 SOURCE_TYPE_GOOGLE),否则应设置此字段。 |
resourceState |
枚举 |
仅供输出。RetailProductImage 的状态。 |
标签 |
映射(键:字符串,值:字符串) |
包含用户定义元数据的标签,用于整理 RetailProductImage。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需详细了解标签以及标签示例,请访问 https://goo.gl/xmQnxf。 一个对象,它包含“键”-“值”对的列表。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
createTime |
string(时间戳格式) |
仅供输出。创建时间戳。 |
updateTime |
string(时间戳格式) |
仅供输出。更新时间戳。 |
RetailThirdPartyId
JSON 演示
{
"id": string,
"owner": string
}
字段
id | 字符串 | 零售商或制造商使用的第三方 ID(例如 SKU 或 MPN)。 |
owner | 字符串 | “拥有”第三方标识符的实体,例如销售此商品的制造商或零售商。 |
方法:projects.locations.retailCatalogs.retailProducts.create
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProducts
路径参数
父级 | 字符串 | 必需。父级标识符。 |
请求正文
请求正文包含一个 RetailProduct
实例。
响应正文
如果成功,响应正文将包含一个新创建的 RetailProduct
实例。
方法:projects.locations.retailCatalogs.retailProducts.get
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProducts/*
路径参数
name | 字符串 | 必需。RetailProduct 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文包含一个 RetailProduct
实例。
方法:projects.locations.retailCatalogs.retailProducts.list
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProducts
路径参数
父级 | 字符串 | 必需。父级标识符。 |
查询参数
过滤条件 | 字符串 | 可选。用于过滤请求结果的表达式。 |
---|---|---|
pageToken | 字符串 | 可选。标识服务器应返回的结果页面的令牌。 |
pageSize | 整数 | 可选。请求的页面大小。 服务器返回的项可能要比请求的少。如果未指定,服务器会选择相应的默认值。 |
orderBy | 字符串 | 可选。要按升序排序的字段的逗号分隔列表。在字段名称后面使用“desc”表示降序。 |
请求正文
请求正文必须为空。
响应正文
如果成功,响应正文将包含结构如下的数据: JSON 表示法
{
"retailProducts": [
{
object (RetailProducts)
}
],
"nextPageToken": string
}
方法:projects.locations.retailCatalogs.retailProducts.delete
HTTP 请求
DELETE https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProducts/*
路径参数
name | 字符串 | 必需。RetailProduct 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文为空。
资源:projects.locations.retailProductImages
JSON 表示法
{
"name": string,
"displayName": string,
"sourceType": enum(SourceType),
"gcsUri": string,
"resourceState": enum(RetailResourceState),
"labels": {
string: string,
...
}
"createTime": string,
"updateTime": string
}
字段
名称 |
字符串 |
仅供输出。RetailProductImage 的资源名称 |
---|---|---|
displayName |
字符串 |
可选。RetailProductImage 的显示名称。 |
sourceType |
枚举 |
可选。来源类型 |
gcsUri |
字符串 |
可选。RetailProductImage 的 Cloud Storage 位置。除非图片由 Google 提供(例如,来源类型为 SOURCE_TYPE_GOOGLE),否则应设置此字段。 |
resourceState |
枚举 |
仅供输出。RetailProductImage 的状态。 |
标签 |
map (key: string, value: string) |
包含用户定义的元数据的标签,用于整理 RetailProductImage。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需详细了解标签以及标签示例,请访问 https://goo.gl/xmQnxf。 一个包含“键值对”列表的对象。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
createTime |
string(时间戳格式) |
仅供输出。创建时间戳。 |
updateTime |
string(时间戳格式) |
仅供输出。更新时间戳。 |
SourceType 枚举值
SOURCE_TYPE_UNSPECIFIED | 未知数据源。不应使用。 |
---|---|
SOURCE_TYPE_FIXED_CAMERA | 图片是通过固定摄像头拍摄的。 |
SOURCE_TYPE_HAND_HELD_CAMERA | 图片是使用手持相机拍摄的。 |
SOURCE_TYPE_CRAWLED | 图片是从网络抓取的。 |
SOURCE_TYPE_SYSTEM_GENERATED | 图片是从带有人工标签的原始图片剪裁而来。 |
方法:projects.locations.retailCatalogs.retailProducts.retailProductImages.create
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*/retailProducts/*}/retailProductImages
路径参数
父级 | 字符串 | 必需。父级标识符。 |
请求正文
请求正文包含一个 RetailProductImage
实例。
响应正文
如果成功,响应正文将包含一个新创建的 RetailProductImage
实例。
方法:projects.locations.retailCatalogs.retailProducts.retailProductImages.get
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProducts/*/retailProductImages/*
路径参数
name | 字符串 | 必需。RetailProductImage 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文包含一个 RetailProductImage
实例。
方法:projects.locations.retailCatalogs.retailProducts.retailProductImages.list
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*/retailProducts/*}/retailProductImages
路径参数
父级 | 字符串 | 必需。父级标识符。 |
查询参数
过滤条件 | 字符串 | 可选。用于过滤请求结果的表达式。 |
---|---|---|
pageToken | 字符串 | 可选。标识服务器应返回的结果页面的令牌。 |
pageSize | 整数 | 可选。请求的页面大小。 服务器返回的项可能要比请求的少。如果未指定,服务器会选择相应的默认值。 |
orderBy | 字符串 | 可选。要按升序排序的字段的逗号分隔列表。在字段名称后面使用“desc”表示降序。 |
请求正文
请求正文必须为空。
响应正文
如果成功,响应正文将包含结构如下的数据:
JSON 表示法
{
"retailProductImages": [
{
object (RetailProductImages)
}
],
"nextPageToken": string
}
方法:projects.locations.retailCatalogs.retailProducts.retailProductImages.delete
HTTP 请求
DELETE https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProducts/*/retailProductImages/*
路径参数
name | 字符串 | 必需。RetailProductImage 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文为空。
资源:projects.locations.retailCatalogs.retailProductSets
JSON 表示法
{
"name": string,
"displayName": string,
"retailProductIds": [string],
"resourceState": enum(RetailResourceState),
"labels": {
string: string,
...
}
"createTime": string,
"updateTime": string
}
字段
名称 |
字符串 |
仅供输出。RetailProductSet 的资源名称 |
---|---|---|
displayName |
字符串 |
可选。RetailProductSet 的显示名称。 |
retailProductIds [] |
字符串 |
仅供输出。属于此 RetailProductSet 的商品的资源 ID。RetailProductSet 中的商品应属于同一目录。 |
resourceState |
枚举 |
仅供输出。RetailProductSet 的状态。 |
标签 |
映射(键:字符串,值:字符串) |
包含用户定义的元数据的标签,用于整理 RetailProductSet。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需详细了解标签以及标签示例,请访问 https://goo.gl/xmQnxf。 一个对象,它包含“键”-“值”对的列表。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
createTime |
string(时间戳格式) |
仅供输出。创建时间戳。 |
updateTime |
string(时间戳格式) |
仅供输出。更新时间戳。 |
方法:projects.locations.retailCatalogs.retailProductSets.create
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProductSets
路径参数
父级 | 字符串 | 必需。父级标识符。 |
请求正文
请求正文包含一个 RetailProductSet 实例。
响应正文
如果成功,响应正文将包含一个新创建的 RetailProductSet 实例。
方法:projects.locations.retailCatalogs.retailProductSets.get
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProductSets/*
路径参数
name | 字符串 | 必需。RetailProductSet 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,响应正文将包含一个 RetailProductSet 实例。
方法:projects.locations.retailCatalogs.retailProductSets.list
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProductSets
路径参数
父级 | 字符串 | 必需。父级标识符。 |
查询参数
过滤条件 | 字符串 | 可选。用于过滤请求结果的表达式。 |
---|---|---|
pageToken | 字符串 | 可选。标识服务器应返回的结果页面的令牌。 |
pageSize | 整数 | 可选。请求的页面大小。 服务器返回的项可能要比请求的少。如果未指定,服务器会选择相应的默认值。 |
orderBy | 字符串 | 可选。要按升序排序的字段的逗号分隔列表。在字段名称后面使用“desc”表示降序。 |
请求正文
请求正文必须为空。
响应正文
如果成功,响应正文将包含结构如下的数据:
JSON 表示法
{
"retailProductSets": [
{
object (RetailProductSets)
}
],
"nextPageToken": string
}
方法:projects.locations.retailCatalogs.retailProductSets.delete
HTTP 请求
DELETE https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProductSets/*
路径参数
name | 字符串 | 必需。RetailProductSet 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文为空。
方法:projects.locations.retailCatalogs.retailProductSets.add
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProductSets/*}:remove
路径参数
name | 字符串 | 必需。RetailProductSet 资源名称。 |
请求正文
JSON 表示法
{
"productIds": [string],
"productFilter": string
}
字段
productIds[ ] |
字符串 |
要添加的 RetailProduct 的资源 ID。它们都必须与指定的目标 RetailProductSet 属于同一 RetailCatalog。一个请求中最多可以指定 200 个 RetailProducts ID。不能与 productFilter 一起使用。 |
---|---|---|
productFilter |
字符串 |
将应用于父级 RetailCatalog 中的所有 RetailProduct 的标准过滤条件,用于选择符合过滤条件的项并将其添加到 RetailProductSet。不能与 product_ids 一起使用。支持的过滤条件:https://google.aip.dev/160 |
响应正文
如果成功,则响应正文包含一个 Operation
实例。
方法:projects.locations.retailCatalogs.retailProductSets.remove
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProductSets/*}:add
路径参数
name | 字符串 | 必需。RetailProductSet 资源名称。 |
请求正文
JSON 表示法
{
"productIds": [string],
"productFilter": string
}
字段
productIds[ ] |
字符串 |
要移除的 RetailProduct 的资源 ID。如果指定的 RetailProducts 不属于此 RetailProductSet,则会被忽略。一个请求中最多可以指定 200 个 RetailProducts ID。不能与 products_filter 一起使用。 |
---|---|---|
productFilter |
字符串 |
一个标准过滤条件,将应用于指定 RetailProductSet 中的所有 RetailProduct,选择满足过滤条件的项并将其从 RetailProductSet 中移除。不能与 product_ids 一起使用。支持的过滤条件:https://google.aip.dev/160 |
响应正文
如果成功,则响应正文包含一个 Operation
实例。
资源:projects.locations.retailCatalogs.retailProductRecognitionIndexes
JSON 表示法
{
"name": string,
"displayName": string,
"description": string,
"retailProductSet": [string],
"resourceState": enum(RetailResourceState),
"labels": {
string: string,
...
}
"createTime": string,
"updateTime": string
}
字段
名称 |
字符串 |
仅供输出。RetailProductRecognitionIndex 资源的资源名称。 |
---|---|---|
displayName |
字符串 |
可选。RetailProductRecognitionIndex 的显示名称。 |
说明 |
字符串 |
可选。RetailProductRecognitionIndex 的说明。 |
retailProductSet[] |
字符串 |
可选。用于创建此资源的 RetailProductSet 的资源名称。如果设置,RetailProductRecognitionIndex 将仅包含给定 RetailProductSet 中的商品。如果未设置,系统将使用父级目录中的所有商品。 |
resourceState |
枚举 |
仅供输出。RetailProductRecognitionIndex 的状态。 |
标签 |
map (key: string, value: string) |
包含用户定义的元数据的标签,用于整理 RetailProductRecognitionIndex。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需详细了解标签以及标签示例,请访问 https://goo.gl/xmQnxf。 一个包含“键值对”列表的对象。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
createTime |
string(时间戳格式) |
仅供输出。创建时间戳。 |
updateTime |
string(时间戳格式) |
仅供输出。更新时间戳。 |
方法:projects.locations.retailCatalogs.retailProductRecognitionIndexes.create
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProductRecognitionIndexes
路径参数
父级 | 字符串 | 必需。父级标识符。 |
请求正文
请求正文包含一个 RetailProductRecognitionIndex
实例。
响应正文
如果成功,响应正文将包含一个新创建的 RetailProductRecognitionIndex
实例。
方法:projects.locations.retailCatalogs.retailProductRecognitionIndexes.get
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProductRecognitionIndexes/*
路径参数
name | 字符串 | 必需。RetailProductRecognitionIndex 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,响应正文将包含一个 RetailProductRecognitionIndex
实例。
方法:projects.locations.retailCatalogs.retailProductRecognitionIndexes.list
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProductRecognitionIndexes
路径参数
父级 | 字符串 | 必需。父级标识符。 |
查询参数
过滤条件 | 字符串 | 可选。用于过滤请求结果的表达式。 |
---|---|---|
pageToken | 字符串 | 可选。标识服务器应返回的结果页面的令牌。 |
pageSize | 整数 | 可选。请求的页面大小。 服务器返回的项可能要比请求的少。如果未指定,服务器会选择相应的默认值。 |
orderBy | 字符串 | 可选。要按升序排序的字段的逗号分隔列表。在字段名称后面使用“desc”表示降序。 |
请求正文
请求正文必须为空。
响应正文
如果成功,响应正文将包含结构如下的数据:
JSON 表示法
{
"retailProductRecognitionIndexes": [
{
object (RetailProductRecognitionIndex)
}
],
"nextPageToken": string
}
方法:projects.locations.retailCatalogs.retailProductRecognitionIndexes.delete
HTTP 请求
DELETE https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProductRecognitionIndexes/*
路径参数
name | 字符串 | 必需。ProductRecognitionIndex 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文包含一个 Operation
实例。
资源:projects.locations.retailEndpoints
JSON 表示法
{
"name": string,
"displayName": string,
"description": string,
"deployedProductRecognitionIndex": string,
"resourceState": enum(RetailResourceState),
"productRecognitionConfig": { object(RetailProductRecognitionConfig) },
"tagRecognitionConfig": { object(RetailTagRecognitionConfig) },
"labels": {
string: string,
...
}
"createTime": string,
"updateTime": string
}
字段
名称 |
字符串 |
仅供输出。RetailEndpoint 资源的资源名称。 |
---|---|---|
displayName |
字符串 |
可选。RetailEndpoint 的显示名称。 |
说明 |
字符串 |
可选。RetailEndpoint 的说明。 |
deployedProductRecognitionIndex |
字符串 |
仅供输出。部署到此 RetailEndpoint 的 ProductRecognitionIndex 的资源名称。 |
productRecognitionConfig |
对象 |
可选。商品识别配置。 |
tagRecognitionConfig |
对象 |
可选。用于标签识别的配置。 |
resourceState |
枚举 |
仅供输出。RetailProductRecognitionIndex 的状态。 |
标签 |
map (key: string, value: string) |
包含用户定义的元数据的标签,用于整理 RetailProductRecognitionIndex。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需详细了解标签以及标签示例,请访问 https://goo.gl/xmQnxf。 一个包含“键值对”列表的对象。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
createTime |
string(时间戳格式) |
仅供输出。创建时间戳。 |
updateTime |
string(时间戳格式) |
仅供输出。更新时间戳。 |
RetailProductRecognitionConfig
JSON 表示法
{
"productDetectionModel": string,
"detectionConfidenceThreshold": float,
"recognitionConfidenceThreshold": float,
"additionalConfig": { object }
}
字段
|
productDetectionModel | 字符串 | 必需。用于检测输入图片中的商品的模型。支持的值:“builtin/stable”(默认值)或 Vertex AI 模型资源名称。 |
---|---|---|
detectionConfidenceThreshold | 浮点数 | 可选。用于过滤检测结果的置信度阈值。如果未设置,系统将使用默认值。 |
recognitionConfidenceThreshold | 浮点数 | 可选。用于过滤识别结果的置信度阈值。如果未设置,系统将使用默认值。 |
additionalConfig | object (Struct format) | 可选。商品识别的其他配置。 |
RetailTagRecognitionConfig
JSON 表示法
{
"tagDetectionModel": string,
"tagParsingModel": string,
"detectionConfidenceThreshold": float,
"parsingConfidenceThreshold": float,
"additionalConfig": { object }
}
字段
tagDetectionModel | 字符串 | 必需。用于检测输入图片中的标签的模型。支持的值:Vertex AI 模型资源。 |
---|---|---|
tagParsingModel | 字符串 | 必需。用于解析检测到的代码中的文本的模型。支持的值:Vertex AI 模型资源。 |
detectionConfidenceThreshold | 浮点数 | 可选。用于过滤检测结果的置信度阈值。如果未设置,系统将使用默认值。 |
parsingConfidenceThreshold | 浮点数 | 可选。用于过滤文本解析结果的置信度阈值。如果未设置,系统将使用默认值。 |
additionalConfig | object (Struct format) | 可选。用于代码识别的其他配置。 |
方法:projects.locations.retailEndpoints.create
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*}/retailEndpoints
路径参数
父级 | 字符串 | 必需。父级标识符。 |
请求正文
请求正文包含一个 RetailEndpoint
实例。
响应正文
如果成功,响应正文将包含一个新创建的 RetailEndpoint
实例。
方法:projects.locations.retailEndpoints.get
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailEndpoints/*}
路径参数
name | 字符串 | 必需。RetailEndpoint 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文包含一个 RetailEndpoint
实例。
方法:projects.locations.retailEndpoints.list
HTTP 请求
GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*}/retailEndpoints
路径参数
父级 | 字符串 | 必需。父级标识符。 |
查询参数
过滤条件 | 字符串 | 可选。用于过滤请求结果的表达式。 |
---|---|---|
pageToken | 字符串 | 可选。标识服务器应返回的结果页面的令牌。 |
pageSize | 整数 | 可选。请求的页面大小。 服务器返回的项可能要比请求的少。如果未指定,服务器会选择相应的默认值。 |
orderBy | 字符串 | 可选。要按升序排序的字段的逗号分隔列表。在字段名称后面使用“desc”表示降序。 |
请求正文
请求正文必须为空。
响应正文
如果成功,响应正文将包含结构如下的数据:
JSON 表示法
{
"retailEndpoints": [
{
object (RetailEndpoint)
}
],
"nextPageToken": string
}
方法:projects.locations.retailEndpoints.delete
HTTP 请求
DELETE https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailEndpoints/*
路径参数
name | 字符串 | 必需。RetailEndpoint 标识符。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文为空。
方法:projects.locations.retailEndpoints.deployRetailProductRecognitionIndex
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{retailEndpoint=projects/*/locations/*/retailEndpoints/*}:deployRetailProductRecognitionIndex
路径参数
retailEndpoint | 字符串 | 必需。RetailProductRecognitionIndex 部署到的 RetailEndpoint 资源的资源名称。 |
请求正文
JSON 表示法
{
"retailProductRecognitionIndex": string,
}
字段
retailProductRecognitionIndex | 字符串 | 必需。要部署的 RetailProductRecognitionIndex 的资源名称。 |
响应正文
如果成功,则响应正文包含一个 Operation
实例。
方法:projects.locations.retailEndpoints.undeployRetailProductRecognitionIndex
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{retailEndpoint=projects/*/locations/*/retailEndpoints/*}:undeployRetailProductRecognitionIndex
路径参数
retailEndpoint | 字符串 | 必需。取消部署将作用于的 RetailEndpoint 资源的资源名称。 |
请求正文
请求正文必须为空。
响应正文
如果成功,则响应正文包含一个 Operation
实例。
方法:projects.locations.retailEndpoints.batchAnalyze
HTTP 请求
POST https://visionai.googleapis.com/v1alpha1/{retailEndpoint=projects/*/locations/*/retailEndpoints/*}:batchAnalyze
路径参数
retailEndpoint | 字符串 | 必需。用于处理推理请求的 RetailEndpoint 的资源名称。 |
请求正文
JSON 表示法
{
"gcsSource": string,
"features": { object(Feature) },
// Union field output can be only one of the following:
"outputGcsDestination": string,
"corpus": string,
// End of list of possible types for union field output.
"bigqueryTable": string
}
字段
gcsSource | 字符串 | 必需。输入内容所在的 Cloud Storage 位置。可以提供多个输入位置。系统会一次性处理所有输入位置的内容。支持的内容:TXT 文件,其中每行都是图片的完整路径。一次请求最多可支持 5 万张图片。 |
---|---|---|
outputGcsDestination | 字符串 | 可选。要写入输出的目录的 Cloud Storage 位置。 |
corpus | 字符串 | 可选。图片仓库语料库的资源名称。暂不支持。 |
bigqueryTable | 字符串 | 可选。用于导出注释的 BigQuery 表的资源名称。格式为“projects/*/datasets/*/tables/*”。如果设置此参数,系统还会将通过机器学习推理生成的注释导出到给定的 BigQuery 表。暂不支持。 |
features[] | 对象 | 必需。要执行的机器学习推理类型。 |
功能
JSON 表示法
{
"type": enum(Type),
"productRecognitionConfig": object(RetailProductRecognitionConfig),
"tagRecognitionConfig": object(RetailTagRecognitionConfig)
}
字段
类型 | 枚举 | 必需。地图项类型。 |
---|---|---|
productRecognitionConfig | object | 可选。商品识别功能的每次请求替换项。只有在 type 设置为 TYPE_PRODUCT_RECOGNITION 时,此字段才有效。 |
tagRecognitionConfig | object | 可选。每项请求替换项(适用于代码识别功能)。只有在 type 设置为 TYPE_TAG_RECOGNITION 时,此参数才有效。 |
响应正文
如果成功,则响应正文包含一个 Operation
实例。
类型
GcsSource
JSON 表示法
{
"uris": [string]
}
字段
uris[] | 字符串 | 必需。对 Cloud Storage 路径的引用。 |
类型
枚举值
TYPE_UNSPECIFIED | 默认值。不应使用。 |
---|---|
TYPE_PRODUCT_RECOGNITION | 产品识别。必须在已部署 RetailProductRecognitionIndex 的 RetailEndpoint 上使用。 |
TYPE_TAG_RECOGNITION | 代码检测和解析。必须在包含 RetailTagRecognitionConfig 的 RetailEndpoint 上使用。 |
RetailProductIoFormat
JSON 表示法
{
"retailProduct": { object(RetailProduct) },
"retailProductImages": [ { object(RetailProductImage) }]
}
字段
retailProduct | 对象 | 必需。要导入的 RetailProduct |
---|---|---|
retailProductImages[ ] | object | 可选。要导入的给定 RetailProduct 的 RetailProductImage 。 |
RetailResourceState
枚举值
RETAIL_RESOURCE_STATE_UNSPECIFIED | 默认值。不应使用。 |
---|---|
RETAIL_RESOURCE_STATE_CREATING | 状态创建。 |
RETAIL_RESOURCE_STATE_CREATED | 已创建状态。 |
RETAIL_RESOURCE_STATE_UPDATING | 状态更新中。 |
RETAIL_RESOURCE_STATE_DELETED | 状态:已删除。 |
RETAIL_RESOURCE_STATE_ERROR | 状态错误。 |