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

fix bug about label_map #1445

Merged
merged 3 commits into from
Apr 9, 2022
Merged

fix bug about label_map #1445

merged 3 commits into from
Apr 9, 2022

Conversation

Yzichen
Copy link
Contributor

@Yzichen Yzichen commented Apr 3, 2022

Motivation

When I use label_map to change train_label, I found that when the label map is complex, the current code is likely to repeatedly replace gt_semantic_seg.
For example, when my label_map is dict{6:9, 9:7}, the intention is to replace 6 with 9 and 9 with 7, but the result does replace 6 with 7.

Modification

Record the initial gt_semantic_seg with a copy!

@CLAassistant
Copy link

CLAassistant commented Apr 3, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@MeowZheng MeowZheng left a comment

Choose a reason for hiding this comment

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

Many thanks for your contribution. There is indeed such a problem that you described.

@codecov
Copy link

codecov bot commented Apr 3, 2022

Codecov Report

Merging #1445 (7357edf) into master (be8f073) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1445      +/-   ##
==========================================
- Coverage   90.34%   90.31%   -0.04%     
==========================================
  Files         139      139              
  Lines        8300     8304       +4     
  Branches     1393     1395       +2     
==========================================
+ Hits         7499     7500       +1     
- Misses        564      567       +3     
  Partials      237      237              
Flag Coverage Δ
unittests 90.31% <100.00%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
mmseg/datasets/pipelines/loading.py 98.55% <100.00%> (+0.02%) ⬆️
mmseg/apis/train.py 20.51% <0.00%> (-0.83%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update be8f073...7357edf. Read the comment docs.

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
@MeowZheng
Copy link
Collaborator

might fix lint problem

@MeowZheng MeowZheng merged commit 2848885 into open-mmlab:master Apr 9, 2022
@lygsbw
Copy link

lygsbw commented Apr 10, 2022

Many thanks for your contribution. There is indeed such a problem that you described.

There is the same bug in core/evaluation/metrics.py when calculating IoU.

mob5566 pushed a commit to mob5566/mmsegmentation that referenced this pull request Apr 13, 2022
* fix bug about label_map

* Update mmseg/datasets/pipelines/loading.py

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>

* lint

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
Co-authored-by: MeowZheng <meowzheng@outlook.com>
ZhimingNJ pushed a commit to AetrexTechnology/mmsegmentation that referenced this pull request Jun 29, 2022
* fix bug about label_map

* Update mmseg/datasets/pipelines/loading.py

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>

* lint

Co-authored-by: MengzhangLI <mcmong@pku.edu.cn>
Co-authored-by: MeowZheng <meowzheng@outlook.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.

6 participants