breezedeus / CnOCR

CnOCR: Awesome Chinese/English OCR Python toolkits based on PyTorch. It comes with 20+ well-trained models for different application scenarios and can be used directly after installation. 【基于 PyTorch/MXNet 的中文/英文 OCR Python 包。】

Home Page:https://www.breezedeus.com/article/cnocr

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

读取的文件名似乎不支持中文

5m1le71ger opened this issue · comments

代码如下:
from cnocr import CnOcr
print('begin')
img_fp = './img/战斗-进入游戏.png'
ocr = CnOcr() # 所有参数都使用默认值
print('ocr')
#out = ocr.ocr(img_fp)
out = ocr.ocr_for_single_line(img_fp)
print(out)

结果:
Exception has occurred: FileNotFoundError
Error loading image: ./img/战斗-进入游戏.png
File "E:\mywork\国王指意\cnocrtest.py", line 8, in
out = ocr.ocr_for_single_line(img_fp)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Error loading image: ./img/战斗-进入游戏.png

换成英文文件名就可以

用英文