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

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

Open
5m1le71ger opened this issue Dec 10, 2023 · 1 comment
Open

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

5m1le71ger opened this issue Dec 10, 2023 · 1 comment

Comments

@5m1le71ger
Copy link

代码如下:
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

换成英文文件名就可以

@freeok
Copy link

freeok commented Dec 14, 2023

用英文

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

2 participants