【发布时间】: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