Google Vision文本检测API与演示页面相比,结果有所不同

问题描述 投票:0回答:1

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

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

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

他们的API URL:https://vision.googleapis.com/v1/images:annotate?key=YOURAPIKEY您可以通过在演示中生成的json进行测试

唯一的区别是我使用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 Vision Demo 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

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

json api google-vision
1个回答
0
投票

今天,他们的HTTP API提供与他们的演示页相同的结果...也许他们的版本延迟了。

© www.soinside.com 2019 - 2024. All rights reserved.