Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
AnnotateImageRequest
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
要求對使用者提供的圖片執行 Google Cloud Vision API 工作,並提供使用者要求的功能和情境資訊。
| JSON 表示法 |
{
"image": {
object(Image)
},
"features": [
{
object(Feature)
}
],
"imageContext": {
object(ImageContext)
},
"customLabelDetectionModels": [
string
]
} |
| 欄位 |
image |
object(Image)
要處理的圖片。
|
features[] |
object(Feature)
要求的功能。
|
imageContext |
object(ImageContext)
圖片可能附帶的額外背景資訊。
|
customLabelDetectionModels[] |
string
在 features.type 欄位中提出含有 CUSTOM_LABEL_DETECTION 值的要求時,CustomLabelDetectionModels 欄位必須指定要使用的自訂模型。模型名稱的格式會模仿自訂模型的資源網址:/projects/PROJECT_ID/models/MODEL_ID,如果模型屬於目前專案,則為 /models/MODEL_ID。
|
圖片
用戶端圖片,用於執行 Google Cloud Vision API 工作。
| JSON 表示法 |
{
"content": string,
"source": {
object(ImageSource)
}
} |
| 欄位 |
content |
string (bytes format)
圖片內容,以位元組串流表示。注意:與所有 bytes 欄位一樣,Protobuffer 使用純二進位表示法,而 JSON 表示法使用 Base64。 Base64 編碼字串。
|
source |
object(ImageSource)
Google Cloud Storage 圖片位置或可公開存取的圖片網址。如果圖片同時提供 content 和 source,系統會優先採用 content,並用來執行圖片註解要求。
|
圖片來源
外部圖片來源 (Google Cloud Storage 或網址圖片位置)。
| JSON 表示法 |
{
"gcsImageUri": string,
"imageUri": string
} |
| 欄位 |
gcsImageUri |
string
請改用 imageUri。 Google Cloud Storage URI,格式為 gs://bucket_name/object_name。不支援物件版本管理功能。詳情請參閱「Google Cloud Storage 要求 URI」。
|
imageUri |
string
來源圖片的 URI。可以是下列任一項:
格式為 gs://bucket_name/object_name 的 Google Cloud Storage URI。不支援物件版本管理功能。詳情請參閱「Google Cloud Storage 要求 URI」。
可公開存取的圖片 HTTP/HTTPS 網址。從 HTTP/HTTPS 網址擷取圖片時,Google 無法保證要求會完成。如果指定主機拒絕要求 (例如因要求節流或防止 DOS 攻擊),或 Google 為防止濫用而節流對網站的要求,您的要求可能會失敗。您不應依賴外部代管圖片來製作應用程式。
如果同時指定 gcsImageUri 和 imageUri,系統會優先採用 imageUri。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2026-01-29 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2026-01-29 (世界標準時間)。"],[],[]]