class_docstr: Generates semantic training target only for Panoptic-DeepLab (no instance).
  Annotation is assumed to have Cityscapes format.
  
  Args:
      ignore_index (int): The ignore label for semantic segmentation.
      rgb2id (function): Function, panoptic label is encoded in a colored image, this function convert color to the
          corresponding panoptic label.
class_docstr_tok: ["Generates","semantic","training","target","only","for","Panoptic-DeepLab","(","no","instance",")",".","Annotation","is","assumed","to","have","Cityscapes","format",".","Args",":","ignore_index","(","int",")",":","The","ignore","label","for","semantic","segmentation",".","rgb2id","(","function",")",":","Function",",","panoptic","label","is","encoded","in","a","colored","image",",","this","function","convert","color","to","the","corresponding","panoptic","label","."]
docstr: Generates the training target.
  reference: https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/preparation/createPanopticImgs.py
  reference: https://github.com/facebookresearch/detectron2/blob/master/datasets/prepare_panoptic_fpn.py#L18
  
  Args:
      panoptic (np.ndarray): Colored image encoding panoptic label.
      segments (list): A list of dictionary containing information of every segment, it has fields:
          - id: panoptic id, after decoding `panoptic`.
          - category_id: semantic class id.
          - area: segment area.
          - bbox: segment bounding box.
          - iscrowd: crowd region.
  
  Returns:
      A dictionary with fields:
          - semantic: Tensor, semantic label, shape=(H, W).
docstr_tok: ["Generates","the","training","target",".","reference",":","https",":","\/\/github.com\/mcordts\/cityscapesScripts\/blob\/master\/cityscapesscripts\/preparation\/createPanopticImgs.py","reference",":","https",":","\/\/github.com\/facebookresearch\/detectron2\/blob\/master\/datasets\/prepare_panoptic_fpn.py","#","L18","Args",":","panoptic","(","np.ndarray",")",":","Colored","image","encoding","panoptic","label",".","segments","(","list",")",":","A","list","of","dictionary","containing","information","of","every","segment",",","it","has","fields",":","-","id",":","panoptic","id",",","after","decoding","`","panoptic","`",".","-","category_id",":","semantic","class","id",".","-","area",":","segment","area",".","-","bbox",":","segment","bounding","box",".","-","iscrowd",":","crowd","region",".","Returns",":","A","dictionary","with","fields",":","-","semantic",":","Tensor",",","semantic","label",",","shape=","(","H",",","W",")","."]
code: def __call__(self, panoptic, segments):
      """Generates the training target.
      reference: https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/preparation/createPanopticImgs.py
      reference: https://github.com/facebookresearch/detectron2/blob/master/datasets/prepare_panoptic_fpn.py#L18
  
      Args:
          panoptic (np.ndarray): Colored image encoding panoptic label.
          segments (list): A list of dictionary containing information of every segment, it has fields:
              - id: panoptic id, after decoding `panoptic`.
              - category_id: semantic class id.
              - area: segment area.
              - bbox: segment bounding box.
              - iscrowd: crowd region.
  
      Returns:
          A dictionary with fields:
              - semantic: Tensor, semantic label, shape=(H, W).
      """
      panoptic = self.rgb2id(panoptic)
      semantic = (
          np.zeros_like(panoptic, dtype=np.uint8) + self.ignore_index
      )
      for seg in segments:
          cat_id = seg["category_id"]
          semantic[panoptic == seg["id"]] = cat_id
  
      return dict(semantic=semantic.astype("long"))
  
file_path: PaddleSeg/contrib/PanopticDeepLab/transforms/target_transforms.py
imports: import numpy
label_desc: Use image node_id 2 for calling the SemanticTargetGenerator obj's underlying member method code with example usage: obj.__call__(panoptic, segments) and returns: dict