Google 视觉文本检测 API 与其演示页面相比给出了不同的结果

Google Vision Text detection API give a different result compared to their demo page

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

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

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

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

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

使用他们的 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 视觉演示 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 视觉演示页面结果:https://pastebin.com/6ihvKwZr

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

2020 年 5 月 15 日进行了升级

release notes