產品辨識器指南

產品辨識工具模型可協助您辨識並瞭解所提供圖片中的產品。圖片應只包含要辨識的單一產品項目。

這個模型可做為主要 AI 建構區塊,用於分析及解讀從零售商店擷取的產品圖片資料。

標記辨識工具和產品辨識工具的應用實例

產品辨識器標籤辨識器模型可做為主要的 AI 建構區塊,用於分析及解讀產品和標籤圖片資料 (可能從零售商店擷取)。

產品辨識器和標籤辨識器模型整合了多項核心 Google AI 模型和資料功能,協助零售商和/或技術合作夥伴解決瞭解產品和價格標籤圖片資料時遇到的主要問題,包括:

  • 辨識,也就是瞭解圖片中的產品。
  • 根據使用者定義的鍵/值組合實體擷取結構定義,辨識並剖析標記 (例如價格標籤或其他文字標籤)。

特別是,我們納入了多個 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 資源,協助您建構產品目錄、管理產品資料集、建立索引,以及部署產品辨識服務。說明如下:

API 概念圖

目錄:根資源,代表零售商提供的所有產品容器。

產品:代表商家提供的產品。ProductCatalog 的子項資源。

ProductImage:代表單一產品檢視畫面的圖片。ProductImageProduct 的子項資源。

ProductSet:更精細的容器,用於整理及分組相同 Catalog 中的產品。一個 ProductSet 可能包含一或多個 Product,但不會「擁有」所含的 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。您可以使用有意義的字串 ID,例如「product-ABC」,也可以使用隨機產生的 ID,例如 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'

進一步瞭解 IAM 繫結

產品辨識工具使用者歷程

  1. 建立目錄。
  2. 將產品和 (選用) ProductImages匯入 Catalog
  3. 查看及修改 ProductProductImages,並視需要建立ProductSet,以更精細的粒度整理產品清單。
  4. 從整個 CatalogProductSet 建立 Index
  5. 建立 Endpoint 並設定所需的產品辨識設定,然後將 Index 部署至該 Endpoint
  6. 使用 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:每行都是要匯入的產品全球交易品項識別碼
  • 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」資源的範圍內不重複即可,也就是說,只要屬於不同的「retailProduct」資源,即使有 2 個「retailProductImages」的「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-8、GTIN-13、GTIN-14 和 UPC(也稱為 GTIN-12) 格式。如要進一步瞭解全球交易品項識別碼格式,請參閱這篇文章

  • PRODUCT_ID=您的產品 ID
  • = 產品的全球交易品項識別碼,例如 50735854797459、00040094314034GTIN
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 建立產品
  • PRODUCT_ID=您的產品 ID
  • THIRD_PARTY_ID=第三方 ID
  • OWNER=擁有第三方 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/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

產品集

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

字串 (時間戳記格式)

僅供輸出。這個 RetailCatalog 的建立時間戳記。

updateTime

字串 (時間戳記格式)

僅供輸出。更新時間戳記。

resourceState

enum

僅供輸出。RetailCatalog 的狀態。

標籤

map (key: string, value: string)

含有使用者定義中繼資料的標籤,可整理 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

路徑參數

parent 字串 這是必要旗標,父項 ID。

要求主體

要求主體包含 RetailCatalog 的執行個體。

回應主體

如果成功,回應主體會包含新建立的 RetailCatalog 例項。

方法:projects.locations.retailCatalogs.get

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/us-central1/retailCatalogs/*}

路徑參數

名稱 字串 這是必要旗標,RetailCatalog ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會包含 RetailCatalog 的執行個體。

方法:projects.locations.retailCatalogs.list

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/us-central1}/retailCatalogs

路徑參數

parent 字串 這是必要旗標,父項 ID。

查詢參數

篩選器 字串 選用。用於篩選要求結果的運算式。
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/*}

路徑參數

名稱 字串 這是必要旗標,RetailCatalog ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會包含 Operation 的執行個體。

方法:projects.locations.retailCatalogs.importRetailProducts

HTTP 要求

POST https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/us-central1/retailCatalogs/*}:importRetailProducts

路徑參數

名稱 字串 這是必要旗標,RetailCatalog 資源名稱。

要求主體

JSON 表示法

{
  "gcsSource": { object(GcsSource) },
  "format": enum(Format)
}

欄位

gcsSource 物件 這是必要旗標,輸入內容的 Cloud Storage 位置。 您可以提供多個輸入位置。系統會一次匯入所有輸入位置的內容。支援的副檔名:1. JSONL 檔案。每行都是 RetailProductIoFormat 的 JSON 格式。
2. TXT 檔案。每行都是要匯入的產品全球交易品項識別碼。
格式 列舉 這是必要旗標,匯入檔案格式。

格式化 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

含有「鍵」:值組合清單的物件。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

createTime

字串 (時間戳記格式)

僅供輸出。建立時間戳記。

updateTime

字串 (時間戳記格式)

僅供輸出。更新時間戳記。

RetailThirdPartyId JSON 呈現方式

{
  "id": string,
  "owner": string
}

欄位

id 字串 零售商或製造商使用的第三方 ID (例如 SKU 或 MPN)。
擁有者 字串 「擁有」第三方 ID 的實體,例如製造商或銷售這項產品的零售商。

方法:projects.locations.retailCatalogs.retailProducts.create

HTTP 要求

POST https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProducts

路徑參數

parent 字串 這是必要旗標,父項 ID。

要求主體

要求主體包含 RetailProduct 的執行個體。

回應主體

如果成功,回應主體會包含新建立的 RetailProduct 例項。

方法:projects.locations.retailCatalogs.retailProducts.get

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProducts/*

路徑參數

名稱 字串 這是必要旗標,RetailProduct ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會包含 RetailProduct 的執行個體。

方法:projects.locations.retailCatalogs.retailProducts.list

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProducts

路徑參數

parent 字串 這是必要旗標,父項 ID。

查詢參數

篩選器 字串 選用。用於篩選要求結果的運算式。
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/*

路徑參數

名稱 字串 這是必要旗標,RetailProduct ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會留白。

資源: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

含有「鍵」:值組合清單的物件。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

createTime

字串 (時間戳記格式)

僅供輸出。建立時間戳記。

updateTime

字串 (時間戳記格式)

僅供輸出。更新時間戳記。

SourceType ENUM 值

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

路徑參數

parent 字串 這是必要旗標,父項 ID。

要求主體

要求主體包含 RetailProductImage 的執行個體。

回應主體

如果成功,回應主體會包含新建立的 RetailProductImage 例項。

方法:projects.locations.retailCatalogs.retailProducts.retailProductImages.get

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProducts/*/retailProductImages/*

路徑參數

名稱 字串 這是必要旗標,RetailProductImage ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會包含 RetailProductImage 的執行個體。

方法:projects.locations.retailCatalogs.retailProducts.retailProductImages.list

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*/retailProducts/*}/retailProductImages

路徑參數

parent 字串 這是必要旗標,父項 ID。

查詢參數

篩選器 字串 選用。用於篩選要求結果的運算式。
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/*

路徑參數

名稱 字串 這是必要旗標,RetailProductImage ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會留白。

資源: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

含有「鍵」:值組合清單的物件。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

createTime

字串 (時間戳記格式)

僅供輸出。建立時間戳記。

updateTime

字串 (時間戳記格式)

僅供輸出。更新時間戳記。

方法:projects.locations.retailCatalogs.retailProductSets.create

HTTP 要求

POST https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProductSets

路徑參數

parent 字串 這是必要旗標,父項 ID。

要求主體

要求主體包含 RetailProductSet 的例項。

回應主體

如果成功,回應內容會含有新建立的 RetailProductSet 例項。

方法:projects.locations.retailCatalogs.retailProductSets.get

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProductSets/*

路徑參數

名稱 字串 這是必要旗標,RetailProductSet ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會包含 RetailProductSet 的例項。

方法:projects.locations.retailCatalogs.retailProductSets.list

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProductSets

路徑參數

parent 字串 這是必要旗標,父項 ID。

查詢參數

篩選器 字串 選用。用於篩選要求結果的運算式。
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/*

路徑參數

名稱 字串 這是必要旗標,RetailProductSet ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會留白。

方法:projects.locations.retailCatalogs.retailProductSets.add

HTTP 要求

POST https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProductSets/*}:remove

路徑參數

名稱 字串 這是必要旗標,RetailProductSet 資源名稱。

要求主體

JSON 表示法

{
  "productIds": [string],
  "productFilter": string
}

欄位


productIds[ ]

字串

要新增的 RetailProducts 資源 ID。所有 RetailProduct 都必須與指定的目的地 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

路徑參數

名稱 字串 這是必要旗標,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

enum

僅供輸出。RetailProductRecognitionIndex 的狀態。

標籤

map (key: string, value: string)

含有使用者定義中繼資料的標籤,用於整理 RetailProductRecognitionIndex。

標籤鍵與值的長度不得超過 64 個字元 (Unicode 碼位),只能使用小寫英文字母、數字、底線和破折號。可使用國際字元。

如要進一步瞭解標籤和查看範例,請參閱 https://goo.gl/xmQnxf

含有「鍵」:值組合清單的物件。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

createTime

字串 (Timestamp 格式)

僅供輸出。建立時間戳記。

updateTime

字串 (Timestamp 格式)

僅供輸出。更新時間戳記。

方法:projects.locations.retailCatalogs.retailProductRecognitionIndexes.create

HTTP 要求

POST https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProductRecognitionIndexes

路徑參數

parent 字串 這是必要旗標,父項 ID。

要求主體

要求主體包含 RetailProductRecognitionIndex 的執行個體。

回應主體

如果成功,回應主體會包含新建立的 RetailProductRecognitionIndex 例項。

方法:projects.locations.retailCatalogs.retailProductRecognitionIndexes.get

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailCatalogs/*/retailProductRecognitionIndexes/*

路徑參數

名稱 字串 這是必要旗標,RetailProductRecognitionIndex ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會包含 RetailProductRecognitionIndex 的執行個體。

方法:projects.locations.retailCatalogs.retailProductRecognitionIndexes.list

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*/retailCatalogs/*}/retailProductRecognitionIndexes

路徑參數

parent 字串 這是必要旗標,父項 ID。

查詢參數

篩選器 字串 選用。用於篩選要求結果的運算式。
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/*

路徑參數

名稱 字串 這是必要旗標,ProductRecognitionIndex ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會包含 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

含有「鍵」:值組合清單的物件。例如:{ "name": "wrench", "mass": "1.3kg", "count": "3" }。

createTime

字串 (Timestamp 格式)

僅供輸出。建立時間戳記。

updateTime

字串 (Timestamp 格式)

僅供輸出。更新時間戳記。

RetailProductRecognitionConfig

JSON 表示法

{
  "productDetectionModel": string,
  "detectionConfidenceThreshold": float,
  "recognitionConfidenceThreshold": float,
  "additionalConfig": { object }
}

欄位

|

productDetectionModel 字串 這是必要旗標,用來偵測輸入圖片中產品的模型。支援的值:「builtin/stable」(預設值) 或 Vertex AI 模型資源名稱。
detectionConfidenceThreshold 浮點數 選用。用於篩選偵測結果的信賴度門檻。如未設定,系統會使用預設值。
recognitionConfidenceThreshold 浮點數 選用。用於篩選辨識結果的信賴度門檻。如未設定,系統會使用預設值。
additionalConfig 物件 (struct 格式) 選用。產品辨識的其他設定。

RetailTagRecognitionConfig

JSON 表示法

{
  "tagDetectionModel": string,
  "tagParsingModel": string,
  "detectionConfidenceThreshold": float,
  "parsingConfidenceThreshold": float,
  "additionalConfig": { object }
}

欄位

tagDetectionModel 字串 這是必要旗標,用於偵測輸入圖片中標記的模型。支援的值:Vertex AI 模型資源。
tagParsingModel 字串 這是必要旗標,模型會剖析偵測到的代碼中的文字。支援的值:Vertex AI 模型資源。
detectionConfidenceThreshold 浮點數 選用。用於篩選偵測結果的信賴度門檻。如未設定,系統會使用預設值。
parsingConfidenceThreshold 浮點數 選用。用於篩選文字剖析結果的信賴度門檻。如未設定,系統會使用預設值。
additionalConfig 物件 (struct 格式) 選用。代碼辨識的其他設定。

方法:projects.locations.retailEndpoints.create

HTTP 要求

POST https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*}/retailEndpoints

路徑參數

parent 字串 這是必要旗標,父項 ID。

要求主體

要求主體包含 RetailEndpoint 的執行個體。

回應主體

如果成功,回應主體會包含新建立的 RetailEndpoint 例項。

方法:projects.locations.retailEndpoints.get

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{name=projects/*/locations/*/retailEndpoints/*}

路徑參數

名稱 字串 這是必要旗標,RetailEndpoint ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會包含 RetailEndpoint 的執行個體。

方法:projects.locations.retailEndpoints.list

HTTP 要求

GET https://visionai.googleapis.com/v1alpha1/{parent=projects/*/locations/*}/retailEndpoints

路徑參數

parent 字串 這是必要旗標,父項 ID。

查詢參數

篩選器 字串 選用。用於篩選要求結果的運算式。
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/*

路徑參數

名稱 字串 這是必要旗標,RetailEndpoint ID。

要求主體

要求主體必須為空白。

回應主體

如果成功,回應主體會留白。

方法: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 物件 <0x0 選用。針對產品辨識功能,在要求中覆寫設定。只有在類型設為 TYPE_PRODUCT_RECOGNITION 時,這項屬性才會生效。
tagRecognitionConfig 物件 <0x0 選用。每個要求都會覆寫標記辨識功能。只有在類型設為 TYPE_TAG_RECOGNITION 時,這項設定才會生效。

回應主體

如果成功,回應主體會包含 Operation 的執行個體。

類型

GcsSource

JSON 表示法

{
  "uris": [string]
}

欄位

uris[] 字串 這是必要旗標,Cloud Storage 路徑的參照。

類型

ENUM 值

TYPE_UNSPECIFIED 預設值。不應使用。
TYPE_PRODUCT_RECOGNITION 產品辨識。必須在已部署 RetailProductRecognitionIndexRetailEndpoint 上使用。
TYPE_TAG_RECOGNITION 標記偵測和剖析。必須在 RetailEndpoint 上搭配 RetailTagRecognitionConfig 使用。

RetailProductIoFormat

JSON 表示法

{
  "retailProduct": { object(RetailProduct) },
  "retailProductImages": [ { object(RetailProductImage) }]
}

欄位

retailProduct 物件 這是必要旗標,可匯入 RetailProduct 筆資料
retailProductImages[ ] object 選用。要匯入的 RetailProduct RetailProductImage

RetailResourceState

ENUM 值

RETAIL_RESOURCE_STATE_UNSPECIFIED 預設值。請勿使用。
RETAIL_RESOURCE_STATE_CREATING 正在建立狀態。
RETAIL_RESOURCE_STATE_CREATED 狀態已建立。
RETAIL_RESOURCE_STATE_UPDATING 正在更新狀態。
RETAIL_RESOURCE_STATE_DELETED 狀態:已刪除。
RETAIL_RESOURCE_STATE_ERROR 狀態錯誤。