PaddleOCR
PaddleOCR copied to clipboard
How to use StyleText to generate text image with your own font?
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
- 系统环境/System Environment:win10
- 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:
- 运行指令/Command Code: python tools/synth_image.py -c configs/config.yml --style_image examples/style_images/2.jpg --text_corpus 123456 --language art_font
- 完整报错/Complete Error Message: No Errors but model predict(synth image) gives bad result with art font.
Here is what I've found.
In StyleText/engine/synthesisers.py, 40:
def synth_image(self, corpus, style_input, language="en"):
corpus_list, text_input_list = self.text_drawer.draw_text( # <---------- this draw_text work fine with font : **C:\Windows\fonts\complex_.ttf**
corpus, language, style_input_width=style_input.shape[1])
synth_result = self.predictor.predict(style_input, text_input_list) # <---------- this predict which synth the text image with the background fails. It generates Korean text image with English or digits corpus.
return synth_result
textImage generated in digits.
but synth image is in Korean.
How to train the downloaded model with new fonts? Thanks! the download url is: https://paddleocr.bj.bcebos.com/dygraph_v2.0/style_text/style_text_models.zip as given in the StyleText/README.md
Training code is not provided at this stage
@goodmight 你有找到替代方案么?遇到同样问题了
@goodmight 你有找到替代方案么?遇到同样问题了
Hao dai wo yeshi yong yingwen tiwende ba, ni za zhijie yong zhongwen wen wo (・∀・)
我的替代_(舍弃)方案是發現我不需要這個背景圖片。所以直接用白底寫字(PIL的方法)了。
好的,多谢,我发现我也得舍弃这个嘞,我准备用 inpatint 的方式,先扣掉然后再写上去新的
请问是在哪一步骤修改呢