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

[WIP] pr592 适配合入 && det后处理 长短框合并 #682

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

horcham
Copy link
Collaborator

@horcham horcham commented Mar 18, 2024

Thank you for your contribution to the MindOCR repo.
Before submitting this PR, please make sure:

Motivation

  • [WIP] export dynamic shape mindir #592 适配合入

    • 代码整合
    • 模型训练
      • dbnet-resnet50
      • crnn-resnet34
    • 离线模型导出
      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
    • 离线推理推理
      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
  • 修复推理时卡占满的问题。修复后infer节点显存占用200~400M

  • 长短框合并
    python deploy/py_infer/infer.py传入--is_concat=True

     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 --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)

@horcham horcham changed the title pr592 适配合入 && det后处理 长短框合并 [WIP] pr592 适配合入 && det后处理 长短框合并 Mar 18, 2024
Bourn3z and others added 18 commits March 18, 2024 19:45
Add the function of concatenating to crops after detection.
Add the function of concatenating to crops after detection.
Add the function of concatenating to crops after detection.
Add the function of concatenating to crops after detection.
Add the function of concatenating to crops after detection.
Add the function of concatenating to crops after detection.
Add the function of concatenating to crops after detection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants