class_docstr: Cityscapes Dataloader
code: def __init__(
      self,
      root=os.path.expanduser("~/.mxnet/datasets/citys"),
      split="train",
      mode=None,
      transform=None,
      **kwargs,
  ):
      super(CitySegmentation, self).__init__(
          root, split, mode, transform, **kwargs
      )
      # self.root = os.path.join(root, self.BASE_DIR)
      self.images, self.mask_paths = _get_city_pairs(
          self.root, self.split
      )
      assert len(self.images) == len(self.mask_paths)
      if len(self.images) == 0:
          raise RuntimeError(
              "Found 0 images in subfolders of: \
                  "
              + self.root
              + "\n"
          )
      self.valid_classes = [
          7,
          8,
          11,
          12,
          13,
          17,
          19,
          20,
          21,
          22,
          23,
          24,
          25,
          26,
          27,
          28,
          31,
          32,
          33,
      ]
      self._key = np.array(
          [
              -1,
              -1,
              -1,
              -1,
              -1,
              -1,
              -1,
              -1,
              0,
              1,
              -1,
              -1,
              2,
              3,
              4,
              -1,
              -1,
              -1,
              5,
              -1,
              6,
              7,
              8,
              9,
              10,
              11,
              12,
              13,
              14,
              15,
              -1,
              -1,
              16,
              17,
              18,
          ]
      )
      self._mapping = np.array(range(-1, len(self._key) - 1)).astype(
          "int32"
      )
  
file_path: gluon-cv/gluoncv/data/cityscapes.py
imports: import os
  import numpy
  from PIL import Image
  import mxnet
  from .segbase import SegmentationDataset
label_desc: Use image node_id 1 to create a new CitySegmentation object from inherited base classes: SegmentationDataset with example: obj = CitySegmentation(root, split, mode, transform)