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

[Enhancement]: Refactor SSD #5291

Merged
merged 17 commits into from
Jun 22, 2021
Merged

Conversation

RangiLyu
Copy link
Member

@RangiLyu RangiLyu commented Jun 4, 2021

This PR including these modifications

  1. Refactor SSD-VGG backbone. Move extra conv layers to SSDNeck
  2. Add SSDNeck.
  3. Make SSDHead more flexible, e.g. support depthwise separable conv, support conv tower, support norm layer.
  4. Add SSDNeck unit test.

I have trained SSD300 and the mAP is 25.9 (origin 25.6), SSD512 mAP is 29.8 (origin 29.4).

@codecov
Copy link

codecov bot commented Jun 4, 2021

Codecov Report

Merging #5291 (f142df6) into master (87ad480) will decrease coverage by 0.15%.
The diff coverage is 66.66%.

❗ Current head f142df6 differs from pull request most recent head 4b7b094. Consider uploading reports for the commit 4b7b094 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5291      +/-   ##
==========================================
- Coverage   65.14%   64.98%   -0.16%     
==========================================
  Files         275      276       +1     
  Lines       21248    21289      +41     
  Branches     3535     3540       +5     
==========================================
- Hits        13841    13835       -6     
- Misses       6654     6698      +44     
- Partials      753      756       +3     
Flag Coverage Δ
unittests 64.96% <66.66%> (-0.14%) ⬇️

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

Impacted Files Coverage Δ
mmdet/core/export/model_wrappers.py 0.00% <0.00%> (ø)
mmdet/core/export/pytorch2onnx.py 14.03% <0.00%> (-1.66%) ⬇️
mmdet/models/backbones/ssd_vgg.py 65.90% <40.00%> (-21.75%) ⬇️
mmdet/models/dense_heads/ssd_head.py 87.37% <75.86%> (-5.40%) ⬇️
mmdet/models/necks/__init__.py 100.00% <100.00%> (ø)
mmdet/models/necks/ssd_neck.py 100.00% <100.00%> (ø)
mmdet/models/utils/normed_predictor.py 83.33% <0.00%> (-9.53%) ⬇️
mmdet/models/detectors/cornernet.py 94.87% <0.00%> (-5.13%) ⬇️
mmdet/models/roi_heads/mask_heads/fcn_mask_head.py 69.76% <0.00%> (-3.49%) ⬇️
mmdet/models/dense_heads/corner_head.py 67.48% <0.00%> (-2.46%) ⬇️
... and 1 more

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 87ad480...4b7b094. Read the comment docs.

@ZwwWayne
Copy link
Collaborator

Can we add a model conversion script that can load the previously trained SSD successfully loaded in this PR? We can also do that through _load_from_state_dict without extra scripts.

# Conflicts:
#	configs/ssd/README.md
#	tests/test_models/test_necks.py
@RangiLyu
Copy link
Member Author

Can we add a model conversion script that can load the previously trained SSD successfully loaded in this PR? We can also do that through _load_from_state_dict without extra scripts.

Since the extra layers in SSDVGG have been moved to SSDNeck, the _load_from_state_dict function needs to be put into the detector class. But SSD uses SingleStageDetector so I choose to write a convert weight script instead of putting the weight convert function into the base class.

configs/ssd/README.md Outdated Show resolved Hide resolved
@ZwwWayne
Copy link
Collaborator

We also need to update the compatibility.md

configs/ssd/README.md Outdated Show resolved Hide resolved
docs/compatibility.md Outdated Show resolved Hide resolved
@RangiLyu RangiLyu requested a review from ZwwWayne June 22, 2021 05:43
@ZwwWayne ZwwWayne merged commit 4058255 into open-mmlab:master Jun 22, 2021
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