-
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 BaseSegDataset in 1.x #2332
[Fix] Fix ignore class id from -1 to 255 in BaseSegDataset in 1.x #2332
Conversation
Codecov ReportBase: 83.65% // Head: 83.66% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## dev-1.x #2332 +/- ##
===========================================
+ Coverage 83.65% 83.66% +0.01%
===========================================
Files 141 141
Lines 7973 7973
Branches 1193 1193
===========================================
+ Hits 6670 6671 +1
+ Misses 1115 1113 -2
- Partials 188 189 +1
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 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 - [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. Unit tests that are affected were modified. - [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 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._
…t_ignoreid [Fix] Fix ignore class id from -1 to 255 in BaseSegDataset in 1.x
…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._
No description provided.