google-cloud-vision - Google Cloud Vision API 图像文件大小的当前限制是多少

标签 google-cloud-vision

在我的 Java 项目中,我使用 Google Cloud Vision API 从图像中提取文本。对于文本提取,我使用以下 piece of code .

今天,我发现 Google 更改了最大文件大小的限制。以前是 4 MB。

现在,基于Quotas and LimitsSupported Images ,对于托管在 Cloud Storage 或可公开访问的 URL 上的图像,最大图像文件大小应为 20 MB。此外,还有最大 JSON 请求对象大小 (10 MB)。

我正在使用托管在云存储上的图像选项。对于大于 ~7.95 MB (12000 x 6500) 的图像,我收到一条错误消息:

responses {
  error {
    code: 3
    message: "Invalid image contents: gs://... ."
  }
}

对于较小尺寸的图像,我得到了正确的响应。我知道 TEXT_DETECTION 和 DOCUMENT_TEXT_DETECTION 功能的建议尺寸为 1024 x 768,但根据以下注释,更高的尺寸应该不会有问题:

Note: generally, the Vision API requires images to be a sufficient size so that important features within the request can be easily distinguished. Sizes smaller or larger than these recommended sizes may work. However, smaller sizes may result in lower accuracy, while larger sizes may increase processing time and bandwidth usage without providing comparable benefits in accuracy.

有什么我没注意到的吗?

注意:直接调用 Vision API 时我遇到了同样的错误(请参阅 Bearer tokens section )。

最佳答案

Google 对图像像素有未记录的限制,即 7500 万。 12000 x 6500 图像恰好超出了此限制。

关于google-cloud-vision - Google Cloud Vision API 图像文件大小的当前限制是多少,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50331196/

相关文章:

python-2.7 - Python调整图像大小并发送到谷歌视觉功能

google-cloud-platform - Google AutoML Vision API 和 Google Vision API 自定义算法

.net - 来自 Google Vision API 的不同文本检测结果

tesseract - Google Cloud Vision OCR API 是否比 Tesseract OCR API 具有更好的准确性和性能

java - Google App Engine 不支持 vision api Runtime.addShutdownHook 错误

javascript - Google Cloud Vision (Chrome) 结果限制为 5

javascript - 如何在 Node.js 中的单个请求中运行 Google Vision API 标签检测和安全搜索检测?

google-cloud-platform - 使用 TEXT_DETECTION 来自 Cloud Vision API 的结果区域设置

ocr - Google Cloud Vision API DOCUMENT_TEXT_DETECTION 返回不正确的边界框

python - 在树莓派 python 中找不到 GLIBC_2.33