-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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] Fix ignore class id from -1 to 255 in master
#2515
[Fix] Fix ignore class id from -1 to 255 in master
#2515
Conversation
Codecov ReportBase: 88.33% // Head: 88.33% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #2515 +/- ##
=======================================
Coverage 88.33% 88.33%
=======================================
Files 147 147
Lines 8844 8844
Branches 1490 1490
=======================================
Hits 7812 7812
Misses 790 790
Partials 242 242
Flags with carried forward coverage won't be shown. Click here to find out 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. |
## Motivation This is motivated by a previously unfinished PR (#2332). In that PR, the label -1 was changed to 255 in `BaseSegDataset`, which is correct. However, it was changed at only one location. There is another location in `mmseg/datasets/basesegdataset.py` where -1 was still being used that was not converted to 255. I have now converted it to 255. This is exactly same as a similar fix to the `master` branch via #2515 . ## Modification I've simply converted the snipped ```python if new_id != -1: new_palette.append(palette[old_id]) ``` to ```python if new_id != 255: new_palette.append(palette[old_id]) ``` ## Checklist - [x] Pre-commit or other linting tools are used to fix the potential lint issues. - _I've fixed all linting/pre-commit errors._ - [x] The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness. - _No unit tests need to be added or were affected. - [x] If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMDet3D. - _I don't think this change affects MMDet or MMDet3D._ - [x] The documentation has been modified accordingly, like docstring or example tutorials. - _This change fixes an existing bug and doesn't require modifying any documentation/docstring._
* [From pretrained] Speed-up loading from cache * up * Fix more * fix one more bug * make style * bigger refactor * factor out function * Improve more * better * deprecate return cache folder * clean up * improve tests * up * upload * add nice tests * simplify * finish * correct * fix version * rename * Apply suggestions from code review Co-authored-by: Lucain <lucainp@gmail.com> * rename * correct doc string * correct more * Apply suggestions from code review Co-authored-by: Pedro Cuenca <pedro@huggingface.co> * apply code suggestions * finish --------- Co-authored-by: Lucain <lucainp@gmail.com> Co-authored-by: Pedro Cuenca <pedro@huggingface.co>
…ab#2516) ## Motivation This is motivated by a previously unfinished PR (open-mmlab#2332). In that PR, the label -1 was changed to 255 in `BaseSegDataset`, which is correct. However, it was changed at only one location. There is another location in `mmseg/datasets/basesegdataset.py` where -1 was still being used that was not converted to 255. I have now converted it to 255. This is exactly same as a similar fix to the `master` branch via open-mmlab#2515 . ## Modification I've simply converted the snipped ```python if new_id != -1: new_palette.append(palette[old_id]) ``` to ```python if new_id != 255: new_palette.append(palette[old_id]) ``` ## Checklist - [x] Pre-commit or other linting tools are used to fix the potential lint issues. - _I've fixed all linting/pre-commit errors._ - [x] The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness. - _No unit tests need to be added or were affected. - [x] If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMDet3D. - _I don't think this change affects MMDet or MMDet3D._ - [x] The documentation has been modified accordingly, like docstring or example tutorials. - _This change fixes an existing bug and doesn't require modifying any documentation/docstring._
Motivation
This fixes #2493. When the
label_map
is created, the index for ignored classes was being set to -1, whereas the index that is actually ignored is 255. This worked indirectly since -1 was underflowed to 255 when converting to uint8.The same fix was made in the 1.x by #2332 but this fix was never made to
master
.Modification
The only small modification is setting the index of ignored classes to 255 instead of -1.
Checklist