Merge pull request #2332 from MengzhangLI/fix_basesegdataset_ignoreid

[Fix] Fix ignore class id from -1 to 255 in BaseSegDataset in 1.x
This commit is contained in:
Miao Zheng 2022-11-22 10:49:02 +08:00 committed by GitHub
commit 6d7af0707d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,7 @@ class BaseSegDataset(BaseDataset):
f'subset of classes {old_classes} in METAINFO.')
for i, c in enumerate(old_classes):
if c not in new_classes:
label_map[i] = -1
label_map[i] = 255
else:
label_map[i] = new_classes.index(c)
return label_map