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

[Fix] Avoid scope switching when using mmdet inference interface #2039

Merged
merged 3 commits into from
Mar 13, 2023

Conversation

Ben-Louis
Copy link
Collaborator

Motivation

While inferring top-down models on videos, the scope alternates between 'mmdet' and 'mmpose' repeatedly, which often results in numerous warning messages.
屏幕截图 2023-03-10 154340

Modification

BC-breaking (Optional)

Use cases (Optional)

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • CLA has been signed and all committers have signed the CLA in this PR.

@Ben-Louis Ben-Louis requested a review from ly015 March 10, 2023 08:02
@codecov
Copy link

codecov bot commented Mar 10, 2023

Codecov Report

Patch coverage: 84.61% and project coverage change: -0.01 ⚠️

Comparison is base (ffbf595) 82.15% compared to head (2354744) 82.15%.

❗ Current head 2354744 differs from pull request most recent head 102c5f2. Consider uploading reports for the commit 102c5f2 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           dev-1.x    #2039      +/-   ##
===========================================
- Coverage    82.15%   82.15%   -0.01%     
===========================================
  Files          224      225       +1     
  Lines        13362    13373      +11     
  Branches      2265     2268       +3     
===========================================
+ Hits         10978    10986       +8     
- Misses        1873     1877       +4     
+ Partials       511      510       -1     
Flag Coverage Δ
unittests 82.15% <84.61%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
mmpose/utils/config_utils.py 80.00% <80.00%> (ø)
...ose/apis/webcam/nodes/model_nodes/detector_node.py 82.35% <100.00%> (ø)
mmpose/utils/__init__.py 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

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.

from mmpose.utils.typing import ConfigDict


def convert_mmdet_test_pipeline(cfg: ConfigDict) -> ConfigDict:
Copy link
Member

Choose a reason for hiding this comment

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

What about naming the function 'port_mmdet_pipeline' or 'adapt_mmdet_pipeline'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good idea. I think 'adapt_mmdet_pipeline' is preferable

@ly015
Copy link
Member

ly015 commented Mar 11, 2023

BTW, please also use lazy import for mmdetection in other parts of mmpose package, like https://github.com/open-mmlab/mmpose/blob/dev-1.x/mmpose/apis/inferencers/pose2d_inferencer.py#L7. So the model training/testing and document compiling will not depend on mmdetection.

@ly015
Copy link
Member

ly015 commented Mar 11, 2023

BTW, please also use lazy import for mmdetection in other parts of mmpose package, like https://github.com/open-mmlab/mmpose/blob/dev-1.x/mmpose/apis/inferencers/pose2d_inferencer.py#L7. So the model training/testing and document compiling will not depend on mmdetection.

Fixed in #2045 . No need to update this PR.

@ly015 ly015 merged commit af88d62 into open-mmlab:dev-1.x Mar 13, 2023
@Ben-Louis Ben-Louis deleted the remove-scope-switch branch March 29, 2023 17:34
shuheilocale pushed a commit to shuheilocale/mmpose that referenced this pull request May 6, 2023
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