https://cnocr.readthedocs.io/zh/latest/install/
http://breezedeus.github.io/2019/03/28/breezedeus-cnocr.html
pip 安装
嗯,顺利的话一行命令即可。
pip install cnocr安装速度慢的话,可以指定国内的安装源,如使用豆瓣源:
pip install cnocr -i https://pypi.doubanio.com/simple代码引用
from cnocr import CnOcr
ocr = CnOcr()
res = ocr.ocr_for_single_line('examples/rand_cn1.png')
print("Predicted Chars:", res)如果报错
RuntimeError: Numpy is not available(关联Torch或Tensorflow)
https://blog.csdn.net/weixin_40923064/article/details/119081081
这将通过升级 numpy 轻松解决....当我遇到此错误时,安装了 numpy 版本 1.22 ....我使用此命令将版本更新到 1.24.1
pip install numpy==1.24.1
爱笔记