class_docstr: Cityscapes dataset `https://www.cityscapes-dataset.com/`.
  The folder structure is as follow:
  
      cityscapes/
      |--gtFine/
      |  |--train/
      |  |  |--aachen/
      |  |  |  |--*_color.png, *_instanceIds.png, *_labelIds.png, *_polygons.json,
      |  |  |  |--*_labelTrainIds.png
      |  |  |  |--...
      |  |--val/
      |  |--test/
      |  |--cityscapes_panoptic_train_trainId.json
      |  |--cityscapes_panoptic_train_trainId/
      |  |  |-- *_panoptic.png
      |  |--cityscapes_panoptic_val_trainId.json
      |  |--cityscapes_panoptic_val_trainId/
      |  |  |--  *_panoptic.png
      |--leftImg8bit/
      |  |--train/
      |  |--val/
      |  |--test/
  
  Args:
      transforms (list): Transforms for image.
      dataset_root (str): Cityscapes dataset directory.
      mode (str, optional): Which part of dataset to use. it is one of ('train', 'val'). Default: 'train'.
      ignore_stuff_in_offset (bool, optional): Whether to ignore stuff region when training the offset branch. Default: False.
      small_instance_area (int, optional): Instance which area less than given value is considered small. Default: 0.
      small_instance_weight (int, optional): The loss weight for small instance. Default: 1.
      stuff_area (int, optional): An Integer, remove stuff whose area is less tan stuff_area. Default: 2048.
class_docstr_tok: ["Cityscapes","dataset","`","https",":","\/\/www.cityscapes-dataset.com\/","`",".","The","folder","structure","is","as","follow",":","cityscapes\/","|","--","gtFine\/","|","|","--","train\/","|","|","|","--","aachen\/","|","|","|","|","--","*","_color.png",",","*","_instanceIds.png",",","*","_labelIds.png",",","*","_polygons.json",",","|","|","|","|","--","*","_labelTrainIds.png","|","|","|","|","--","...","|","|","--","val\/","|","|","--","test\/","|","|","--","cityscapes_panoptic_train_trainId.json","|","|","--","cityscapes_panoptic_train_trainId\/","|","|","|","--","*","_panoptic.png","|","|","--","cityscapes_panoptic_val_trainId.json","|","|","--","cityscapes_panoptic_val_trainId\/","|","|","|","--","*","_panoptic.png","|","--","leftImg8bit\/","|","|","--","train\/","|","|","--","val\/","|","|","--","test\/","Args",":","transforms","(","list",")",":","Transforms","for","image",".","dataset_root","(","str",")",":","Cityscapes","dataset","directory",".","mode","(","str",",","optional",")",":","Which","part","of","dataset","to","use",".","it","is","one","of","(","'train","'",",","'val","'",")",".","Default",":","'train","'",".","ignore_stuff_in_offset","(","bool",",","optional",")",":","Whether","to","ignore","stuff","region","when","training","the","offset","branch",".","Default",":","False",".","small_instance_area","(","int",",","optional",")",":","Instance","which","area","less","than","given","value","is","considered","small",".","Default",":","0.","small_instance_weight","(","int",",","optional",")",":","The","loss","weight","for","small","instance",".","Default",":","1.","stuff_area","(","int",",","optional",")",":","An","Integer",",","remove","stuff","whose","area","is","less","tan","stuff_area",".","Default",":","2048","."]
code: def __getitem__(self, idx):
      image_path, label_path = self.file_list[idx]
      dataset_dict = {}
      data = {"img": image_path, "label": label_path}
      data["gt_fields"] = ["label"]
      data = self.transforms(data)
      im, label = data["img"], data["label"]
      label_dict = self.target_transform(label, self.ins_list[idx])
      for key in label_dict.keys():
          dataset_dict[key] = label_dict[key]
      dataset_dict["image"] = im
      if self.mode == "val":
          raw_label = np.asarray(Image.open(label_path))
          dataset_dict[
              "raw_semantic_label"
          ] = self.raw_semantic_generator(
              raw_label, self.ins_list[idx]
          )[
              "semantic"
          ]
          dataset_dict[
              "raw_instance_label"
          ] = self.raw_instance_generator(raw_label)["instance"]
          dataset_dict[
              "raw_panoptic_label"
          ] = self.raw_panoptic_generator(
              raw_label, self.ins_list[idx]
          )[
              "panoptic"
          ]
  
      image = np.array(dataset_dict["image"])
      semantic = np.array(dataset_dict["semantic"])
      semantic_weights = np.array(dataset_dict["semantic_weights"])
      center = np.array(dataset_dict["center"])
      center_weights = np.array(dataset_dict["center_weights"])
      offset = np.array(dataset_dict["offset"])
      offset_weights = np.array(dataset_dict["offset_weights"])
      foreground = np.array(dataset_dict["foreground"])
      if self.mode == "train":
          return (
              image,
              semantic,
              semantic_weights,
              center,
              center_weights,
              offset,
              offset_weights,
              foreground,
          )
      elif self.mode == "val":
          raw_semantic_label = np.array(
              dataset_dict["raw_semantic_label"]
          )
          raw_instance_label = np.array(
              dataset_dict["raw_instance_label"]
          )
          raw_panoptic_label = np.array(
              dataset_dict["raw_panoptic_label"]
          )
          return (
              image,
              raw_semantic_label,
              raw_instance_label,
              raw_panoptic_label,
          )
      else:
          raise ValueError(
              '{} is not surpported, please set it one of ("train", "val")'.format(
                  self.mode
              )
          )
  
file_path: PaddleSeg/contrib/PanopticDeepLab/datasets/cityscapes_panoptic.py
imports: import json
  import os
  import glob
  import numpy
  import paddle
  from paddleseg.cvlibs import manager
  from paddleseg.transforms import Compose
  import PIL.Image
  from transforms import PanopticTargetGenerator, SemanticTargetGenerator, InstanceTargetGenerator, RawPanopticTargetGenerator
label_desc: Use image node_id 3 for calling the CityscapesPanoptic obj's underlying member method code with example usage: obj.__getitem__(idx) and returns: image,  semantic,  semantic_weights,  center,  center_weights,  offset,  offset_weights,  foreground, image,  raw_semantic_label,  raw_instance_label,  raw_panoptic_label