產品辨識工具模型可協助您辨識並瞭解提供圖片或貨架上的產品。
這個模型可做為主要 AI 構件,用於分析及解讀零售商店中的產品圖像資料。舉例來說,你可以在本機攝影機或行動裝置拍攝的貨架相片上使用這個模型。
標記辨識器和產品辨識器的用途
產品辨識器模型和標籤辨識器模型可做為主要 AI 構件,用於分析及解讀零售商店中產品和標籤的圖像資料,例如透過安裝的攝影機或行動裝置 / 平台擷取的貨架掃描圖像。
產品辨識器和標籤辨識器模型整合了多項 Google AI 模型和資料核心功能,可協助零售商和/或技術合作夥伴解決零售貨架的關鍵問題,包括:
- 偵測、辨識並瞭解圖片或貨架上的產品。
- 根據使用者定義的鍵/值組合實體擷取架構,偵測、辨識及剖析標記 (例如價格標記或任何其他文字標記標記)。
具體來說,貨架檢查解決方案內含多個 Google AI 模型,可支援解決這些用途問題,例如:
- 產品偵測模型 (由 Google 預先訓練,但您仍可自訂)。
- 產品縮圖視覺嵌入模型,可將產品縮圖圖片轉換為數值特徵空間表示法。
- Google OCR 模型,可擷取圖片中顯示的所有文字。
- Google 實體擷取模型 (可自訂),可將原始文字轉換為使用者定義的鍵/值組合命名實體。
除了這些 Google AI 模型之外,貨架檢查解決方案還會運用 Google 龐大的產品資訊資料庫。這個產品資料庫中的產品資料包括產品的全球交易品項識別碼 / 通用產品代碼、產品品牌、名稱、多國語言說明、產品標誌,以及各種包裝變化的圖片。產品資料庫包含先前提到的產品縮圖視覺嵌入模型,可讓產品辨識工具模型立即辨識許多產品。
舉例來說,假設有下列擷取的貨架圖片,貨架檢查解決方案的目標是:
- 偵測並定位圖片中的所有產品商品盒 (可見,且未嚴重遮蔽),並在全球交易品項識別碼 / 通用產品代碼層級辨識個別產品商品盒的產品身分。
- 偵測並在地化圖片中的所有標記方塊 (可見),辨識標記中的所有文字字串,然後嘗試將文字剖析為使用者定義的鍵/值對實體擷取架構,例如產品項目說明、價格值。
啟用這些解決方案的兩大 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 概念
我們提供六種 API 資源,協助您建立產品目錄、管理產品資料集、建立索引,以及部署產品辨識服務。如下所述:
目錄:代表零售商提供的所有產品容器的根資源。
產品:代表商家提供的產品。Product
是 Catalog
的子資源。
ProductImage:代表某項產品的圖片。ProductImage
是 Product
的子項資源。
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'
產品辨識工具使用者歷程
- 建立目錄。
- 將產品和 (選用)
ProductImages
匯入至Catalog
。 - 查看及修改
Product
和ProductImages
,並視需要建立ProductSet
,以更精細的細節來整理產品清單。 - 建立
Index
,可從整個Catalog
或ProductSet
建立。 - 使用所需的產品辨識設定建立
Endpoint
,並將Index
部署至其中。 - 使用
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」資源的範圍內不重複即可,也就是說,只要「retailProductImages」屬於不同的「retailProduct」資源,就可以有 2 個「name」相同的「retailProductImages」。
- 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
產品
CreateProduct 搭配全球交易品項識別碼
我們支援 GTIN-8、GTIN-13、GTIN-14 和 UPC(也稱為 GTIN-12) 格式。如要進一步瞭解全球交易品項識別碼格式,請參閱這篇文章。
- PRODUCT_ID=您的產品 ID
- 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 建立產品
- 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,一種是從目錄建立,這會使用目錄中的所有內容;另一種是從產品集建立,這會只使用相關聯的產品和產品圖片。
- 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,
...
}
}
欄位
name |
字串 |
僅供輸出。RetailCatalog 的資源名稱 |
---|---|---|
displayName |
字串 |
選用。RetailCatalog 的顯示名稱。 |
createTime |
string (Timestamp format) |
僅供輸出。建立此 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。 |
查詢參數
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/*}
路徑參數
名稱 | 字串 | 這是必要旗標,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 | 這是必要旗標,匯入檔案格式。 |
格式化 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
}
欄位
name |
字串 |
僅供輸出。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 |
string (Timestamp 格式) |
僅供輸出。建立時間戳記。 |
updateTime |
string (Timestamp 格式) |
僅供輸出。更新時間戳記。 |
RetailThirdPartyId
JSON 呈現方式
{
"id": string,
"owner": string
}
欄位
id | 字串 | 零售商或製造商使用的第三方 ID (例如 SKU 或製造商零件編號)。 |
擁有者 | 字串 | 擁有第三方 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。 |
查詢參數
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/*
路徑參數
名稱 | 字串 | 這是必要旗標,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
}
欄位
name |
字串 |
僅供輸出。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 |
string (Timestamp format) |
僅供輸出。建立時間戳記。 |
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。 |
查詢參數
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/*
路徑參數
名稱 | 字串 | 這是必要旗標,RetailProductImage ID。 |
要求主體
要求主體必須為空白。
回應主體
如果成功,回應主體會留白。
資源:projects.locations.retailCatalogs.retailProductSets
JSON 表示法
{
"name": string,
"displayName": string,
"retailProductIds": [string],
"resourceState": enum(RetailResourceState),
"labels": {
string: string,
...
}
"createTime": string,
"updateTime": string
}
欄位
name |
字串 |
僅供輸出。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 |
string (Timestamp 格式) |
僅供輸出。建立時間戳記。 |
updateTime |
string (Timestamp 格式) |
僅供輸出。更新時間戳記。 |
方法: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。 |
查詢參數
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/*
路徑參數
名稱 | 字串 | 這是必要旗標,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。這些資源都必須屬於與指定目的地 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[ ] |
字串 |
要移除的 RetailProducts 資源 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
}
欄位
name |
字串 |
僅供輸出。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 |
string (Timestamp format) |
僅供輸出。建立時間戳記。 |
updateTime |
string (Timestamp format) |
僅供輸出。更新時間戳記。 |
方法: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。 |
查詢參數
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/*
路徑參數
名稱 | 字串 | 這是必要旗標,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
}
欄位
name |
字串 |
僅供輸出。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 |
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
路徑參數
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。 |
查詢參數
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/*
路徑參數
名稱 | 字串 | 這是必要旗標,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)
}
欄位
類型 | enum | 這是必要旗標,地圖項目類型。 |
---|---|---|
productRecognitionConfig | 物件 | (非必要) 產品辨識功能的個別要求覆寫值。只有在 type 設為 TYPE_PRODUCT_RECOGNITION 時才有效。 |
tagRecognitionConfig | 物件 | (非必要) 針對標記辨識功能的個別要求覆寫值。只有在 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[ ] | 物件 | 選用。要匯入的指定 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 | 狀態錯誤。 |