class_docstr: Generates panoptic training target for Panoptic-DeepLab.
  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.
      thing_list (list): A list of thing classes
      sigma (int, optional): The sigma for Gaussian kernel. Default: 8.
      ignore_stuff_in_offset (bool, optional): Whether to ignore stuff region when training the offset branch. Default: False.
      small_instance_area (int, optional): Indicates largest area for small instances. Default: 0.
      small_instance_weight (int, optional): Indicates semantic loss weights for small instances. Default: 1.
      ignore_crowd_in_semantic (bool, optional): Whether to ignore crowd region in semantic segmentation branch,
          crowd region is ignored in the original TensorFlow implementation. Default: False.
class_docstr_tok: ["Generates","panoptic","training","target","for","Panoptic-DeepLab",".","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",".","thing_list","(","list",")",":","A","list","of","thing","classes","sigma","(","int",",","optional",")",":","The","sigma","for","Gaussian","kernel",".","Default",":","8.","ignore_stuff_in_offset","(","bool",",","optional",")",":","Whether","to","ignore","stuff","region","when","training","the","offset","branch",".","Default",":","False",".","small_instance_area","(","int",",","optional",")",":","Indicates","largest","area","for","small","instances",".","Default",":","0.","small_instance_weight","(","int",",","optional",")",":","Indicates","semantic","loss","weights","for","small","instances",".","Default",":","1.","ignore_crowd_in_semantic","(","bool",",","optional",")",":","Whether","to","ignore","crowd","region","in","semantic","segmentation","branch",",","crowd","region","is","ignored","in","the","original","TensorFlow","implementation",".","Default",":","False","."]
code: def __init__(
      self,
      ignore_index,
      rgb2id,
      thing_list,
      sigma=8,
      ignore_stuff_in_offset=False,
      small_instance_area=0,
      small_instance_weight=1,
      ignore_crowd_in_semantic=False,
  ):
      self.ignore_index = ignore_index
      self.rgb2id = rgb2id
      self.thing_list = thing_list
      self.ignore_stuff_in_offset = ignore_stuff_in_offset
      self.small_instance_area = small_instance_area
      self.small_instance_weight = small_instance_weight
      self.ignore_crowd_in_semantic = ignore_crowd_in_semantic
  
      self.sigma = sigma
      size = 6 * sigma + 3
      x = np.arange(0, size, 1, float)
      y = x[:, np.newaxis]
      x0, y0 = 3 * sigma + 1, 3 * sigma + 1
      self.g = np.exp(
          -((x - x0) ** 2 + (y - y0) ** 2) / (2 * sigma**2)
      )
  
file_path: PaddleSeg/contrib/PanopticDeepLab/transforms/target_transforms.py
imports: import numpy
label_desc: Use image node_id 1 to create a new PanopticTargetGenerator object from inherited base classes: object with example: obj = PanopticTargetGenerator(ignore_index, rgb2id, thing_list, sigma, ignore_stuff_in_offset, small_instance_area, small_instance_weight, ignore_crowd_in_semantic)