商品识别器模型可帮助您识别和了解所提供图片中的商品。图片中应仅包含您要识别的单个商品。
此模型可作为分析和解读产品图片数据(可从零售店捕获)的主要 AI 基础组件。
标记识别器和商品识别器的应用场景
商品识别器和标签识别器模型可作为主要的 AI 构建块,用于分析和解读您可能从零售店捕获的商品和标签图像数据。
商品识别器和标签识别器模型整合了多项核心 Google AI 建模和数据功能,可帮助零售商和/或技术合作伙伴解决在理解商品和价格标签图片数据方面遇到的关键问题,包括:
- 识别,即了解图片中包含什么商品。
- 根据用户定义的键值对实体提取架构识别和解析标记(例如价格标签或任何其他文本标签)。
具体而言,Gemini Pro 包含多项差异化的 Google AI 模型,可支持解决这些应用场景问题,例如
- 商品缩略图视觉嵌入模型,可将商品缩略图转换为数值特征空间表示形式。
- Google OCR 模型,用于提取图片中所有可见的文本。
- Google 实体提取模型(可自定义),可将原始文本转换为用户定义的键值对命名实体。
除了这些 Google AI 模型之外,商品识别器还利用了 Google 庞大的商品信息数据库。此商品数据库中的商品数据包括商品的 GTIN / UPC 标识码、商品品牌、商品名和跨语言说明、商品徽标,以及具有各种包装变体的图片。借助包含上述商品缩略图视觉嵌入模型的商品数据库,商品识别器模型能够立即识别许多商品。
两项主要的 AI 功能是商品识别器和标记识别器模型。
商品识别器功能
此模型可在全球贸易项目代码 (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 概念
我们提供了六个 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,以更精细地整理商品列表。 - 创建
Index,可以从整个Catalog创建,也可以从ProductSet创建。 - 创建具有所需商品识别配置的
Endpoint,并向其部署Index。 - 使用
ProductRecognition功能执行BatchAnalyze。在后端,系统将识别每张输入图片中的商品,并使用视觉信号和 OCR 文本信号从指定索引中检索前 K 个相似商品。
API 资源管理(目录和 Indexset)
目录
创建目录
- 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”资源的范围内保持唯一即可,这意味着只要两个“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 创建商品
我们支持 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 (Timestamp format) |
仅限输出。相应 RetailCatalog 的创建时间戳。 |
updateTime |
string (Timestamp format) |
仅限输出。更新时间戳。 |
resourceState |
enum |
仅限输出。RetailCatalog 的状态。 |
个标签 |
map (key: string, value: string) |
带有用户定义的元数据的标签,用于整理您的 RetailCatalog。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需详细了解标签和查看标签示例,请访问 https://goo.gl/xmQnxf。 包含 "key": value 对列表的对象。例如:{ "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
路径参数
| 父级 | 字符串 | 必需。父级标识符。 |
查询参数
| filter | 字符串 | 可选。用于过滤请求结果的表达式。 |
|---|---|---|
| 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 |
enum |
可选。来源类型 |
gcsUri |
字符串 |
可选。RetailProductImage 的 Cloud Storage 位置。除非图片由 Google 提供(例如,当来源类型为 SOURCE_TYPE_GOOGLE 时),否则应设置此字段。 |
resourceState |
enum |
仅限输出。RetailProductImage 的状态。 |
个标签 |
map (key: string, value: string) |
带有用户定义元数据的标签,用于整理 RetailProductImage。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需了解详情和标签示例,请访问 https://goo.gl/xmQnxf。 包含 "key": value 对列表的对象。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
createTime |
string (Timestamp format) |
仅限输出。创建时间戳。 |
updateTime |
string (Timestamp format) |
仅限输出。更新时间戳。 |
RetailThirdPartyId JSON 表示法
{
"id": string,
"owner": string
}
字段
| id | 字符串 | 零售商或制造商使用的第三方 ID(例如 SKU 或 MPN)。 |
| 所有者 | 字符串 | 第三方标识符的“所有者”实体,例如制造商或销售相应产品的零售商。 |
方法: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
路径参数
| 父级 | 字符串 | 必需。父级标识符。 |
查询参数
| filter | 字符串 | 可选。用于过滤请求结果的表达式。 |
|---|---|---|
| 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 |
enum |
可选。来源类型 |
gcsUri |
字符串 |
可选。RetailProductImage 的 Cloud Storage 位置。除非图片由 Google 提供(例如,当来源类型为 SOURCE_TYPE_GOOGLE 时),否则应设置此字段。 |
resourceState |
enum |
仅限输出。RetailProductImage 的状态。 |
个标签 |
map (key: string, value: string) |
带有用户定义元数据的标签,用于整理 RetailProductImage。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需了解详情和标签示例,请访问 https://goo.gl/xmQnxf。 包含 "key": value 对列表的对象。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
createTime |
string (Timestamp format) |
仅限输出。创建时间戳。 |
updateTime |
string (Timestamp format) |
仅限输出。更新时间戳。 |
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
路径参数
| 父级 | 字符串 | 必需。父级标识符。 |
查询参数
| filter | 字符串 | 可选。用于过滤请求结果的表达式。 |
|---|---|---|
| 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 |
enum |
仅限输出。RetailProductSet 的状态。 |
个标签 |
map (key: string, value: string) |
带有用户定义的元数据的标签,用于整理 RetailProductSet。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需了解详情和标签示例,请访问 https://goo.gl/xmQnxf。 包含 "key": value 对列表的对象。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
createTime |
string (Timestamp format) |
仅限输出。创建时间戳。 |
updateTime |
string (Timestamp format) |
仅限输出。更新时间戳。 |
方法: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
路径参数
| 父级 | 字符串 | 必需。父级标识符。 |
查询参数
| filter | 字符串 | 可选。用于过滤请求结果的表达式。 |
|---|---|---|
| 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。如果指定的 RetailProduct 不属于此 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 |
enum |
仅限输出。RetailProductRecognitionIndex 的状态。 |
个标签 |
map (key: string, value: string) |
带有用户定义元数据的标签,用于整理 RetailProductRecognitionIndex。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需了解详情和标签示例,请访问 https://goo.gl/xmQnxf。 包含 "key": value 对列表的对象。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
createTime |
string (Timestamp format) |
仅限输出。创建时间戳。 |
updateTime |
string (Timestamp format) |
仅限输出。更新时间戳。 |
方法: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
路径参数
| 父级 | 字符串 | 必需。父级标识符。 |
查询参数
| filter | 字符串 | 可选。用于过滤请求结果的表达式。 |
|---|---|---|
| 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 |
enum |
仅限输出。RetailProductRecognitionIndex 的状态。 |
个标签 |
map (key: string, value: string) |
带有用户定义元数据的标签,用于整理 RetailProductRecognitionIndex。 标签键和值不能超过 64 个字符(Unicode 代码点),并且只能包含小写字母、数字字符、下划线和短划线。允许使用国际字符。 如需了解详情和标签示例,请访问 https://goo.gl/xmQnxf。 包含 "key": value 对列表的对象。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。 |
createTime |
string (Timestamp format) |
仅限输出。创建时间戳。 |
updateTime |
string (Timestamp format) |
仅限输出。更新时间戳。 |
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
路径参数
| 父级 | 字符串 | 必需。父级标识符。 |
查询参数
| filter | 字符串 | 可选。用于过滤请求结果的表达式。 |
|---|---|---|
| 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 | 字符串 | 必需。RetailEndpoint 资源(RetailProductRecognitionIndex 部署到的资源)的资源名称。 |
请求正文
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 <0x0 | 可选。针对商品识别功能的每个请求替换。仅当类型设置为 TYPE_PRODUCT_RECOGNITION 时,此字段才有效。 |
| tagRecognitionConfig | object <0x0 | 可选。针对标记识别功能的每个请求替换项。仅当类型设置为 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 | 状态错误。 |