PaddleOCR
PaddleOCR copied to clipboard
如何提高两阶段印章检测的准确度
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
- 系统环境/System Environment:Win10
- 版本号/Version:Paddle:2.3.2 PaddleOCR:2.6
- 问题相关组件/Related components:
- 运行指令/Command Code:
- 完整报错/Complete Error Message:
如题,按照印章弯曲文本检测md进行二阶段印章文字检测的效果不太理想,想要提升准确度和正确率,应该要考虑更改配置文件中的哪些参数呢?本人之前尝试了增加数据集和增加epoch,但是没有得到很好的效果,希望可以提供一些建议,谢谢。
附上部分识别结果图:
有这么多关于印章识别的问题,百度能给开源个预训练模型吗☺
怎么会差这么多
怎么会差这么多
你这个效果好像很好啊?你具体的数据集epoch和我一样吗
train.log,没有怎么知道
train.log,没有怎么知道
[2022/10/24 11:08:39] ppocr INFO: Architecture : [2022/10/24 11:08:39] ppocr INFO: Backbone : [2022/10/24 11:08:39] ppocr INFO: dcn_stage : [False, True, True, True] [2022/10/24 11:08:39] ppocr INFO: layers : 50 [2022/10/24 11:08:39] ppocr INFO: name : ResNet [2022/10/24 11:08:39] ppocr INFO: Head : [2022/10/24 11:08:39] ppocr INFO: k : 50 [2022/10/24 11:08:39] ppocr INFO: name : DBHead [2022/10/24 11:08:39] ppocr INFO: Neck : [2022/10/24 11:08:39] ppocr INFO: name : DBFPN [2022/10/24 11:08:39] ppocr INFO: out_channels : 256 [2022/10/24 11:08:39] ppocr INFO: use_asf : True [2022/10/24 11:08:39] ppocr INFO: Transform : None [2022/10/24 11:08:39] ppocr INFO: algorithm : DB++ [2022/10/24 11:08:39] ppocr INFO: model_type : det [2022/10/24 11:08:39] ppocr INFO: Eval : [2022/10/24 11:08:39] ppocr INFO: dataset : [2022/10/24 11:08:39] ppocr INFO: data_dir : ./sealdatasets/data/dataset/ [2022/10/24 11:08:39] ppocr INFO: label_file_list : ['./sealdatasets/data/dataset/test/test.txt'] [2022/10/24 11:08:39] ppocr INFO: name : SimpleDataSet [2022/10/24 11:08:39] ppocr INFO: transforms : [2022/10/24 11:08:39] ppocr INFO: DecodeImage : [2022/10/24 11:08:39] ppocr INFO: channel_first : False [2022/10/24 11:08:39] ppocr INFO: img_mode : BGR [2022/10/24 11:08:39] ppocr INFO: DetLabelEncode : None [2022/10/24 11:08:39] ppocr INFO: DetResizeForTest : [2022/10/24 11:08:39] ppocr INFO: image_shape : [1152, 2048] [2022/10/24 11:08:39] ppocr INFO: NormalizeImage : [2022/10/24 11:08:39] ppocr INFO: mean : [0.48109378172549, 0.45752457890196, 0.40787054090196] [2022/10/24 11:08:39] ppocr INFO: order : hwc [2022/10/24 11:08:39] ppocr INFO: scale : 1./255. [2022/10/24 11:08:39] ppocr INFO: std : [1.0, 1.0, 1.0] [2022/10/24 11:08:39] ppocr INFO: ToCHWImage : None [2022/10/24 11:08:39] ppocr INFO: KeepKeys : [2022/10/24 11:08:39] ppocr INFO: keep_keys : ['image', 'shape', 'polys', 'ignore_tags'] [2022/10/24 11:08:39] ppocr INFO: loader : [2022/10/24 11:08:39] ppocr INFO: batch_size_per_card : 1 [2022/10/24 11:08:39] ppocr INFO: drop_last : False [2022/10/24 11:08:39] ppocr INFO: num_workers : 2 [2022/10/24 11:08:39] ppocr INFO: shuffle : False [2022/10/24 11:08:39] ppocr INFO: Global : [2022/10/24 11:08:39] ppocr INFO: cal_metric_during_train : False [2022/10/24 11:08:39] ppocr INFO: debug : False [2022/10/24 11:08:39] ppocr INFO: distributed : False [2022/10/24 11:08:39] ppocr INFO: epoch_num : 100 [2022/10/24 11:08:39] ppocr INFO: eval_batch_step : [0, 200] [2022/10/24 11:08:39] ppocr INFO: infer_img : doc/imgs_en/img_10.jpg [2022/10/24 11:08:39] ppocr INFO: log_smooth_window : 20 [2022/10/24 11:08:39] ppocr INFO: pretrained_model : ./pretrain_models/ResNet50_dcn_asf_synthtext_pretrained [2022/10/24 11:08:39] ppocr INFO: print_batch_step : 10 [2022/10/24 11:08:39] ppocr INFO: save_epoch_step : 10 [2022/10/24 11:08:39] ppocr INFO: save_inference_dir : None [2022/10/24 11:08:39] ppocr INFO: save_model_dir : ./output/det_r50_icdar15/ [2022/10/24 11:08:39] ppocr INFO: save_res_path : ./checkpoints/det_db/predicts_db.txt [2022/10/24 11:08:39] ppocr INFO: use_gpu : True [2022/10/24 11:08:39] ppocr INFO: use_visualdl : False [2022/10/24 11:08:39] ppocr INFO: Loss : [2022/10/24 11:08:39] ppocr INFO: alpha : 5 [2022/10/24 11:08:39] ppocr INFO: balance_loss : True [2022/10/24 11:08:39] ppocr INFO: beta : 10 [2022/10/24 11:08:39] ppocr INFO: main_loss_type : BCELoss [2022/10/24 11:08:39] ppocr INFO: name : DBLoss [2022/10/24 11:08:39] ppocr INFO: ohem_ratio : 3 [2022/10/24 11:08:39] ppocr INFO: Metric : [2022/10/24 11:08:39] ppocr INFO: main_indicator : hmean [2022/10/24 11:08:39] ppocr INFO: name : DetMetric [2022/10/24 11:08:39] ppocr INFO: Optimizer : [2022/10/24 11:08:39] ppocr INFO: lr : [2022/10/24 11:08:39] ppocr INFO: end_lr : 0 [2022/10/24 11:08:39] ppocr INFO: epochs : 100 [2022/10/24 11:08:39] ppocr INFO: factor : 0.9 [2022/10/24 11:08:39] ppocr INFO: learning_rate : 0.007 [2022/10/24 11:08:39] ppocr INFO: name : DecayLearningRate [2022/10/24 11:08:39] ppocr INFO: momentum : 0.9 [2022/10/24 11:08:39] ppocr INFO: name : Momentum [2022/10/24 11:08:39] ppocr INFO: weight_decay : 0.0001 [2022/10/24 11:08:39] ppocr INFO: PostProcess : [2022/10/24 11:08:39] ppocr INFO: box_thresh : 0.6 [2022/10/24 11:08:39] ppocr INFO: max_candidates : 1000 [2022/10/24 11:08:39] ppocr INFO: name : DBPostProcess [2022/10/24 11:08:39] ppocr INFO: thresh : 0.3 [2022/10/24 11:08:39] ppocr INFO: unclip_ratio : 2.0 [2022/10/24 11:08:39] ppocr INFO: use_polygon : True [2022/10/24 11:08:39] ppocr INFO: Train : [2022/10/24 11:08:39] ppocr INFO: dataset : [2022/10/24 11:08:39] ppocr INFO: data_dir : ./sealdatasets/data/dataset/ [2022/10/24 11:08:39] ppocr INFO: label_file_list : ['./sealdatasets/data/dataset/train/train.txt'] [2022/10/24 11:08:39] ppocr INFO: name : SimpleDataSet [2022/10/24 11:08:39] ppocr INFO: ratio_list : [1.0] [2022/10/24 11:08:39] ppocr INFO: transforms : [2022/10/24 11:08:39] ppocr INFO: DecodeImage : [2022/10/24 11:08:39] ppocr INFO: channel_first : False [2022/10/24 11:08:39] ppocr INFO: img_mode : BGR [2022/10/24 11:08:39] ppocr INFO: DetLabelEncode : None [2022/10/24 11:08:39] ppocr INFO: IaaAugment : [2022/10/24 11:08:39] ppocr INFO: augmenter_args : [2022/10/24 11:08:39] ppocr INFO: args : [2022/10/24 11:08:39] ppocr INFO: p : 0.5 [2022/10/24 11:08:39] ppocr INFO: type : Fliplr [2022/10/24 11:08:39] ppocr INFO: args : [2022/10/24 11:08:39] ppocr INFO: rotate : [-10, 10] [2022/10/24 11:08:39] ppocr INFO: type : Affine [2022/10/24 11:08:39] ppocr INFO: args : [2022/10/24 11:08:39] ppocr INFO: size : [0.5, 3] [2022/10/24 11:08:39] ppocr INFO: type : Resize [2022/10/24 11:08:39] ppocr INFO: EastRandomCropData : [2022/10/24 11:08:39] ppocr INFO: keep_ratio : True [2022/10/24 11:08:39] ppocr INFO: max_tries : 10 [2022/10/24 11:08:39] ppocr INFO: size : [640, 640] [2022/10/24 11:08:39] ppocr INFO: MakeShrinkMap : [2022/10/24 11:08:39] ppocr INFO: min_text_size : 8 [2022/10/24 11:08:39] ppocr INFO: shrink_ratio : 0.4 [2022/10/24 11:08:39] ppocr INFO: MakeBorderMap : [2022/10/24 11:08:39] ppocr INFO: shrink_ratio : 0.4 [2022/10/24 11:08:39] ppocr INFO: thresh_max : 0.7 [2022/10/24 11:08:39] ppocr INFO: thresh_min : 0.3 [2022/10/24 11:08:39] ppocr INFO: NormalizeImage : [2022/10/24 11:08:39] ppocr INFO: mean : [0.48109378172549, 0.45752457890196, 0.40787054090196] [2022/10/24 11:08:39] ppocr INFO: order : hwc [2022/10/24 11:08:39] ppocr INFO: scale : 1./255. [2022/10/24 11:08:39] ppocr INFO: std : [1.0, 1.0, 1.0] [2022/10/24 11:08:39] ppocr INFO: ToCHWImage : None [2022/10/24 11:08:39] ppocr INFO: KeepKeys : [2022/10/24 11:08:39] ppocr INFO: keep_keys : ['image', 'threshold_map', 'threshold_mask', 'shrink_map', 'shrink_mask'] [2022/10/24 11:08:39] ppocr INFO: loader : [2022/10/24 11:08:39] ppocr INFO: batch_size_per_card : 3 [2022/10/24 11:08:39] ppocr INFO: drop_last : False [2022/10/24 11:08:39] ppocr INFO: num_workers : 1 [2022/10/24 11:08:39] ppocr INFO: shuffle : True [2022/10/24 11:08:39] ppocr INFO: profiler_options : None [2022/10/24 11:08:39] ppocr INFO: train with paddle 2.3.2 and device Place(gpu:0) [2022/10/24 11:08:39] ppocr INFO: Initialize indexs of datasets:['./sealdatasets/data/dataset/train/train.txt'] [2022/10/24 11:08:39] ppocr INFO: Initialize indexs of datasets:['./sealdatasets/data/dataset/test/test.txt'] [2022/10/24 11:08:39] ppocr INFO: train dataloader has 167 iters [2022/10/24 11:08:39] ppocr INFO: valid dataloader has 200 iters [2022/10/24 11:08:39] ppocr INFO: load pretrain successful from ./pretrain_models/ResNet50_dcn_asf_synthtext_pretrained [2022/10/24 11:08:39] ppocr INFO: During the training process, after the 0th iteration, an evaluation is run every 200 iterations
image_shape修改640,640
image_shape修改640,640
你好 请问你训练的时候是使用的use_polygon:True进行弯曲文本识别,还是用det_box_type:“poly”呢?
image_shape修改640,640
你好请你训练文本的时候是使用use_polygon:True进行弯曲识别,还是用det_box_type:“poly”呢?
我训练的时候用use_polygon,应该一样
image_shape修改640,640
你好请你训练文本的时候是使用use_polygon:True进行弯曲识别,还是用det_box_type:“poly”呢?
我训练的时候用use_polygon,应该一样
请问你训练的时候用多少数据集和epoch呢?会不会出现数据过拟合的情况?我按照你的修改后hmean99.9%,这是正常的吗?
请问一下,我用了67张样本进行训练,按照 GitHub的文档,两阶段的第一阶段检测, 为什么检测出来只有印章,文字没有被圈出来啊
我是用的数据集都是自己标注的,照着文档那样,比如 ··· [{"transcription": "印章区域", "points": [[419, 129], [735, 129], [735, 445], [419, 445]], "difficult": false}, {"transcription": "合同专用章", "points": [[505, 344], [667, 344], [667, 404], [505, 404]], "difficult": true}, {"transcription": "人工网络股份有限公司海南分公司", "points": [[450, 365], [432, 250], [484, 165], [588, 141], [681, 179], [717, 251], [709, 349], [651, 327], [655, 267], [626, 223], [573, 200], [520, 224], [495, 289], [512, 340]], "difficult": false}, {"transcription": "印章区域", "points": [[487, 888], [803, 888], [803, 1208], [487, 1208]], "difficult": false}, {"transcription": "海南千君信项目管理有限公司", "points": [[500, 1040], [560, 922], [670, 907], [767, 972], [782, 1086], [718, 1179], [616, 1192], [615, 1133], [687, 1121], [719, 1075], [704, 1000], [653, 973], [598, 986], [557, 1057]], "difficult": false}] ···
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.