AnnotateImageRequest

要求在使用者提供的圖片上執行 Google Cloud Vision API 工作,並提供使用者要求的功能和背景資訊。

JSON 表示法
{
  "image": {
    object (Image)
  },
  "features": [
    {
      object (Feature)
    }
  ],
  "imageContext": {
    object (ImageContext)
  }
}
欄位
image

object (Image)

要處理的圖片。

features[]

object (Feature)

要求的功能。

imageContext

object (ImageContext)

圖片可能會附帶的其他背景資訊。

圖片

用於執行 Google Cloud Vision API 工作之用途的用戶端映像檔。

JSON 表示法
{
  "content": string,
  "source": {
    object (ImageSource)
  }
}
欄位
content

string (bytes format)

圖片內容,以位元組串流表示。注意:與所有 bytes 欄位一樣,protobuffers 會使用純二進位表示法,而 JSON 表示法則會使用 base64。

Base64 編碼字串。

source

object (ImageSource)

Google Cloud Storage 圖片位置,或可公開存取的圖片網址。如果圖片同時提供 contentsource,系統會優先採用 content,並用於執行圖片註解要求。

圖片來源

外部圖片來源 (Google Cloud Storage 或網頁網址圖片位置)。

JSON 表示法
{
  "gcsImageUri": string,
  "imageUri": string
}
欄位
gcsImageUri

string

改用 imageUri

格式為 gs://bucket_name/object_name 的 Google Cloud Storage URI。不支援物件版本管理功能。詳情請參閱「Google Cloud Storage 要求 URI」。

imageUri

string

來源圖片的 URI。可以是下列任一項:

  1. 格式為 gs://bucket_name/object_name 的 Google Cloud Storage URI。不支援物件版本管理功能。詳情請參閱 Google Cloud Storage 要求 URI

  2. 公開可存取的圖片 HTTP/HTTPS 網址。從 HTTP/HTTPS 網址擷取圖片時,Google 無法保證要求一定能完成。如果指定主機拒絕要求 (例如因要求節流或拒絕服務攻擊防護),或是 Google 為了防止濫用而節流網站要求,您的要求可能會失敗。正式版應用程式不應依賴外部代管的圖片。

如果同時指定 gcsImageUriimageUri,則以 imageUri 的效力優先。