NVIDIA / semantic-segmentation

Nvidia Semantic Segmentation monorepo
BSD 3-Clause "New" or "Revised" License
1.76k stars 388 forks source link

Fix mask generation in base_loader when reading an image #135

Open rod409 opened 3 years ago

rod409 commented 3 years ago

This pull request proposes a bug fix. In base_loader.py, the read_images function generates a mask without checking keys in an original copy. This causes problems on some datasets where mask values are incorrectly replaced. The change would make the mask generation in the base_loader.py match the method used in uniform.py. https://github.com/NVIDIA/semantic-segmentation/blob/7726b144c2cc0b8e09c67eabb78f027efdf3f0fa/datasets/base_loader.py#L176-L178 https://github.com/NVIDIA/semantic-segmentation/blob/7726b144c2cc0b8e09c67eabb78f027efdf3f0fa/datasets/uniform.py#L112-L115