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 Maskfeat Support #485

Merged
merged 18 commits into from
Sep 24, 2022
Merged

Conversation

daidaiershidi
Copy link
Contributor

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 maskfeat support.

Modification

Add MaskGenerator.
Add backbone of maskfeat.
Add head of maskfeat.
Add algorithms of maskfeat.
Add config of maskfeat.
Add Config of MaskFeat.
Update Readme of MaskFeat.

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 Sep 15, 2022

Codecov Report

Base: 72.48% // Head: 73.26% // Increases project coverage by +0.78% 🎉

Coverage data is based on head (fbf1e11) compared to base (6e6bec1).
Patch coverage: 89.51% of modified lines in pull request are covered.

❗ Current head fbf1e11 differs from pull request most recent head 2ee92b9. Consider uploading reports for the commit 2ee92b9 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #485      +/-   ##
==========================================
+ Coverage   72.48%   73.26%   +0.78%     
==========================================
  Files         121      125       +4     
  Lines        4765     4994     +229     
  Branches      763      788      +25     
==========================================
+ Hits         3454     3659     +205     
- Misses       1151     1167      +16     
- Partials      160      168       +8     
Flag Coverage Δ
unittests 73.26% <89.51%> (+0.78%) ⬆️

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

Impacted Files Coverage Δ
mmselfsup/datasets/pipelines/__init__.py 100.00% <ø> (ø)
mmselfsup/datasets/pipelines/transforms.py 83.33% <75.47%> (-1.87%) ⬇️
mmselfsup/models/heads/maskfeat_head.py 86.66% <86.66%> (ø)
mmselfsup/models/utils/hog_layer.py 93.22% <93.22%> (ø)
mmselfsup/models/backbones/maskfeat_vit.py 97.67% <97.67%> (ø)
mmselfsup/models/algorithms/__init__.py 100.00% <100.00%> (ø)
mmselfsup/models/algorithms/maskfeat.py 100.00% <100.00%> (ø)
mmselfsup/models/backbones/__init__.py 100.00% <100.00%> (ø)
mmselfsup/models/heads/__init__.py 100.00% <100.00%> (ø)

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.

@tonysy tonysy self-requested a review September 18, 2022 16:23
drop_path_rate=0,
),
head=dict(type='MaskFeatPretrainHead', hog_dim=108),
hog_para=dict(nbins=9, pool=8, gaussian_window=16))
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add some comments for hog related parameters, to help the users.

Copy link
Collaborator

@tonysy tonysy left a comment

Choose a reason for hiding this comment

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

As inline comments

mmselfsup/models/algorithms/maskfeat.py Outdated Show resolved Hide resolved
mmselfsup/models/algorithms/maskfeat.py Show resolved Hide resolved
@fangyixiao18 fangyixiao18 requested a review from tonysy September 20, 2022 08:13
docs/zh_cn/model_zoo.md Outdated Show resolved Hide resolved
docs/en/model_zoo.md Outdated Show resolved Hide resolved


@PIPELINES.register_module()
class MaskfeatMaskGenerator(object):
Copy link
Collaborator

@tonysy tonysy Sep 23, 2022

Choose a reason for hiding this comment

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

How about using MaskFeatureMaskGenerator? @fangyixiao18

Suggested change
class MaskfeatMaskGenerator(object):
class MaskFeatMaskGenerator(object):

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is better to use MaskFeatMaskGenerator,consisting with algorithm name in our implementation

Copy link
Collaborator

@tonysy tonysy left a comment

Choose a reason for hiding this comment

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

Update the name and this pr could be merged.

@fangyixiao18 fangyixiao18 merged commit 01d764f into open-mmlab:dev Sep 24, 2022
fangyixiao18 pushed a commit that referenced this pull request Sep 30, 2022
* [Feature]: Add MaskfeatMaskGenerator Pipeline

* [Feature]: Add HogLayerC for MaskFeat

* [Feature]: Add Backbone of MaskFeat

* [Feature]: Add Head of MaskFeat

* [Feature]: Add Algorithms of MaskFeat

* [Feature]: Add Config of MaskFeat

* [Doc] Update Readme of MaskFeat

* [Fix] fix ut and hog_layer.

* [fix] Add and correct docstring

* [Fix] Refine the docstring of MaskFeat

* [fix] fix value of trunc_normal_

* [fix] rename the finetune config of maskfeat

* [fix] rename the fine-tuning config of maskfeat

* [fix] rename the fine-tuning config of maskfeat

* [fix] add new paramwise_options in fine-tuning config

* [fix] update the top-1 accuary of maskfeat

* [fix] update the top-1 accuary of maskfeat in model_zoo

* [fix] rename MaskfeatMaskGenerator
fangyixiao18 pushed a commit to fangyixiao18/mmselfsup that referenced this pull request Oct 1, 2022
* [Feature]: Add MaskfeatMaskGenerator Pipeline

* [Feature]: Add HogLayerC for MaskFeat

* [Feature]: Add Backbone of MaskFeat

* [Feature]: Add Head of MaskFeat

* [Feature]: Add Algorithms of MaskFeat

* [Feature]: Add Config of MaskFeat

* [Doc] Update Readme of MaskFeat

* [Fix] fix ut and hog_layer.

* [fix] Add and correct docstring

* [Fix] Refine the docstring of MaskFeat

* [fix] fix value of trunc_normal_

* [fix] rename the finetune config of maskfeat

* [fix] rename the fine-tuning config of maskfeat

* [fix] rename the fine-tuning config of maskfeat

* [fix] add new paramwise_options in fine-tuning config

* [fix] update the top-1 accuary of maskfeat

* [fix] update the top-1 accuary of maskfeat in model_zoo

* [fix] rename MaskfeatMaskGenerator
fangyixiao18 pushed a commit that referenced this pull request Oct 1, 2022
* [Feature]: Add MaskfeatMaskGenerator Pipeline

* [Feature]: Add HogLayerC for MaskFeat

* [Feature]: Add Backbone of MaskFeat

* [Feature]: Add Head of MaskFeat

* [Feature]: Add Algorithms of MaskFeat

* [Feature]: Add Config of MaskFeat

* [Doc] Update Readme of MaskFeat

* [Fix] fix ut and hog_layer.

* [fix] Add and correct docstring

* [Fix] Refine the docstring of MaskFeat

* [fix] fix value of trunc_normal_

* [fix] rename the finetune config of maskfeat

* [fix] rename the fine-tuning config of maskfeat

* [fix] rename the fine-tuning config of maskfeat

* [fix] add new paramwise_options in fine-tuning config

* [fix] update the top-1 accuary of maskfeat

* [fix] update the top-1 accuary of maskfeat in model_zoo

* [fix] rename MaskfeatMaskGenerator
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.

3 participants