【问题标题】:Google Vision Text detection API give a different result compared to their demo page与其演示页面相比,Google Vision 文本检测 API 给出了不同的结果
【发布时间】:2020-08-30 21:28:47
【问题描述】:

我想将他们的 OCR 功能与 Google Vision 一起使用,但像这里的很多人一样,当我使用他们的 HTTP API 和他们的演示页面时,我的结果不一样,在他们的演示页面上,他们显示了 json 请求和结果。

我使用相同的 json 请求,但结果不同,他们的演示页面比他们的 API 更准确。

他们的演示页面: https://cloud.google.com/vision/docs/drag-and-drop

他们的 API 网址: https://vision.googleapis.com/v1/images:annotate?key=YOURAPIKEY 您可以将他们在演示中生成的 json 传递给测试

唯一的区别是我使用 imageUri 发送我的文件,而谷歌使用他们的本地存储(内容参数)

使用他们的 HTTP API,我只能捕获第一行,但不能捕获第二行,但他们的演示捕获了它们。

有什么线索吗?

我的测试图像: http://maxence.me/labs/others/c668d1346a74873b8773d7ca19d7feaf_1589063679_0_18.png

我的 JSON :

requests": [
        {
          "features": [
            {
              "maxResults": 50,
              "type": "LANDMARK_DETECTION"
            },
            {
              "maxResults": 50,
              "type": "FACE_DETECTION"
            },
            {
              "maxResults": 50,
              "type": "OBJECT_LOCALIZATION"
            },
            {
              "maxResults": 50,
              "type": "LOGO_DETECTION"
            },
            {
              "maxResults": 50,
              "type": "LABEL_DETECTION"
            },
            {
              "maxResults": 50,
              "type": "DOCUMENT_TEXT_DETECTION"
            },
            {
              "maxResults": 50,
              "type": "SAFE_SEARCH_DETECTION"
            },
            {
              "maxResults": 50,
              "type": "IMAGE_PROPERTIES"
            },
            {
              "maxResults": 50,
              "type": "CROP_HINTS"
            }
          ],
          "image": {
            "source": {
                "imageUri": "http://maxence.me/labs/others/c668d1346a74873b8773d7ca19d7feaf_1589063679_0_18.png"
            }
          },
          "imageContext": {
            "cropHintsParams": {
              "aspectRatios": [
                0.8,
                1,
                1.2
              ]
            }
          }
        }
      ]
    }

我的结果:https://pastebin.com/fsWPKg1r

Google Vision 演示 JSON:

{
  "requests": [
    {
      "features": [
        {
          "maxResults": 50,
          "type": "LANDMARK_DETECTION"
        },
        {
          "maxResults": 50,
          "type": "FACE_DETECTION"
        },
        {
          "maxResults": 50,
          "type": "OBJECT_LOCALIZATION"
        },
        {
          "maxResults": 50,
          "type": "LOGO_DETECTION"
        },
        {
          "maxResults": 50,
          "type": "LABEL_DETECTION"
        },
        {
          "maxResults": 50,
          "type": "DOCUMENT_TEXT_DETECTION"
        },
        {
          "maxResults": 50,
          "type": "SAFE_SEARCH_DETECTION"
        },
        {
          "maxResults": 50,
          "type": "IMAGE_PROPERTIES"
        },
        {
          "maxResults": 50,
          "type": "CROP_HINTS"
        }
      ],
      "image": {
        "content": "(data from c668d1346a74873b8773d7ca19d7feaf_1589063679_0_18.png)"
      },
      "imageContext": {
        "cropHintsParams": {
          "aspectRatios": [
            0.8,
            1,
            1.2
          ]
        }
      }
    }
  ]
}

Google Vision 演示页面结果:https://pastebin.com/6ihvKwZr

【问题讨论】:

    标签: json api google-vision


    【解决方案1】:

    15.5.2020 进行了升级

    release notes

    【讨论】:

    • 谢谢,我不知道这个页面,它很有帮助:) 那时我很幸运,及时!
    【解决方案2】:

    今天,他们的 HTTP API 给出了与他们的演示页面相同的结果......也许他们的版本有延迟或谷歌在那里? :o

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-01
      • 1970-01-01
      • 2017-09-27
      • 1970-01-01
      • 2017-11-04
      • 1970-01-01
      • 2017-10-20
      • 2019-04-24
      相关资源
      最近更新 更多