Skip to content

Commit

Permalink
icnet missing background class (#1518)
Browse files Browse the repository at this point in the history
  • Loading branch information
KuangHaofei authored Nov 12, 2020
1 parent 9f6578e commit d4f2893
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/model_zoo/csv_tables/Segmentations/SS_MHP-V1.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Name,Method,pixAcc,mIoU,Command,log
icnet_resnet50_mhpv1,ICNet [5]_,89.5,40.4,`shell script <https://raw.githubusercontent.com/dmlc/web-data/master/gluoncv/logs/segmentation/icnet_resnet50_mhpv1.sh>`_,`log <https://raw.githubusercontent.com/dmlc/web-data/master/gluoncv/logs/segmentation/icnet_resnet50_mhpv1.log>`_
icnet_resnet50_mhpv1,ICNet [5]_,90.5,44.5,`shell script <https://raw.githubusercontent.com/dmlc/web-data/master/gluoncv/logs/segmentation/icnet_resnet50_mhpv1.sh>`_,`log <https://raw.githubusercontent.com/dmlc/web-data/master/gluoncv/logs/segmentation/icnet_resnet50_mhpv1.log>`_
7 changes: 4 additions & 3 deletions gluoncv/data/mhp.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class MHPV1Segmentation(SegmentationDataset):
>>> num_workers=4)
"""
# pylint: disable=abstract-method
NUM_CLASS = 18
CLASSES = ("hat", "hair", "sunglasses", "upper clothes", "skirt",
NUM_CLASS = 19
CLASSES = ("background", "hat", "hair", "sunglasses", "upper clothes", "skirt",
"pants", "dress", "belt", "left shoe", "right shoe", "face", "left leg",
"right leg", "left arm", "right arm", "bag", "scarf", "torso skin")

Expand Down Expand Up @@ -99,7 +99,8 @@ def __getitem__(self, index):
return img, mask

def _mask_transform(self, mask):
return mx.nd.array(np.array(mask), mx.cpu(0)).astype('int32') # - 1
target = np.array(mask).astype('int32')
return mx.nd.array(target, mx.cpu(0))

def __len__(self):
return len(self.images)
Expand Down

0 comments on commit d4f2893

Please sign in to comment.