Google云视觉网页检测APIreturns只有10条回复

Google cloud vision web detection API returns only 10 responses

我正在使用 Google 云视觉网络检测 API 来检测图像的使用位置。但即使是 Google 的标志,我也总是最多得到 10 个回复。是 API 的限制还是我遗漏了一些东西,因为文档中没有提到任何内容。

来自 Cloud Vision API 请求的默认结果数 return 为 10(为了限制响应的大小),因此只有十个最准确的标识是 return编辑。但是,您可以指定 maxResults 参数以检索更大的结果列表。这里有几个 API 调用的示例,这些调用 return 默认 10 个实体,如果使用 maxResults 参数指定则更多。您可以自己 运行 这些查询并查看结果:

  • First query 没有 maxResults 参数,return默认 10 个实体。
  • Second query"maxResults": 30,return 30 个实体。

因此,为了从此 API 调用中获得更多结果,唯一的区别是您必须在 features 条目中添加此额外参数:

"features": [
    {
     "type": "WEB_DETECTION",
     "maxResults": 30
    }
   ]

另请注意 Web Detection functionality of Google Cloud Vision API is still under development and there are some features that are still in beta. There is also a public feature request with more functionalities for the web detection application that you can track in the following Public Issue Tracker post.