Skip to content

Commit

Permalink
[Bug fix] Fixed ADE20k test (#359)
Browse files Browse the repository at this point in the history
* [Bug fix] Fixed ADE20k test

* fixed ade cfg
  • Loading branch information
xvjiarui authored Jan 24, 2021
1 parent faaf29e commit 6879b0d
Show file tree
Hide file tree
Showing 17 changed files with 9 additions and 25 deletions.
1 change: 0 additions & 1 deletion configs/apcnet/apcnet_r50-d8_512x512_160k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/apcnet/apcnet_r50-d8_512x512_80k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/deeplabv3/deeplabv3_r50-d8_512x512_160k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/deeplabv3/deeplabv3_r50-d8_512x512_80k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/dmnet/dmnet_r50-d8_512x512_160k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/dmnet/dmnet_r50-d8_512x512_80k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/fcn/fcn_r50-d8_512x512_160k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/fcn/fcn_r50-d8_512x512_80k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/psanet/psanet_r50-d8_512x512_160k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
model = dict(
decode_head=dict(mask_size=(66, 66), num_classes=150),
auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/psanet/psanet_r50-d8_512x512_80k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
model = dict(
decode_head=dict(mask_size=(66, 66), num_classes=150),
auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/pspnet/pspnet_r50-d8_512x512_160k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/pspnet/pspnet_r50-d8_512x512_80k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/upernet/upernet_r50_512x512_160k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
1 change: 0 additions & 1 deletion configs/upernet/upernet_r50_512x512_80k_ade20k.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
]
model = dict(
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
test_cfg = dict(mode='whole')
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 6879b0d

Please sign in to comment.