class_docstr: Semantic segmentation dataset for `Cityscapes dataset`_.
  
  .. _`Cityscapes dataset`: https://www.cityscapes-dataset.com
  
  .. note::
  
      Please manually download the data because it is not allowed to
      re-distribute Cityscapes dataset.
  
  Args:
      data_dir (string): Path to the dataset directory. The directory should
          contain at least two directories, :obj:`leftImg8bit` and either
          :obj:`gtFine` or :obj:`gtCoarse`. If :obj:`auto` is given, it uses
          :obj:`$CHAINER_DATSET_ROOT/pfnet/chainercv/cityscapes` by default.
      label_resolution ({'fine', 'coarse'}): The resolution of the labels. It
          should be either :obj:`fine` or :obj:`coarse`.
      split ({'train', 'val'}): Select from dataset splits used in
          Cityscapes dataset.
      ignore_labels (bool): If :obj:`True`, the labels marked
          :obj:`ignoreInEval` defined in the original `cityscapesScripts`_
          will be replaced with :obj:`-1` in the :meth:`get_example` method.
          The default value is :obj:`True`.
  
  .. _`cityscapesScripts`: https://github.com/mcordts/cityscapesScripts
  
  This dataset returns the following data.
  
  .. csv-table::
      :header: name, shape, dtype, format
  
      :obj:`img`, ":math:`(3, H, W)`", :obj:`float32`,         "RGB, :math:`[0, 255]`"
      :obj:`label`, ":math:`(H, W)`", :obj:`int32`,         ":math:`[-1, \#class - 1]`"
class_docstr_tok: ["Semantic","segmentation","dataset","for","`","Cityscapes","dataset","`","_",".","..","_","`","Cityscapes","dataset","`",":","https",":","\/\/www.cityscapes-dataset.com","..","note",":",":","Please","manually","download","the","data","because","it","is","not","allowed","to","re-distribute","Cityscapes","dataset",".","Args",":","data_dir","(","string",")",":","Path","to","the","dataset","directory",".","The","directory","should","contain","at","least","two","directories",",",":","obj",":","`","leftImg8bit","`","and","either",":","obj",":","`","gtFine","`","or",":","obj",":","`","gtCoarse","`",".","If",":","obj",":","`","auto","`","is","given",",","it","uses",":","obj",":","`","$","CHAINER_DATSET_ROOT\/pfnet\/chainercv\/cityscapes","`","by","default",".","label_resolution","(","{","'fine","'",",","'coarse","'","}",")",":","The","resolution","of","the","labels",".","It","should","be","either",":","obj",":","`","fine","`","or",":","obj",":","`","coarse","`",".","split","(","{","'train","'",",","'val","'","}",")",":","Select","from","dataset","splits","used","in","Cityscapes","dataset",".","ignore_labels","(","bool",")",":","If",":","obj",":","`","True","`",",","the","labels","marked",":","obj",":","`","ignoreInEval","`","defined","in","the","original","`","cityscapesScripts","`","_","will","be","replaced","with",":","obj",":","`","-1","`","in","the",":","meth",":","`","get_example","`","method",".","The","default","value","is",":","obj",":","`","True","`",".","..","_","`","cityscapesScripts","`",":","https",":","\/\/github.com\/mcordts\/cityscapesScripts","This","dataset","returns","the","following","data",".","..","csv-table",":",":",":","header",":","name",",","shape",",","dtype",",","format",":","obj",":","`","img","`",",","``",":","math",":","`","(","3",",","H",",","W",")","`","``",",",":","obj",":","`","float32","`",",","``","RGB",",",":","math",":","`","[","0",",","255","]","`","``",":","obj",":","`","label","`",",","``",":","math",":","`","(","H",",","W",")","`","``",",",":","obj",":","`","int32","`",",","``",":","math",":","`","[","-1",",","\\","#","class","-","1","]","`","``"]
code: def _get_label(self, i):
      label_orig = read_label(self.label_paths[i], dtype=np.int32)
      if self.ignore_labels:
          label_out = np.ones(label_orig.shape, dtype=np.int32) * -1
          for label in cityscapes_labels:
              if not label.ignoreInEval:
                  label_out[label_orig == label.id] = label.trainId
      else:
          label_out = label_orig
      return label_out
  
file_path: chainercv/chainercv/datasets/cityscapes/cityscapes_semantic_segmentation_dataset.py
imports: import glob
  import os
  import numpy
  from chainer.dataset import download
  from chainercv.chainer_experimental.datasets.sliceable import GetterDataset
  from chainercv.datasets.cityscapes.cityscapes_utils import cityscapes_labels
  from chainercv.utils import read_image
  from chainercv.utils import read_label
label_desc: Use image node_id 4 for calling the CityscapesSemanticSegmentationDataset obj's underlying member method code with example usage: obj._get_label(i) and returns: label_out