-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DCU上的通用OCR仅支持图像文字检测,不支持PDF检测 #3726
Comments
麻烦贴一下错误信息~ |
之前是在release/3.0-beta1版本,不支持。现已更新成release/3.0-rc版本 环境:jupyterlab-pytorch:2.1.0-ubuntu20.04-dtk24.04.1-py3.10-devel Paddlepaddle版本安装如下: 执行下述命令报错(加白后,错误信息一致) 报错信息: 启动命令改为下述命令,部署成功 但测试发现,实际请求中并没有用DCU卡工作,而是CPU。 |
如果执行 |
这个看上去大概率不是服务化部署的问题,建议试试本地推理(API或者CLI)是否也有类似的现象,如果也存在的话,我会联系更熟悉这块的同事帮忙看看 |
描述问题
在DCU上已成功部署通用OCR产线,但是payload中只能是"image": image_data。而官方的通用OCR产线则是payload = {"file": image_data, "fileType": 1},可以选择图像还是pdf,而dcu上的版本只能选择图像.
API_URL = "http://0.0.0.0:8080/ocr" # 服务URL
image_path = "/root/test_2.png"
output_image_path = "/root/out.jpg"
output_txt_path = "/root/result.txt"
with open(image_path, "rb") as file:
image_bytes = file.read()
image_data = base64.b64encode(image_bytes).decode("ascii")
payload = {"image": image_data} # Base64编码的文件内容或者图像URL
The text was updated successfully, but these errors were encountered: