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
44.21k stars 7.82k forks source link

DB 检测模型:训练好的模型直接infer效果很好,export为推理模型后,漏检了很多。【急】 #11782

Closed Smile0524 closed 7 months ago

Smile0524 commented 7 months ago

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

请尽量不要包含图片在问题中/Please try to not include the image in the issue.

各位大佬帮忙看看:

同一张图片,训练好的模型直接infer效果很好,export为推理模型后,漏检了很多。参照issues中大家的做法,把代码中DetResizeForTest注释掉,还是没有用。 export时,参数如下:

Global: use_gpu: false epoch_num: 300 log_smooth_window: 20 print_batch_step: 1 save_model_dir: ../../out_model/ch_db_res18/ save_epoch_step: 10

evaluation is run every 5000 iterations after the 4000th iteration

eval_batch_step: [0, 200] cal_metric_during_train: false pretrained_model: checkpoints: save_inference_dir: use_visualdl: False infer_img: doc/imgs_en/img_10.jpg save_res_path: ../../out_model/ch_db_res18/predicts_db.txt

Architecture: model_type: det algorithm: DB Transform: Backbone: name: ResNet_vd layers: 18 disable_se: True Neck: name: DBFPN out_channels: 256 Head: name: DBHead k: 50

Loss: name: DBLoss balance_loss: true main_loss_type: DiceLoss alpha: 5 beta: 10 ohem_ratio: 3

Optimizer: name: Adam beta1: 0.9 beta2: 0.999 lr: name: Cosine learning_rate: 0.001 warmup_epoch: 2 regularizer: name: 'L2' factor: 0

PostProcess: name: DBPostProcess thresh: 0.3 box_thresh: 0.6 max_candidates: 1000 unclip_ratio: 1.5

Metric: name: DetMetric main_indicator: hmean

Train: dataset: name: SimpleDataSet data_dir: ../../data/seal_detect_ori/det/train label_file_list:

Eval: dataset: name: SimpleDataSet data_dir: ../../data/seal_detect_ori/det/val label_file_list:

Smile0524 commented 7 months ago

已解决,当检测和识别模型同时使用时,在所有检测模型检测到的检测框中,会依据识别结果的分数再去做一次过滤(参数:drop_score)。所以导致表象上的漏检。

Nanh1860 commented 7 months ago

已解决,当检测和识别模型同时使用时,在所有检测模型检测到的检测框中,会依据识别结果的分数再去做一次过滤(参数:drop_score)。所以导致表象上的漏检。

can you tell me how to solve that? my data form is page with many data per row, i want to detect and recognize each large row but unfortunately it only can recognize only 2 row top, sometimes 3