Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue: missing background class #1518

Merged
merged 1 commit into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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