PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
43.6k stars 7.77k forks source link

使用StyleText批量生成图像结果不成功 #1508

Closed yiyi99 closed 3 years ago

yiyi99 commented 3 years ago

使用StyleText批量生成图像结果不成功,执行:python tools/synth_dataset.py -c configs/dataset_config.yml dataset_config.yml文件内容: Global: output_num: 10 output_dir: output_data use_gpu: false image_height: 32 image_width: 320 standard_font: fonts/en_standard.ttf TextDrawer: fonts: en: fonts/en_standard.ttf ch: fonts/ch_standard.ttf ko: fonts/ko_standard.ttf StyleSampler: method: DatasetSampler image_home: datas/bg label_file: with_label: false CorpusGenerator: method: FileCorpus language: ch corpus_file: datas/text/unit.txt Predictor: method: StyleTextRecPredictor algorithm: StyleTextRec scale: 0.00392156862745098 mean:

weisy11 commented 3 years ago

如果使用的style_image的输入没有标签,label_file需要输入一个图片列表文件,详见: https://github.com/PaddlePaddle/PaddleOCR/blob/dygraph/StyleText/README_ch.md#%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B

yiyi99 commented 3 years ago

[root@localhost StyleText]# python3 tools/synth_dataset.py -c configs/dataset_config.yml [2020/12/22 15:20:23] srnet INFO: load pretrained model from style_text_models/bg_generator [2020/12/22 15:20:25] srnet INFO: load pretrained model from style_text_models/text_generator [2020/12/22 15:20:25] srnet INFO: load pretrained model from style_text_models/fusion_generator [2020/12/22 15:20:25] srnet INFO: using FileCorpus [2020/12/22 15:20:26] srnet INFO: generate image: output_data/images/0/0.png [2020/12/22 15:20:26] srnet WARNING: corpus length exceed limit: METABOLIC: CALCIUM [2020/12/22 15:20:27] srnet INFO: generate image: output_data/images/0/1.png Traceback (most recent call last): File "tools/synth_dataset.py", line 31, in synth_dataset() File "tools/synth_dataset.py", line 27, in synth_dataset dataset_synthesiser.synth_dataset() File "/PaddleOCR/StyleText/engine/synthesisers.py", line 60, in synth_dataset style_data = self.style_sampler.sample() File "/PaddleOCR/StyleText/engine/style_samplers.py", line 44, in sample origin_height = image.shape[0] AttributeError: 'NoneType' object has no attribute 'shape'

image_list.txt文件内容: b0.jpg
b1.jpg
b2.jpg b3.jpg b4.jpg

请问是哪里有问题?是对图像文件有尺寸要求吗?

cxy86121 commented 3 years ago

可能是图片路径问题,建议把图片路径打印出来看一下

paddle-bot-old[bot] commented 3 years ago

Since you haven\'t replied for more than 3 months, we have closed this issue/pr. If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. It is recommended to pull and try the latest code first. 由于您超过三个月未回复,我们将关闭这个issue/pr。 若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。