class_docstr: Multi-Human-Parsing V1 Dataset.
  Parameters
  ----------
  root : string
      Path to MHPV1 folder. Default is '$(HOME)/.mxnet/datasets/mhp/LV-MHP-v1'
  split: string
      'train', 'val' or 'test'
  transform : callable, optional
      A function that transforms the image
  Examples
  --------
  >>> from mxnet.gluon.data.vision import transforms
  >>> # Transforms for Normalization
  >>> input_transform = transforms.Compose([
  >>>     transforms.ToTensor(),
  >>>     transforms.Normalize([.485, .456, .406], [.229, .224, .225]),
  >>> ])
  >>> # Create Dataset
  >>> trainset = gluoncv.data.MHPV1Segmentation(split='train', transform=input_transform)
  >>> # Create Training Loader
  >>> train_data = gluon.data.DataLoader(
  >>>     trainset, 4, shuffle=True, last_batch='rollover',
  >>>     num_workers=4)
code: def __getitem__(self, index):
      img = Image.open(self.images[index]).convert("RGB")
  
      # nan check
      img_np = np.array(img, dtype=np.uint8)
      assert not np.isnan(np.sum(img_np))
  
      if self.mode == "test":
          img = self._img_transform(img)
          if self.transform is not None:
              img = self.transform(img)
          return img, os.path.basename(self.images[index])
  
      mask = _get_mask(self.masks[index])
  
      # Here, we resize input image resolution to the multiples of 8
      # for avoiding resolution misalignment during downsampling and upsampling
      w, h = img.size
      if h < w:
          oh = self.base_size
          ow = int(1.0 * w * oh / h + 0.5)
          if ow % 8:
              ow = int(round(ow / 8) * 8)
      else:
          ow = self.base_size
          oh = int(1.0 * h * ow / w + 0.5)
          if oh % 8:
              oh = int(round(oh / 8) * 8)
  
      img = img.resize((ow, oh), Image.BILINEAR)
      mask = mask.resize((ow, oh), Image.NEAREST)
  
      # synchrosized transform
      if self.mode == "train":
          img, mask = self._sync_transform(img, mask)
      elif self.mode == "val":
          img, mask = self._val_sync_transform(img, mask)
      else:
          assert self.mode == "testval"
          img, mask = self._img_transform(img), self._mask_transform(
              mask
          )
  
      # general resize, normalize and toTensor
      if self.transform is not None:
          img = self.transform(img)
  
      return img, mask
  
file_path: gluon-cv/gluoncv/data/mhp.py
imports: import os
  import numpy
  from PIL import Image
  from PIL import ImageFile
  import mxnet
  from .segbase import SegmentationDataset
label_desc: Use image node_id 2 for calling the MHPV1Segmentation obj's underlying member method code with example usage: obj.__getitem__(index) and returns: img,  mask, img,  os