Skip to content

Commit

Permalink
[Bug fix] Fixed ADE20k test
Browse files Browse the repository at this point in the history
  • Loading branch information
xvjiarui committed Jan 23, 2021
1 parent faaf29e commit 5712170
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions mmseg/core/evaluation/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def intersect_and_union(pred_label,

if isinstance(label, str):
label = mmcv.imread(label, flag='unchanged', backend='pillow')
# modify if custom classes
if label_map is not None:
for old_id, new_id in label_map.items():
label[label == old_id] = new_id
if reduce_zero_label:
# avoid using underflow conversion
label[label == 0] = 255
label = label - 1
label[label == 254] = 255
# modify if custom classes
if label_map is not None:
for old_id, new_id in label_map.items():
label[label == old_id] = new_id
if reduce_zero_label:
# avoid using underflow conversion
label[label == 0] = 255
label = label - 1
label[label == 254] = 255

mask = (label != ignore_index)
pred_label = pred_label[mask]
Expand Down

0 comments on commit 5712170

Please sign in to comment.