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 mask generation in base_loader when reading an image #135

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rod409
Copy link

@rod409 rod409 commented Mar 23, 2021

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.

mask = mask.copy()
for k, v in self.id_to_trainid.items():
binary_mask = (mask == k) #+ (gtCoarse == k)
mask_copy = mask.copy()
if id2trainid:
for k, v in id2trainid.items():
binary_mask = (mask_copy == k)

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.

1 participant