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

[Feature] Support RTMDet and RTMPose ncnn deployment #1857

Merged
merged 18 commits into from Mar 21, 2023

Conversation

hanrui1sensetime
Copy link
Collaborator

@hanrui1sensetime hanrui1sensetime commented Mar 8, 2023

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Support RTMDet and RTMPose ncnn deployment

Modification

  • Add rewriter for rtmpose_block.
  • Add configs.

BC-breaking (Optional)

None.

Use cases (Optional)

None.

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.

@grimoire
Copy link
Member

visualize failed with

2023-03-16:11:32:18 - root - ERROR - not enough values to unpack (expected 2, got 1)
Traceback (most recent call last):
  File "/home/user/space/repo2.0/mmdeploy/mmdeploy/utils/utils.py", line 41, in target_wrapper
    result = target(*args, **kwargs)
  File "/home/user/space/repo2.0/mmdeploy/mmdeploy/apis/visualize.py", line 72, in visualize_model
    result = model.test_step(model_inputs)[0]
  File "/home/user/space/repo2.0/mmengine/mmengine/model/base_model/base_model.py", line 145, in test_step
    return self._run_forward(data, mode='predict')  # type: ignore
  File "/home/user/space/repo2.0/mmengine/mmengine/model/base_model/base_model.py", line 326, in _run_forward
    results = self(**data, mode=mode)
  File "/home/user/anaconda3/envs/repo2.0/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/user/space/repo2.0/mmdeploy/mmdeploy/codebase/mmpose/deploy/pose_detection_model.py", line 104, in forward
    batch_pred_x, batch_pred_y = batch_outputs
ValueError: not enough values to unpack (expected 2, got 1)

@hanrui1sensetime
Copy link
Collaborator Author

hanrui1sensetime commented Mar 16, 2023

visualize failed with

2023-03-16:11:32:18 - root - ERROR - not enough values to unpack (expected 2, got 1)
Traceback (most recent call last):
  File "/home/user/space/repo2.0/mmdeploy/mmdeploy/utils/utils.py", line 41, in target_wrapper
    result = target(*args, **kwargs)
  File "/home/user/space/repo2.0/mmdeploy/mmdeploy/apis/visualize.py", line 72, in visualize_model
    result = model.test_step(model_inputs)[0]
  File "/home/user/space/repo2.0/mmengine/mmengine/model/base_model/base_model.py", line 145, in test_step
    return self._run_forward(data, mode='predict')  # type: ignore
  File "/home/user/space/repo2.0/mmengine/mmengine/model/base_model/base_model.py", line 326, in _run_forward
    results = self(**data, mode=mode)
  File "/home/user/anaconda3/envs/repo2.0/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/user/space/repo2.0/mmdeploy/mmdeploy/codebase/mmpose/deploy/pose_detection_model.py", line 104, in forward
    batch_pred_x, batch_pred_y = batch_outputs
ValueError: not enough values to unpack (expected 2, got 1)

Should use pose-detection_simcc_ncnn_static-256x192.py as deploy config.

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.

LGTM

@hanrui1sensetime hanrui1sensetime changed the title [Feature] Support RTMPose ncnn deployment [Feature] Support RTMDet and RTMPose ncnn deployment Mar 17, 2023
Copy link
Member

@AllentDan AllentDan left a comment

Choose a reason for hiding this comment

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

The .cpp files need to be clang-formatted.

@hanrui1sensetime
Copy link
Collaborator Author

The .cpp files need to be clang-formatted.

Will be formatted in another PR.

@lvhan028 lvhan028 merged commit d48187c into open-mmlab:dev-1.x Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants