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 verify bugs #547

Merged
merged 2 commits into from
May 13, 2021
Merged

fix verify bugs #547

merged 2 commits into from
May 13, 2021

Conversation

grimoire
Copy link
Member

Hi
This PR fixes shape mismatch when verifying the whole mode model in pytorch2onnx.

@@ -96,13 +96,16 @@ def _prepare_input_img(img_path,
return mm_inputs


def _update_input_img(img_list, img_meta_list):
def _update_input_img(img_list, img_meta_list, update_origin=False):
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does update_origin means?

Copy link
Member Author

Choose a reason for hiding this comment

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

ori_shape in img_meta is used to rescale output to origin shape.
_update_input_img will update img_meta_list according to img_list. And this flag is used to control if the segmentator needs to rescale according to the input tensor shape.

@@ -220,7 +223,7 @@ def pytorch2onnx(model,

# update img_meta
img_list, img_meta_list = _update_input_img(
img_list, img_meta_list)
img_list, img_meta_list, test_mode == 'whole')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why arg is test_mode == 'whole'?

Copy link
Member Author

Choose a reason for hiding this comment

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

The input tensor has been interpolated with scale_factor=1.5 to test dynamic shape support.
We only support dynamic shape on these whole mode models.

@codecov
Copy link

codecov bot commented May 12, 2021

Codecov Report

Merging #547 (9ac8434) into master (db44d16) will decrease coverage by 0.03%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #547      +/-   ##
==========================================
- Coverage   86.79%   86.76%   -0.04%     
==========================================
  Files         101      101              
  Lines        5249     5250       +1     
  Branches      848      849       +1     
==========================================
- Hits         4556     4555       -1     
- Misses        533      535       +2     
  Partials      160      160              
Flag Coverage Δ
unittests 86.76% <ø> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
mmseg/models/backbones/vit.py 87.04% <0.00%> (-0.92%) ⬇️
mmseg/models/necks/multilevel_neck.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db44d16...9ac8434. Read the comment docs.

@xvjiarui xvjiarui merged commit 8558163 into open-mmlab:master May 13, 2021
bowenroom pushed a commit to bowenroom/mmsegmentation that referenced this pull request Feb 25, 2022
* fix verify bugs

* rename args
sibozhang pushed a commit to sibozhang/mmsegmentation that referenced this pull request Mar 22, 2024
* resolve comments

* update changelog

* init stdet_demo

* frame extraction & human det

* update code

* rename label_map.txt as k400_label_map.txt

* finish demo

* after check

* resolve comments & + docstring
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