mindocr
mindocr copied to clipboard
[WIP] pr592 适配合入 && det后处理 长短框合并
Thank you for your contribution to the MindOCR repo. Before submitting this PR, please make sure:
- [x] You have read the Contributing Guidelines on pull requests
- [x] Your code builds clean without any errors or warnings
- [x] You are using approved terminology
- [x] You have added unit tests
Motivation
-
https://github.com/mindspore-lab/mindocr/pull/592/ 适配合入
- [x] 代码整合
- [x] 模型训练
- [x] dbnet-resnet50
- [x] crnn-resnet34
- [x] 离线模型导出
export OFFLINE_MODE=True cd tools python export_convert_tool.py --model_name=dbnet_resnet50 --task=export_convert --is_dynamic=True --output_folder=export_models --force=True python export_convert_tool.py --model_name=crnn_resnet34 --task=export_convert --is_dynamic=True --output_folder=export_models --force=True - [x] 离线推理推理
export OFFLINE_MODE=True MINDOCR_MODEL_PATH_DET=tools/export_models/convert_folder/dbnet_resnet50_lite_dynamic.mindir MINDOCR_MODEL_CONFIG_DET=configs/det/dbnet/db_r50_icdar15.yaml MINDOCR_MODEL_PATH_REC=tools/export_models/convert_folder/crnn_resnet34_lite_dynamic.mindir MINDOCR_MODEL_CONFIG_REC=configs/rec/crnn/crnn_resnet34.yaml RES_SAVE_DIR=res DATASET=path/to/dataset python deploy/py_infer/infer.py --input_images_dir=$DATASET --det_model_path=$MINDOCR_MODEL_PATH_DET --det_model_name_or_config=$MINDOCR_MODEL_CONFIG_DET --rec_model_path=$MINDOCR_MODEL_PATH_REC --rec_model_name_or_config=$MINDOCR_MODEL_CONFIG_REC --res_save_dir=$RES_SAVE_DIR --result_contain_score=True --node_fetch_interval=0.001 --show_log=True
-
[x] 修复推理时卡占满的问题。修复后infer节点显存占用200~400M
-
[x] 长短框合并 在
python deploy/py_infer/infer.py传入--is_concat=Truepython deploy/py_infer/infer.py --input_images_dir=$DATASET --det_model_path=$MINDOCR_MODEL_PATH_DET --det_model_name_or_config=$MINDOCR_MODEL_CONFIG_DET --rec_model_path=$MINDOCR_MODEL_PATH_REC --rec_model_name_or_config=$MINDOCR_MODEL_CONFIG_REC --res_save_dir=$RES_SAVE_DIR --result_contain_score=True --node_fetch_interval=0.001 --show_log=True --is_concat=True
(Write your motivation for proposed changes here.)
Test Plan
(How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?)
Related Issues and PRs
(Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)