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

请问如何将字典里的汉字全部生成 #21

Open
le8888e opened this issue Jun 26, 2024 · 2 comments
Open

请问如何将字典里的汉字全部生成 #21

le8888e opened this issue Jun 26, 2024 · 2 comments

Comments

@le8888e
Copy link

le8888e commented Jun 26, 2024

你好,我想用生成的图片做字体识别。请问怎么将字典里的每一个字都生成图片,而不是随机从字典里选字生成?谢谢

@BboyHanat
Copy link
Owner

BboyHanat commented Jun 27, 2024

主要修改 service/provider/TextProvider.py中的 类 RandomCorpusGen,
https://github.com/BboyHanat/TextGenerator/blob/master/service/provider/TextProvider.py#L51
修改这个方法里的 _random_crop,_random_add(是为了控制生成的长度在限制范围内, 长了随机crop一些,短了随机在添加 一点), 还有关闭randomshuffle(这个提高生成的随机性),修改这些应该能满足你的要求,还有就是在config.yaml中设置random_character的probability=0

@le8888e
Copy link
Author

le8888e commented Jun 27, 2024

@BboyHanat 谢谢,我试试

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