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.04k stars 7.72k forks source link

使用fcenet训练问题 #6513

Closed xiongzl closed 2 years ago

xiongzl commented 2 years ago

使用fcenet进行训练,配置文件为 configs/det/det_r50_vd_dcn_fce_ctw.yml 出现了一些问题如下:

【1】验证时,日志如下 [2022/06/06 10:17:49] ppocr INFO: cur metric, thr 0.3: precision:0.57252 recall:0.60823 hmean:0.58984, tl:0.58436 hmean:0.61386, thr 0.5: precision:0.70353 recall:0.55339 hmean:0.61949, thr 0.6: precision:0.715, thr 0.7: precision:0.80829 recall:0.42035 hmean:0.55308, thr 0.8: precision:0.84441 recall:0.28015 hn:0.92880 recall:0.10362 hmean:0.18644, hmean: 0.6194921647786499, fps: 11.242154096478925 会出现多个阈值对应精度验证。默认的vdl_writer写入代码会报错 ValueError: could not convert string to float: 'precision:0.57252 recall:0.60823 hmean:0.58984'

对比dbnet训练,同样验证时日志为: [2022/06/05 12:36:56] ppocr INFO: cur metric, precision: 0.7393536667871474, recall: 0.8208354769009157, hmean: 0.7779668537380968, fps: 12.674611566927029 并不会有多个阈值 想问下这个fcenet多阈值验证的代码在哪里可以修改成和dbnet一致。

【2】fcenet数据增广报错

[2022/06/05 20:45:34] ppocr ERROR: When parsing line /data/jack/ocr_data/icdar_2019_lsvt/train/img/gt_25418.jpg [{"transcription": "依凡西饼屋", "points": [[99, 127], [610, 443], [607, 557], [63, 282]], "illegibility": false}, {"transcription": "依凡西", "points": [[359, 723], [505, 732], [500, 821], [354, 807]], "illegibility": false}, {"transcription": "###", "points": [[322, 533], [354, 543], [353, 555], [321, 545]], "illegibility": true}, {"transcription": "419", "points": [[327, 548], [349, 555], [347, 572], [325, 563]], "illegibility": false}, {"transcription": "###", "points": [[318, 574], [357, 589], [355, 619], [316, 607]], "illegibility": true}, {"transcription": "YIFANXIBINGWU", "points": [[617, 496], [727, 605], [728, 643], [617, 547]], "illegibility": false}, {"transcription": "###", "points": [[628, 567], [714, 644], [713, 663], [626, 587]], "illegibility": true}, {"transcription": "用心烘焙 分享感动", "points": [[549, 996], [654, 987], [655, 1019], [549, 1033]], "illegibility": false}, {"transcription": "###", "points": [[386, 814], [421, 838], [452, 830], [476, 811], [483, 822], [458, 846], [416, 856], [375, 828]], "illegibility": true}] , error happened with msg: Traceback (most recent call last): File "/home/jack/code/PaddleOCR/ppocr/data/simple_dataset.py", line 137, in getitem outs = transform(data, self.ops) File "/home/jack/code/PaddleOCR/ppocr/data/imaug/init.py", line 50, in transform data = op(data) File "/home/jack/code/PaddleOCR/ppocr/data/imaug/fce_targets.py", line 659, in call results = self.generate_targets(results) File "/home/jack/code/PaddleOCR/ppocr/data/imaug/fce_targets.py", line 646, in generate_targets polygon_masks_ignore) File "/home/jack/code/PaddleOCR/ppocr/data/imaug/fce_targets.py", line 605, in generate_level_targets level_img_size, lv_text_polys[ind])[None] File "/home/jack/code/PaddleOCR/ppocr/data/imaug/fce_targets.py", line 328, in generate_center_region_mask top_line, bot_line, self.resample_step) File "/home/jack/code/PaddleOCR/ppocr/data/imaug/fce_targets.py", line 299, in resample_sidelines resampled_line1 = self.resample_line(sideline1, resample_point_num) File "/home/jack/code/PaddleOCR/ppocr/data/imaug/fce_targets.py", line 109, in resample_line while current_line_len >= length_cumsum[current_edge_ind + 1]: IndexError: index 5 is out of bounds for axis 0 with size 5

数据集来源于:https://ai.baidu.com/broad/introduction?dataset=lsvt

该数据集使用fcenet时 会大量报类似的错误

WenmuZhou commented 2 years ago

感谢反馈,我们这边检查一下

WenmuZhou commented 2 years ago

是一些边界问题,我们这里修复了https://github.com/PaddlePaddle/PaddleOCR/pull/6693