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

[CodeCamp2023-584]Support DINO self-supervised learning in project #1756

Merged
merged 5 commits into from
Aug 23, 2023

Conversation

LALBJ
Copy link
Contributor

@LALBJ LALBJ commented Aug 9, 2023

Support DINO self-supervised learning in project, based on open-mmlab/OpenMMLabCamp#584

Motivation

To support DINO in MMpretrain, migrate DINO from MMSelSup.

Modification

Add DINO python files in mmpretrain/project

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.

@CLAassistant
Copy link

CLAassistant commented Aug 9, 2023

CLA assistant check
All committers have signed the CLA.

mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
bgr_to_rgb=True),
backbone=dict(type='mmcls.VisionTransformer', arch='b', patch_size=16),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
backbone=dict(type='mmcls.VisionTransformer', arch='b', patch_size=16),
backbone=dict(type='mmpretrain.VisionTransformer', arch='b', patch_size=16),

please use model in mmpretrain

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

sampler=dict(type='DefaultSampler', shuffle=True),
collate_fn=dict(type='default_collate'),
dataset=dict(
type='mmcls.ImageNet',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
type='mmcls.ImageNet',
type='mmpretrain.ImageNet',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

collate_fn=dict(type='default_collate'),
dataset=dict(
type='mmcls.ImageNet',
data_root='/home/liushi_22151211/imagenet/classification',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
data_root='/home/liushi_22151211/imagenet/classification',
data_root='data/imagenet/',

after your experiment. please change back to original path

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

global_crops_scale=(0.4, 1.0),
local_crops_scale=(0.05, 0.4),
local_crops_number=8),
dict(type='PackInputs', meta_keys=['img_path'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
dict(type='PackInputs', meta_keys=['img_path'])
dict(type='PackInputs')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Patch coverage: 96.00% and project coverage change: -20.07% ⚠️

Comparison is base (89eaa92) 85.22% compared to head (3676b10) 65.16%.
Report is 112 commits behind head on main.

❗ Current head 3676b10 differs from pull request most recent head 7f81388. Consider uploading reports for the commit 7f81388 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1756       +/-   ##
===========================================
- Coverage   85.22%   65.16%   -20.07%     
===========================================
  Files         229      362      +133     
  Lines       17243    26181     +8938     
  Branches     2707     4165     +1458     
===========================================
+ Hits        14696    17060     +2364     
- Misses       2046     8501     +6455     
- Partials      501      620      +119     
Flag Coverage Δ
unittests 65.16% <96.00%> (-20.07%) ⬇️

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

Files Changed Coverage Δ
configs/_base_/datasets/imagenet_bs128_mbv3.py 100.00% <ø> (ø)
configs/_base_/datasets/imagenet_bs32.py 100.00% <ø> (ø)
...onfigs/_base_/datasets/imagenet_bs32_pil_resize.py 100.00% <ø> (ø)
configs/_base_/datasets/imagenet_bs64_swin_224.py 100.00% <ø> (ø)
configs/_base_/datasets/imagenet_bs64_swin_384.py 100.00% <ø> (ø)
configs/hivit/hivit-tiny-p16_16xb64_in1k.py 50.00% <50.00%> (ø)
configs/_base_/datasets/imagenet_bs64_hivit_224.py 100.00% <100.00%> (ø)
configs/_base_/models/hivit/tiny_224.py 100.00% <100.00%> (ø)
...gs/_base_/schedules/imagenet_bs1024_adamw_hivit.py 100.00% <100.00%> (ø)
configs/dinov2/vit-base-p14_dinov2-pre_headless.py 100.00% <100.00%> (ø)
... and 1 more

... and 177 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fangyixiao18 fangyixiao18 merged commit d2ccc44 into open-mmlab:main Aug 23, 2023
9 checks passed
@OpenMMLab-Assistant-004

Hi @LALBJ,

We'd like to express our appreciation for your valuable contributions to the mmpretrain. Your efforts have significantly aided in enhancing the project's quality.
It is our pleasure to invite you to join our community thorugh Discord_Special Interest Group (SIG) channel. This is a great place to share your experiences, discuss ideas, and connect with other like-minded people. To become a part of the SIG channel, send a message to the moderator, OpenMMLab, briefly introduce yourself and mention your open-source contributions in the #introductions channel. Our team will gladly facilitate your entry. We eagerly await your presence. Please follow this link to join us: ​https://discord.gg/UjgXkPWNqA.

If you're on WeChat, we'd also love for you to join our community there. Just add our assistant using the WeChat ID: openmmlabwx. When sending the friend request, remember to include the remark "mmsig + Github ID".

Thanks again for your awesome contribution, and we're excited to have you as part of our community!

mzr1996 added a commit that referenced this pull request Oct 25, 2023
* [CodeCamp2023-584]Support DINO self-supervised learning in project (#1756)

* feat: impelemt DINO

* chore: delete debug code

* chore: impplement pre-commit

* fix: fix imported package

* chore: pre-commit check

* [CodeCamp2023-340] New Version of config Adapting MobileNet Algorithm (#1774)

* add new config adapting MobileNetV2,V3

* add base model config for mobile net v3, modified all training configs of mobile net v3 inherit from the base model config

* removed directory _base_/models/mobilenet_v3

* [Feature] Implement of Zero-Shot CLIP Classifier (#1737)

* zero-shot CLIP

* modify zero-shot clip config

* add in1k_sub_prompt(8 prompts) for improvement

* add some annotations doc

* clip base class & clip_zs sub-class

* some modifications of details after review

* convert into and use mmpretrain-vit

* modify names of some files and directories

* ram init commit

* [Fix] Fix pipeline bug in image retrieval inferencer

* [CodeCamp2023-341] 多模态数据集文档补充-COCO Retrieval

* Update OFA to compat with latest huggingface.

* Update train.py to compat with new config

* Bump version to v1.1.0

* Update __init__.py

---------

Co-authored-by: LALBJ <40877073+LALBJ@users.noreply.github.com>
Co-authored-by: DE009 <57087096+DE009@users.noreply.github.com>
Co-authored-by: mzr1996 <mzr1996@163.com>
Co-authored-by: 飞飞 <102729089+ASHORE1225@users.noreply.github.com>
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

4 participants