pull/2114/head
Sungchul Kim 2022-09-15 16:16:46 +09:00 committed by GitHub
parent 31395a83bd
commit ee25adc2c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -64,8 +64,9 @@ def intersect_and_union(pred_label,
label = torch.from_numpy(label) label = torch.from_numpy(label)
if label_map is not None: if label_map is not None:
label_copy = label.clone()
for old_id, new_id in label_map.items(): for old_id, new_id in label_map.items():
label[label == old_id] = new_id label[label_copy == old_id] = new_id
if reduce_zero_label: if reduce_zero_label:
label[label == 0] = 255 label[label == 0] = 255
label = label - 1 label = label - 1