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] add eva02 backbone #1450

Merged
merged 56 commits into from
May 6, 2023
Merged

Conversation

zzc98
Copy link
Contributor

@zzc98 zzc98 commented Mar 31, 2023

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

Add the EVA02 backbone.
paper: https://arxiv.org/abs/2303.11331
code: https://github.com/baaivision/EVA/tree/master/EVA-02

Modification

  • Add new backbone network EVA02
  • Complete the network implementation and configuration files
  • Complete the weight conversion according to the official repository
  • Align the accuracy on the ImageNet1k validation set

Use cases

model = dict(
    type='ImageClassifier',
    backbone=dict(
        type='EVA02',
        arch='base',
        img_size=448,
        sub_ln=True,
        out_type='avg_featmap'),
    neck=None,
    head=dict(
        type='LinearClsHead',
        num_classes=1000,
        in_channels=768,
        loss=dict(
            type='LabelSmoothLoss', label_smooth_val=0.1, mode='original'),
    ),
    init_cfg=[
        dict(type='TruncNormal', layer='Linear', std=.02),
        dict(type='Constant', layer='LayerNorm', val=1., bias=0.),
    ],
    train_cfg=dict(augments=[
        dict(type='Mixup', alpha=0.8),
        dict(type='CutMix', alpha=1.0)
    ])
)

More details can be found in configs/eva02/README.md.

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.

@zzc98 zzc98 changed the title feat: add eva02 backbone [Feature] add eva02 backbone Mar 31, 2023
@codecov
Copy link

codecov bot commented Apr 3, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.91 🎉

Comparison is base (c9a0cb0) 84.37% compared to head (9fe90e6) 85.28%.

❗ Current head 9fe90e6 differs from pull request most recent head c481819. Consider uploading reports for the commit c481819 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1450      +/-   ##
==========================================
+ Coverage   84.37%   85.28%   +0.91%     
==========================================
  Files         142      240      +98     
  Lines        9925    18095    +8170     
  Branches     1621     2814    +1193     
==========================================
+ Hits         8374    15433    +7059     
- Misses       1277     2138     +861     
- Partials      274      524     +250     
Flag Coverage Δ
unittests 85.28% <ø> (+0.91%) ⬆️

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

see 382 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

please rm _base_.models.eva folder and put the models cfg into every file of config/eva02/eva02_xxxx.py.

mmpretrain/models/backbones/eva02.py Outdated Show resolved Hide resolved
mmpretrain/models/backbones/eva02.py Outdated Show resolved Hide resolved
mmpretrain/models/backbones/eva02.py Outdated Show resolved Hide resolved
mmpretrain/models/backbones/eva02.py Outdated Show resolved Hide resolved
mmpretrain/models/backbones/eva02.py Outdated Show resolved Hide resolved
@Ezra-Yu Ezra-Yu changed the base branch from main to dev April 13, 2023 06:39
@fangyixiao18 fangyixiao18 mentioned this pull request Apr 14, 2023
14 tasks
@zzc98 zzc98 closed this Apr 21, 2023
@zzc98 zzc98 reopened this Apr 21, 2023
@Ezra-Yu Ezra-Yu mentioned this pull request May 6, 2023
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.

configs/eva02/metafile.yml Outdated Show resolved Hide resolved
mmpretrain/models/backbones/eva02.py Outdated Show resolved Hide resolved
mmpretrain/models/backbones/eva02.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@fangyixiao18 fangyixiao18 left a comment

Choose a reason for hiding this comment

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

also check config names

configs/eva02/eva02_base_p14_8xb16_in1k.py Outdated Show resolved Hide resolved
docs/en/api/models.rst Outdated Show resolved Hide resolved
@fangyixiao18 fangyixiao18 merged commit 034919d into open-mmlab:dev May 6, 2023
@zzc98 zzc98 deleted the add-eva02-backbone branch May 12, 2023 07: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

5 participants