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

about trained model #4

Open
zcswdt opened this issue Apr 7, 2020 · 7 comments
Open

about trained model #4

zcswdt opened this issue Apr 7, 2020 · 7 comments

Comments

@zcswdt
Copy link

zcswdt commented Apr 7, 2020

Hello, I did not find your training data, can you share the trained model?

@yizt
Copy link
Owner

yizt commented Apr 7, 2020

@zcswdt 你好,感谢反馈;没有使用实际的数据训练,使用的是随机生成的数据训练,代码在generator.py

@zcswdt
Copy link
Author

zcswdt commented Apr 7, 2020

谢谢您的百忙之中的回复,我刚看了您的生成文字代码,写的非常棒,授人以鱼不如授人以渔。刚好我在做一个繁体字识别的项目,目前我没有繁体字数据集,还在发愁呢。可以问一下,繁体字识别的话,使用crnn模型最低要训练多少张图片呢?

@yizt
Copy link
Owner

yizt commented Apr 7, 2020

@zcswdt 具体需要多少,不清楚,没有实际测试过

@zcswdt
Copy link
Author

zcswdt commented Apr 8, 2020

您好,我使用您的generator.py生成图片的过程中会报错,我是python3的环境,这个报错我谷歌了解决方法,最后没有解决,是我哪里错了吗?希望得到您的回复。
报错如下:
root@8a3c4a48fd90:/mywork/craft/crnn_ziti# PYTHONIOENCODING=utf-8 python generator.py
Traceback (most recent call last):
File "generator.py", line 15, in
from fontutils import FONT_CHARS_DICT
File "/mywork/craft/crnn_ziti/fontutils.py", line 81, in
FONT_CHARS_DICT = get_all_font_chars()
File "/mywork/craft/crnn_ziti/fontutils.py", line 30, in get_all_font_chars
font_list = [ImageFont.truetype(font_path, size=10) for font_path in font_path_list]
File "/mywork/craft/crnn_ziti/fontutils.py", line 30, in
font_list = [ImageFont.truetype(font_path, size=10) for font_path in font_path_list]
File "/opt/conda/lib/python3.6/site-packages/PIL/ImageFont.py", line 640, in truetype
return freetype(font)
File "/opt/conda/lib/python3.6/site-packages/PIL/ImageFont.py", line 637, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/opt/conda/lib/python3.6/site-packages/PIL/ImageFont.py", line 186, in init
font, size, index, encoding, layout_engine=layout_engine
UnicodeEncodeError: 'ascii' codec can't encode characters in position 30-41: ordinal not in range(128)

@yizt
Copy link
Owner

yizt commented Apr 8, 2020

@zcswdt 我也是python3.6, 相关包版本如下,在mac和linux上都有测试过:

Pillow                5.4.1
opencv-python         4.1.0.25
fonttools             4.2.2
numpy                 1.16.2                 

@zcswdt
Copy link
Author

zcswdt commented Apr 9, 2020

您好,谢谢您的回复,我已经解决了该问题。但是我在读代码的时候发现,在generator.py文件,class Generator:传进去两个参数,其中self.alpha_list = list(alpha)代表是词库,但是并没有在接下来代码中用到,可以加个qq或者微信沟通一下吗?谢谢!

@yizt
Copy link
Owner

yizt commented Apr 9, 2020

@zcswdt 跟alpha重复了,后面用的是alpha;这个是没有用;我的微信号:yizuotian131

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