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.15k stars 7.81k forks source link

Detection model accuracy drop after exporting #11644

Closed kwang19113 closed 8 months ago

kwang19113 commented 8 months ago

So after training i test my model with 10 images

export model: python tools/export_model.py -c configs/det/det_mv3_db.yml -o Global.pretrained_model="./output/db_mv3/best_accuracy" Global.save_inference_dir="./output/det_db_inference/"

predict images (only got 2/10): python tools/infer/predict_det.py --det_algorithm="DB" --det_model_dir="./output/det_db_inference/" --image_dir="./doc/imgs/" --use_gpu=True

but if i use (i got 9/10 images right.): python tools/infer_det.py -c configs/det/det_mv3_db.yml -o Global.infer_img="./doc/imgs/" Global.pretrained_model="./output/db_mv3/best_accuracy"

Nada-ibrahim commented 4 months ago

@kwang19113 I have the same problem. Did you find a solution ?

kwang19113 commented 4 months ago

@kwang19113 I have the same problem. Did you find a solution ?

Hi it was due to the preprocessing code in predict_det for the image size. I don't remember specifically which part but you can check in there

Nada-ibrahim commented 4 months ago

Thanks a lot. I checked and found that the image size was really the issue. Adding --det_limit_type=min to the predict_det command solved the problem.