Google cloud platform Google Vision OCR多文本检测
我正在尝试使用谷歌云视觉进行多语言文本检测。但我有个问题。 如果我将请求文本检测api端点发送到此urlGoogle cloud platform Google Vision OCR多文本检测,google-cloud-platform,ocr,google-cloud-vision,Google Cloud Platform,Ocr,Google Cloud Vision,我正在尝试使用谷歌云视觉进行多语言文本检测。但我有个问题。 如果我将请求文本检测api端点发送到此url https://vision.googleapis.com/v1/images:annotate?key=XxxXX 以及这个机构 { "requests": [ { "image": { "source": { "imageUri": "image_url" } }, "features"
https://vision.googleapis.com/v1/images:annotate?key=XxxXX
以及这个机构
{
"requests": [
{
"image": {
"source": {
"imageUri": "image_url"
}
},
"features": [
{
"type": "DOCUMENT_TEXT_DETECTION",
"maxResults": 1
}
],
"ImageContext": {
"languageHints": [
"tr", "en"
]
}
}
]
}
我得到了这个错误代码
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"image_context\" at 'requests[0]': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "requests[0]",
"description": "Invalid JSON payload received. Unknown name \"image_context\" at 'requests[0]': Cannot find field."
}
]
}
]
}
}
什么是问题?问题是字段
“ImageContext”
,应该是“ImageContext”
,小写为“i”。我想自杀:(你说得对。它现在工作了。谢谢:)太好了!很高兴它起作用了!如果答案对您有帮助,请接受。:)