[英]Google Cloud Vision API PDF text extraction
I'm trying to extract text from a pdf(image converted to pdf) using python code provided in google docs https://cloud.google.com/vision/docs/pdf .我正在尝试使用 google 文档https://cloud.google.com/vision/docs/pdf中提供的 python 代码从 pdf(图像转换为 pdf)中提取文本。 I have created service account key and using it for authentication as mentioned in docs and I'm using google SDK in my PC.
我已经创建了服务帐户密钥并将其用于文档中提到的身份验证,并且我在我的 PC 中使用了谷歌 SDK。 The code is getting timed out with the below error:
代码因以下错误而超时:
File "C:\*****\pdf_code.py", line 39, in async_detect_document
operation.result(timeout=180) File "C:\Python27\lib\site-packages\google\api_core\future\polling.py", line 120, in result
raise self._exception google.api_core.exceptions.GoogleAPICallError: None Error writing final output to: gs://******/output-1-to-1.json
Any help would be appreciated.任何帮助,将不胜感激。
i was getting a similar error, i was using a service account to access cloud vision api and using the service account key on my local我遇到了类似的错误,我正在使用服务帐户访问云视觉 API 并在本地使用服务帐户密钥
i solved the above error by giving the same service account permissions to write on the bucket ->我通过授予相同的服务帐户写入存储桶的权限解决了上述错误 - >
your error should be resolved你的错误应该得到解决
it reads: Error writing final output to: gs://******/output-1-to-1.json
它显示:
Error writing final output to: gs://******/output-1-to-1.json
... you may have to install gcloud
and gsutil
locally; ...您可能必须在本地安装
gcloud
和gsutil
; also check bucket ACL
.还要检查存储桶
ACL
。
while gcloud
is not logged in or gsutil
isn't available, this will not write to bucket.当
gcloud
未登录或gsutil
不可用时,这不会写入存储桶。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.