Method: files.annotate

对一批文件执行图片检测和注释的服务。目前仅支持“application/pdf”“image/tiff”和“image/gif”。

此服务最多从每个提供的文件中提取最多 5 个(在 AnnotateFileRequest.pages 框架 (gif) 或网页(pdf 或 tiff)中分别提取 5 个图片,并对提取的每个图片执行检测和注释。

HTTP 请求

POST https://vision.googleapis.com/v1/files:annotate

网址采用 gRPC 转码语法。

请求正文

请求正文中包含结构如下的数据:

JSON 表示法
{
  "requests": [
    {
      object (AnnotateFileRequest)
    }
  ],
  "parent": string
}
字段
requests[]

object (AnnotateFileRequest)

必需。文件注释请求列表。目前,BatchAnnotateFilesRequest 中仅支持使用一个 AnnotateFileRequest。

parent

string

可选。定位项目和位置以进行呼叫。

格式:projects/{project-id}/locations/{location-id}

如果未指定父级,则系统将自动选择区域。

支持的 location-id:us:仅限美国,asia:东亚地区(例如日本、台湾),eu:欧盟。

示例:projects/project-A/locations/eu

响应正文

如果成功,则响应正文包含一个 BatchAnnotateFilesResponse 实例。

授权范围

需要以下 OAuth 范围之一:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/cloud-vision

如需了解详情,请参阅身份验证概览