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] Support RetrieverRecall metric & Add ArcFace config #1316

Merged
merged 17 commits into from
Feb 14, 2023

Conversation

okotaku
Copy link
Collaborator

@okotaku okotaku commented Jan 16, 2023

Motivation

Related PR: #1019

Modification

Fix dataset.
Add arcface config.
Add RetrieverRecall metric.

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 Jan 16, 2023

Codecov Report

Base: 0.02% // Head: 86.83% // Increases project coverage by +86.81% 🎉

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

Additional details and impacted files
@@             Coverage Diff              @@
##           dev-1.x    #1316       +/-   ##
============================================
+ Coverage     0.02%   86.83%   +86.81%     
============================================
  Files          121      167       +46     
  Lines         8217    13606     +5389     
  Branches      1368     2170      +802     
============================================
+ Hits             2    11815    +11813     
+ Misses        8215     1426     -6789     
- Partials         0      365      +365     
Flag Coverage Δ
unittests 86.83% <ø> (+86.81%) ⬆️

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

Impacted Files Coverage Δ
mmcls/datasets/transforms/compose.py
mmcls/evaluation/metrics/voc_multi_label.py 100.00% <0.00%> (ø)
mmcls/datasets/inshop.py 100.00% <0.00%> (ø)
mmcls/engine/optimizers/adan_t.py 10.60% <0.00%> (ø)
mmcls/models/heads/multi_task_head.py 96.87% <0.00%> (ø)
mmcls/models/heads/margin_head.py 89.13% <0.00%> (ø)
mmcls/models/backbones/mobileone.py 94.47% <0.00%> (ø)
mmcls/models/retrievers/image2image.py 91.45% <0.00%> (ø)
mmcls/engine/hooks/margin_head_hooks.py 92.59% <0.00%> (ø)
mmcls/models/backbones/edgenext.py 95.20% <0.00%> (ø)
... and 158 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.

@okotaku okotaku changed the title [Feature] Support InShop Dataset [WIP] Support InShop Dataset Jan 16, 2023
@okotaku okotaku changed the title [WIP] Support InShop Dataset [Feature] Support InShop Dataset Jan 17, 2023
@okotaku okotaku changed the title [Feature] Support InShop Dataset [Feature] Support InShop Dataset & ArcFace config Jan 17, 2023
@Ezra-Yu Ezra-Yu changed the title [Feature] Support InShop Dataset & ArcFace config [Feature] Support RetrieverRecall metric & Add ArcFace config Jan 30, 2023
@Ezra-Yu Ezra-Yu requested a review from yingfhu February 3, 2023 02:55
mmcls/evaluation/metrics/retrieval.py Outdated Show resolved Hide resolved
mmcls/evaluation/metrics/retrieval.py Outdated Show resolved Hide resolved
mmcls/evaluation/metrics/retrieval.py Outdated Show resolved Hide resolved
return indices


def _format_target(label, is_indices=False):
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems unnecessary to have _format for both pred and target, could these be merged?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@Ezra-Yu What do you think?

Copy link
Collaborator

@Ezra-Yu Ezra-Yu Feb 13, 2023

Choose a reason for hiding this comment

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

Engineering-wise, it is indeed possible to use a function. but one of them has a topk argument and need raise different errors(pred, target). I've tried this, but it's almost like merging the two functions together directly (there are a lot of if/else statements), without reducing the amount of code. So I think it would be OK to keep them separate for the time being, as a private method, and have no qualms about rectifying them later.

@Ezra-Yu Ezra-Yu requested a review from yingfhu February 13, 2023 13:13
Copy link
Collaborator

@yingfhu yingfhu 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 841256b into open-mmlab:dev-1.x Feb 14, 2023
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