mmsegmentation/mmseg
Siddharth Ancha d1c0a3efd4
[Fix] Unfinished label conversion from `-1` to `255` in 1.x (#2516)
## 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._
2023-01-30 12:35:55 +08:00
..
apis [Fix] Fix inference api and support setting palette to SegLocalVisualizer (#2475) 2023-01-20 21:40:13 +08:00
datasets [Fix] Unfinished label conversion from `-1` to `255` in 1.x (#2516) 2023-01-30 12:35:55 +08:00
engine [Refactor] Add pyupgrade pre-commit hook (#2078) 2022-09-19 14:06:29 +08:00
evaluation [Doc] Add evaluation doc (#2077) 2022-10-13 14:55:04 +08:00
models [Fix] Remove dependcy mmdet when do not use `MaskFormerHead` and `MMDET_Mask2FormerHead` (#2448) 2022-12-31 01:02:58 +08:00
registry [Fix] Fix repo based on refactoring standard (#1869) 2022-08-19 20:50:02 +08:00
structures [Doc] Add Data Structures and Elements (#2070) 2022-10-28 22:22:44 +08:00
utils [Feature] Add `gt_edge_map` field. (#2466) 2023-01-11 11:51:29 +08:00
visualization [Fix] Fix inference api and support setting palette to SegLocalVisualizer (#2475) 2023-01-20 21:40:13 +08:00
__init__.py add docstring 2022-11-24 16:22:07 +08:00
version.py Bump 1.0.0rc3 (#2446) 2022-12-31 18:15:56 +08:00