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","."]
docstr: Converts the color to panoptic label.
  Color is created by `color = [segmentId % 256, segmentId // 256, segmentId // 256 // 256]`.
  
  Args:
      color: Ndarray or a tuple, color encoded image.
  
  Returns:
      Panoptic label.
docstr_tok: ["Converts","the","color","to","panoptic","label",".","Color","is","created","by","`","color","=","[","segmentId","%","256",",","segmentId","\/\/","256",",","segmentId","\/\/","256","\/\/","256","]","`",".","Args",":","color",":","Ndarray","or","a","tuple",",","color","encoded","image",".","Returns",":","Panoptic","label","."]
code: def rgb2id(color):
      """Converts the color to panoptic label.
      Color is created by `color = [segmentId % 256, segmentId // 256, segmentId // 256 // 256]`.
  
      Args:
          color: Ndarray or a tuple, color encoded image.
  
      Returns:
          Panoptic label.
      """
      if isinstance(color, np.ndarray) and len(color.shape) == 3:
          if color.dtype == np.uint8:
              color = color.astype(np.int32)
          return (
              color[:, :, 0]
              + 256 * color[:, :, 1]
              + 256 * 256 * color[:, :, 2]
          )
      return int(color[0] + 256 * color[1] + 256 * 256 * color[2])
  
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 2 for calling the CityscapesPanoptic obj's underlying member method code with example usage: obj.rgb2id(color) and returns: int, unknown