Skip to content

[Feature] Add DOLG neck for image retrieval#1053

Open
zzc98 wants to merge 9 commits intoopen-mmlab:dev-1.xfrom
zzc98:add-dolg
Open

[Feature] Add DOLG neck for image retrieval#1053
zzc98 wants to merge 9 commits intoopen-mmlab:dev-1.xfrom
zzc98:add-dolg

Conversation

@zzc98
Copy link
Copy Markdown
Contributor

@zzc98 zzc98 commented Sep 26, 2022

Motivation

The implementation of DOLG, which is a kind of neck network in the retrieval task. More details about DOLG can be found in DOLG: Single-Stage Image Retrieval with Deep Orthogonal Fusion of Local and Global Features.

Use cases

model = dict(
    type='ImageClassifier',
    backbone=dict(
        type='ResNet',
        depth=101,
        num_stages=4,
        out_indices=(2, 3,),
        style='pytorch'
    ),
    neck=dict(type='DOLG',
               local_dim=1024,     # feature dim in last second stage (local feat)
               global_dim=2048,  # feature dim in last stage (global feat)
               out_dim=2048, 
               dilation_rates=(3, 6, 9)
    ),
    head=dict(
        type='LinearClsHead',
        num_classes=1000,
        in_channels=2048,
        loss=dict(type='CrossEntropyLoss', loss_weight=1.0),
        topk=(1, 5),
    ),
)

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.

@Ezra-Yu Ezra-Yu added the 1.0rc Functionalities for MMClassification 1.0rc label Sep 26, 2022
@Ezra-Yu Ezra-Yu requested a review from okotaku February 21, 2023 13:02
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 22, 2023

Codecov Report

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

Comparison is base (b8b31e9) 0.02% compared to head (a59f588) 86.88%.

❗ Current head a59f588 differs from pull request most recent head 3e16369. Consider uploading reports for the commit 3e16369 to get more accurate results

Additional details and impacted files
@@             Coverage Diff              @@
##           dev-1.x    #1053       +/-   ##
============================================
+ Coverage     0.02%   86.88%   +86.85%     
============================================
  Files          121      170       +49     
  Lines         8217    14056     +5839     
  Branches      1368     2225      +857     
============================================
+ Hits             2    12212    +12210     
+ Misses        8215     1461     -6754     
- Partials         0      383      +383     
Flag Coverage Δ
unittests 86.88% <ø> (+86.85%) ⬆️

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

Impacted Files Coverage Δ
mmcls/datasets/transforms/compose.py
mmcls/models/backbones/davit.py 84.94% <0.00%> (ø)
mmcls/models/classifiers/timm.py 25.97% <0.00%> (ø)
mmcls/models/retrievers/__init__.py 100.00% <0.00%> (ø)
mmcls/engine/hooks/margin_head_hooks.py 92.59% <0.00%> (ø)
mmcls/engine/hooks/ema_hook.py 81.69% <0.00%> (ø)
mmcls/apis/model.py 88.17% <0.00%> (ø)
mmcls/models/utils/layer_scale.py 86.66% <0.00%> (ø)
mmcls/evaluation/metrics/retrieval.py 84.70% <0.00%> (ø)
mmcls/models/necks/reduction.py 100.00% <0.00%> (ø)
... and 161 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.

Comment thread mmcls/models/necks/dolg.py
Comment thread mmcls/models/necks/dolg.py
Copy link
Copy Markdown
Collaborator

@okotaku okotaku left a comment

Choose a reason for hiding this comment

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

I understand. LGTM

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.0rc Functionalities for MMClassification 1.0rc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants