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

CodeCamp #106: Support SOLOv2 deployment with OpenVINO #1521

Merged
merged 43 commits into from
Apr 26, 2023

Conversation

Li-Hongda
Copy link
Contributor

Motivation

支持SOLOv2 mmdet3.x Openvino导出

Modification

支持SOLOv2 mmdet3.x Openvino导出

BC-Breaking(Optional)

None

Use cases (Optional)

python tools/deploy.py configs/mmdet/instance-seg/instance-seg_openvino_dynamic-800x1344.py \ 
                                       ${MMDETECTION_DIR}/configs/solo/solov2_r50_fpn_1x_coco.py \
                                       ${MMDETECTION_DIR}/demo/demo.jpg \
                                       --work-dir work_dirs/solov2/instance-seg_openvino_dynamic-800x1344 \
                                       --device cpu

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@CLAassistant
Copy link

CLAassistant commented Dec 12, 2022

CLA assistant check
All committers have signed the CLA.

@lvhan028 lvhan028 changed the title CodeCamp #106 CodeCamp #106: Support SOLOv2 deployment with OpenVINO Dec 16, 2022
Copy link
Member

@grimoire grimoire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we have refactor rewriter in #1483 to support MMRazor.
ctx of the rewriter arguments has been removed. You can get ctx by:

ctx = FUNCTION_REWRITER.get_context()

Copy link
Collaborator

@hanrui1sensetime hanrui1sensetime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please solve conflicts first

@Li-Hongda
Copy link
Contributor Author

Li-Hongda commented Apr 12, 2023

@RunningLeon Hi, I follow your advice to add End2EndModelSOLO with this config. The latest implementation discardes bboxes and only keeps masks, scores, labels.The inference result looks right.However, maybe I didn't understand what you meant. I found this will lead to errors in the evaluation due to this line.
I also provide another simple implementation by just setting all the bboxes to zero.The result turns out to be true, but maybe not what you want.

@RunningLeon
Copy link
Collaborator

@Li-Hongda Hi, sorry for the confusion. Maybe a simple solution is to revert code to commit f5b3e26 and pass model_cfg in here and zero out the result.bboxes when self.model_cfg.model.type in ['SOLO', 'SOLOv2'] above here

@codecov
Copy link

codecov bot commented Apr 14, 2023

Codecov Report

Patch coverage: 92.64% and project coverage change: +0.21 🎉

Comparison is base (2c7e91b) 49.44% compared to head (c3ea756) 49.65%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1521      +/-   ##
==========================================
+ Coverage   49.44%   49.65%   +0.21%     
==========================================
  Files         338      339       +1     
  Lines       12920    12985      +65     
  Branches     1897     1901       +4     
==========================================
+ Hits         6388     6448      +60     
- Misses       6088     6091       +3     
- Partials      444      446       +2     
Flag Coverage Δ
unittests 49.65% <92.64%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmdeploy/pytorch/functions/linspace.py 100.00% <ø> (ø)
...oy/codebase/mmdet/deploy/object_detection_model.py 40.89% <50.00%> (+0.09%) ⬆️
...y/codebase/mmdet/models/dense_heads/solov2_head.py 94.91% <94.91%> (ø)
...ploy/codebase/mmdet/models/dense_heads/__init__.py 100.00% <100.00%> (ø)
...loy/codebase/mmdet/models/dense_heads/solo_head.py 93.61% <100.00%> (ø)
mmdeploy/utils/test.py 87.25% <100.00%> (+0.06%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@RunningLeon
Copy link
Collaborator

@Li-Hongda Hi, could sync with latest main branch to fix ci error?

@RunningLeon
Copy link
Collaborator

@Li-Hongda Could you sync with main branch to fix ci errors? This PR is ready to merge.

@Li-Hongda
Copy link
Contributor Author

@RunningLeon Sorry, I went on a business trip the last few days.

Copy link
Collaborator

@RunningLeon RunningLeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RunningLeon RunningLeon merged commit 9a442ab into open-mmlab:main Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants