预测和推理得到的结果不一样
Created by: tyy2tyy
我在使用mv3+db训练检测模型,结束后分别查看预测和推理的效果,发现两者的效果不一样。我已经将infer中utility.py的默认数据改为了训练时使用的后处理参数,但两者的效果还是不一样,请问是什么原因呢?
预测命令:
python3 tools/infer_det.py -c det_mv3_db.yml -o TestReader.infer_img="/data/tang/newPaddle/doc/test/real/" Global.checkpoints="/data/tang/PaddleOCR/output/det_db_ft1/best_accuracy" Global.test_batch_size_per_card=1
推理命令:
python3 tools/infer/predict_det.py
--image_dir="/data/tang/newPaddle/doc/test/real/"
--det_model_dir="./inference/det_db_ft2_1/"
其中一个较为明显的对比图(前者为预测,后者为推理):
后处理参数设置: utility.py: #DB parmas parser.add_argument("--det_db_thresh", type=float, default=0.3) parser.add_argument("--det_db_box_thresh", type=float, default=0.1) parser.add_argument("--det_db_unclip_ratio", type=float, default=1.3) det_mv3_db.yml: PostProcess: function: ppocr.postprocess.db_postprocess,DBPostProcess thresh: 0.3 box_thresh: 0.1 max_candidates: 1000 unclip_ratio: 1.3