Replies: 27 comments 1 reply
-
感谢你的指出,请问是否愿意提PR来帮助修复这些问题呢 |
Beta Was this translation helpful? Give feedback.
-
第二点,修改api.py,"api:app"改为"rapidocr_api.api:app",但是这么改只是不报错,内存问题没有解决。只会改这么一处。 |
Beta Was this translation helpful? Give feedback.
-
好的,等我有空,我来具体看看 |
Beta Was this translation helpful? Give feedback.
-
在
内存一直增长的问题,暂时不知道为啥,因为 |
Beta Was this translation helpful? Give feedback.
-
刚刚重新试了一下,以下是Dockerfile FROM python:3.10-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
pip install --no-cache-dir rapidocr_api -i https://mirrors.aliyun.com/pypi/simple; \
pip uninstall -y opencv-python; \
pip install --no-cache-dir opencv-python-headless -i https://mirrors.aliyun.com/pypi/simple
EXPOSE 9003
CMD ["bash", "-c", "rapidocr_api -ip 0.0.0.0 -p 9003"] 直接docker run会导致一个cpu核心跑满(空载,未识别图片),内存一直增加。如果用docker run -it xx /bin/bash进去, cd /usr/local/lib/python3.10/site-packages/rapidocr_api/
rapidocr_api -ip 0.0.0.0 -p 9003 这样cpu基本没有负载(<0.5%),内存不会不停增加。也就是说必须要在rapidocr_api的安装目录运行,不知道这样是否有助于找到bug。 |
Beta Was this translation helpful? Give feedback.
-
另外用了这段时间发现对于手机电脑截屏、漫画、电影内嵌字幕这类图片中较小的文字时,使用upscale再识别准确率有提升(可以先裁剪再upscale)。不过这个自己去整合应用就行了,有兴趣提高准确率的人可以去试试看。例如实际应用漫画翻译manga-image-translator中的参数--upscaler {waifu2x,esrgan,4xultrasharp}。 |
Beta Was this translation helpful? Give feedback.
-
收到,感谢,我排查排查 |
Beta Was this translation helpful? Give feedback.
-
感谢,我后期看看能不能整合进来 |
Beta Was this translation helpful? Give feedback.
-
关于docker启动报OOM的问题,猜测可能是我用错了 RapidOCR/api/rapidocr_api/main.py Line 52 in b2fd006 |
Beta Was this translation helpful? Give feedback.
-
FROM python:3.10-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
pip install --no-cache-dir rapidocr_api -i https://mirrors.aliyun.com/pypi/simple; \
pip uninstall -y opencv-python; \
pip install --no-cache-dir opencv-python-headless -i https://mirrors.aliyun.com/pypi/simple; \
sed -i 's/async def ocr(/def ocr(/' /usr/local/lib/python3.10/site-packages/rapidocr_api/main.py
EXPOSE 9003
CMD ["bash", "-c", "rapidocr_api -ip 0.0.0.0 -p 9003"] 确认过了,bug没有变化,在rapidocr_api的安装目录运行正常。docker run -it进入 cat /usr/local/lib/python3.10/site-packages/rapidocr_api/main.py # 确认已经删除async
cd /usr/local/lib/python3.10/site-packages/rapidocr_api/
rapidocr_api -ip 0.0.0.0 -p 9003 # 在rapidocr_api的安装目录运行正常
# Ctrl + C 退出
cd /
rapidocr_api -ip 0.0.0.0 -p 9003 # 根目录运行还是一样的问题 |
Beta Was this translation helpful? Give feedback.
-
收到,请尝试将执行代码 |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
好吧,这。。。。 |
Beta Was this translation helpful? Give feedback.
-
有可能是那个“reload=True“造成的,我改了代码,加了参数,可以传是否使用模型等功能,我改完PR一下 |
Beta Was this translation helpful? Give feedback.
-
另外在Docker里 启动方式用这样: CMD ["rapidocr_api"] |
Beta Was this translation helpful? Give feedback.
-
@xmxoxo 感谢,期待你的PR |
Beta Was this translation helpful? Give feedback.
-
@xmxoxo 已经合并进去了,感谢,最新版本为 |
Beta Was this translation helpful? Give feedback.
-
@TwT-L 麻烦说一下运行具体环境、代码和详细报错信息 |
Beta Was this translation helpful? Give feedback.
-
这里有个做好的镜像 大家可以测试下: 使用方法:
|
Beta Was this translation helpful? Give feedback.
-
@xmxoxo 哇哦,想问一下这个镜像已经解决了上面的问题了吗?如果是的,我想给写到官方文档里呢,一直缺少个docker镜像来着。 |
Beta Was this translation helpful? Give feedback.
-
@SWHL 你可以测试一下这个镜像,我这里用是没啥问题 |
Beta Was this translation helpful? Give feedback.
-
@xmxoxo 这怎么能找得出来??6啊。那个dockerfile里,uninstall需要和前面的install写在一个RUN里,否则镜像不会缩小。 api/README.md里设置环境变量expert改为export。
运行
@SWHL Debian 12测试没问题。不会编程,具体代码就不献丑了,下面是用的时候发现的一些想法:
|
Beta Was this translation helpful? Give feedback.
-
@nzm001 |
Beta Was this translation helpful? Give feedback.
-
怪不得,用PaddlePaddle/Paddle2ONNX和RapidAI/PaddleOCRModelConvert这两个转换的sha256一样,用网页转的就是和前两者不同。 |
Beta Was this translation helpful? Give feedback.
-
@nzm001 RapidAI/PaddleOCRModelConvert和 用网页转的是同一个工具呀,网页的只不过是用streamlite包装了一下,没做什么,估计后面对应的依赖包,像paddle2onnx,版本不同。 |
Beta Was this translation helpful? Give feedback.
-
为什么我的docker启动的rapidocr_api会提示
|
Beta Was this translation helpful? Give feedback.
-
问题描述 / Problem Description
运行环境 / Runtime Environment
复现代码 / Reproduction Code
可能解决方案 / Possible solutions
Beta Was this translation helpful? Give feedback.
All reactions