【问题标题】:Google cloud vision- get JSON error response from OCR request谷歌云视觉 - 从 OCR 请求中获取 JSON 错误响应
【发布时间】:2017-07-03 15:40:43
【问题描述】:

我是使用谷歌云 API 的新手,所以如果我问任何愚蠢的问题,请原谅我。我想尝试通过 Xamarin c# 开发 android 应用程序来为泰语做 OCR,所以我的想法是并且我想从我的照片中获取 OCR 结果。 这是我的 json 请求

{"requests": [
{"image":{"content":"3QGzdykwB2MZPcpx...."},
"imageContext": {"languageHints":["th"]},
"features": [{"type":"DOCUMENT_TEXT_DETECTION"}]}]}

但我得到的结果是

"error": {
"code": 14,
"message": "Service temporarily unavailable. Error processing features."}

这有什么问题?任何人请给一些建议。谢谢。

【问题讨论】:

  • 遇到同样的错误...任何分辨率

标签: json xamarin.android ocr google-cloud-vision


【解决方案1】:

由于您没有提供源代码,我假设您使用的是GoogleCloudPlatform/java-docs-samples

出现上述异常的主要原因是下面代码中的人脸注解为空。您可以根据需要更新以下代码

if (response.getFaceAnnotations() == null) {
  throw new IOException(
      response.getError() != null
          ? response.getError().getMessage()
          : "Unknown error getting image annotations");
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-02-26
    • 1970-01-01
    • 1970-01-01
    • 2018-08-31
    • 2018-11-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多