Skip to content
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

请问可以让封装的exe文件直接返回JSON字符串吗? #4

Closed
nightson opened this issue Aug 17, 2022 · 4 comments
Closed

Comments

@nightson
Copy link

非Python开发者,纯业余小白,为了解决日常办公需求写了个Powershell脚本,如果运行"PaddleOCR_json.exe 图片路径"能够直接返回JSON结果比较方便调用。不知道能不能满足鄙人的这个需求,万分感谢!

@hiroi-sora
Copy link
Owner

hiroi-sora commented Aug 17, 2022

不采用启动参数传递的方式是特意设计的,为了避免重复初始化加载模型库的开销。

@AutumnSun1996
Copy link

感觉可以实现成一个常驻的后台进程, 通过HTTP接口(或者自定义的TCP协议)来交互. 不过工作量就比较大了.
用JSON的话, 可以通过JSON的ascii编码避免GBK/UTF8的问题吧, 不过不太清楚作者使用的json库的具体实现.

@hiroi-sora
Copy link
Owner

hiroi-sora commented Aug 21, 2022

通过ascii编码避免GBK/UTF8的问题
@AutumnSun1996

感谢,很有用的提议。有空了会尝试添加这个功能

v1.2已支持该功能。

@hiroi-sora
Copy link
Owner

hiroi-sora commented Aug 31, 2022

实用化的 PowerShell API 已更新,只需简单几行代码就可以调用OCR了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants