-
Notifications
You must be signed in to change notification settings - Fork 138
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
Failed to receive data #155
Comments
为什么请求到 |
首先,当前的PaddleOCR-json只提供了一个tcp套接字远程服务器,而postman是一个http请求工具(应该是可以当成套接字客户端来用的)、post请求也是一个http的概念。PaddleOCR-json的服务器是无法处理http请求的。你需要用一个tcp套接字客户端来发送json数据,你可以看看你的语言是否支持套接字通信。 然后你遇到的错误发生在这里(报错在220行): PaddleOCR-json/cpp/src/task_linux.cpp Lines 197 to 223 in 2f6cc2c
当引擎没从客户端套接字里读出数据时就会报 std::cerr << bytesRecv << ", " << errno << std::endl; 不过这里确实处理的不好,没有一个明确清晰的报错。可以考虑多加一点报错,或者直接等重构时弃用tcp套接字换成http服务器。 |
在v1.3.0版本,还无法在Linux上部署,我们把这个项目部署在了windows上,并用python写了一个api接口,客户端只需要将图片的base64请求到api中即可返回识别的结果,这个python api的url就是 /image_ocr |
系统版本:Ubuntu 22.04.4 LTS
安装方式:LInux构建
构建成功后运行:
然后我使用客户端工具(如:postman等)发送post请求:(对于整个json,我试过使用ascii转义后进行post请求)

服务端出现了:
如何才能在linux上实现一个api接口的服务,让客户端发送请求就可以得到识别的结果呢?
The text was updated successfully, but these errors were encountered: