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

[Refactor] Refactor BEiT backbone and support v1/v2 inference #1144

Merged
merged 22 commits into from
Nov 29, 2022

Conversation

fangyixiao18
Copy link
Collaborator

@fangyixiao18 fangyixiao18 commented Oct 27, 2022

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

Motivation

Related issue: #1097

Modification

BEiT v1

Official repo results
image
My results
image

BEiT v2

Official repo results
image
My results
image

BC-breaking (Optional)

Does the modification introduce changes that break the backward compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here and update the documentation.

Checklist

Before PR:

  • Pre-commit or other linting tools are used to fix the potential lint issues.
  • Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
  • The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, like docstring or example tutorials.

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects, like MMDet or MMSeg.
  • CLA has been signed and all committers have signed the CLA in this PR.

@codecov
Copy link

codecov bot commented Oct 27, 2022

Codecov Report

Base: 0.02% // Head: 89.08% // Increases project coverage by +89.06% 🎉

Coverage data is based on head (aa504d5) compared to base (b8b31e9).
Patch has no changes to coverable lines.

Additional details and impacted files
@@             Coverage Diff              @@
##           dev-1.x    #1144       +/-   ##
============================================
+ Coverage     0.02%   89.08%   +89.06%     
============================================
  Files          121      148       +27     
  Lines         8217    11384     +3167     
  Branches      1368     1812      +444     
============================================
+ Hits             2    10142    +10140     
+ Misses        8215      977     -7238     
- Partials         0      265      +265     
Flag Coverage Δ
unittests 89.08% <ø> (+89.06%) ⬆️

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

Impacted Files Coverage Δ
mmcls/apis/inference.py 0.00% <0.00%> (ø)
mmcls/datasets/transforms/compose.py
mmcls/models/backbones/mobileone.py 94.47% <0.00%> (ø)
mmcls/models/backbones/beit.py 57.67% <0.00%> (ø)
mmcls/models/backbones/mvit.py 92.46% <0.00%> (ø)
mmcls/structures/utils.py 77.77% <0.00%> (ø)
mmcls/models/heads/margin_head.py 90.00% <0.00%> (ø)
mmcls/models/classifiers/hugging_face.py 25.33% <0.00%> (ø)
mmcls/evaluation/metrics/voc_multi_label.py 100.00% <0.00%> (ø)
mmcls/engine/hooks/margin_head_hooks.py 92.59% <0.00%> (ø)
... and 138 more

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fangyixiao18 fangyixiao18 marked this pull request as ready for review October 28, 2022 07:51
@fangyixiao18 fangyixiao18 changed the title [Refactor] Refactor BEiT backbone [Refactor] Refactor BEiT backbone and support inference Oct 28, 2022
@tonysy tonysy mentioned this pull request Oct 28, 2022
6 tasks
@tonysy tonysy requested a review from mzr1996 November 4, 2022 01:55
@fangyixiao18 fangyixiao18 changed the title [Refactor] Refactor BEiT backbone and support inference [Refactor] Refactor BEiT backbone and support v1/v2 inference Nov 8, 2022
mmcls/models/backbones/beit.py Outdated Show resolved Hide resolved
mmcls/models/backbones/beit.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Ezra-Yu Ezra-Yu left a comment

Choose a reason for hiding this comment

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

  1. please update API docs

mmcls/models/backbones/beit.py Show resolved Hide resolved
mmcls/models/backbones/beit.py Show resolved Hide resolved
mmcls/models/backbones/beit.py Show resolved Hide resolved
configs/beitv2/README.md Show resolved Hide resolved
configs/beit/README.md Show resolved Hide resolved
mmcls/models/backbones/beit.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@Ezra-Yu Ezra-Yu left a comment

Choose a reason for hiding this comment

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

LGTM.

@mzr1996 mzr1996 merged commit d80ec5a into open-mmlab:dev-1.x Nov 29, 2022
@fangyixiao18 fangyixiao18 deleted the vit-beit branch February 23, 2023 08:28
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.

None yet

3 participants