Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

文字检测训练模型转inference模式后 效果不一致,差很多。去查了预处理的问题,设置了。预测参数怎 #9116

Closed
rexzhengzhihong opened this issue Feb 17, 2023 · 6 comments
Assignees
Labels

Comments

@rexzhengzhihong
Copy link

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

  • 系统环境/System Environment:
    ubuntu20.04
  • 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:
paddle 1.0.2
paddle-bfloat 0.1.2
paddle2onnx 0.9.7
paddlefsl 1.1.0
paddlenlp 2.4.1
paddleocr 2.6.1.2
paddlepaddle-gpu 2.4.1.post116
pandas 1.1.5
pandocfilters 1.5.0
  • 运行指令/Command Code:
python3 tools/infer/predict_det.py --det_algorithm="DB" \
--det_model_dir="/home/DiskA/zncsPython/picture_ocr/zzszyfp_v1/model/det/inference/det_db_inference_dml_dml_100/Student" \
--image_dir="/home/DiskA/zncsPython/picture_ocr/zzszyfp_v1/test/det_imgs/" \
--draw_img_save_dir="/home/DiskA/zncsPython/picture_ocr/zzszyfp_v1/test/det_imgsresult/" \
--use_gpu=True \
  • 完整报错/Complete Error Message:
    image
    image
    这两个参数,一个是分辨率。一个是设置最大最小。那怎么匹配呢??
@rexzhengzhihong
Copy link
Author

--det_limit_side_len=736 \
--det_limit_type='min' 

inferce预测加了这个就准了。736从哪里来的?

@rexzhengzhihong
Copy link
Author

@an1018

@an1018
Copy link
Collaborator

an1018 commented Feb 17, 2023

因为导出模型前后预处理不相同,导致预测结果不同,详细的介绍的可以看下这个文档:https://github.com/PaddlePaddle/PaddleOCR/blob/dygraph/doc/doc_ch/detection.md#5-faq

@rexzhengzhihong
Copy link
Author

因为导出模型前后预处理不相同,导致预测结果不同,详细的介绍的可以看下这个文档:https://github.com/PaddlePaddle/PaddleOCR/blob/dygraph/doc/doc_ch/detection.md#5-faq

这个文档的的配置参数是一个image_shape: [736, 1280] 。预测的参数没有设置shape,只有设置最大 最小。怎么一致呢?
@an1018

@jiang-yw
Copy link

jiang-yw commented Apr 4, 2023

因为导出模型前后预处理不相同,导致预测结果不同,详细的介绍的可以看下这个文档:https://github.com/PaddlePaddle/PaddleOCR/blob/dygraph/doc/doc_ch/detection.md#5-faq

这个文档的的配置参数是一个image_shape: [736, 1280] 。预测的参数没有设置shape,只有设置最大 最小。怎么一致呢? @an1018
可以试试在predict_det.py文件 'limit_side_len'后添加参数'image_shape'固定shape预测,参考这个issue: #8991
image

@github-actions
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants