class_docstr: Generates training targets for Panoptic-DeepLab.
class_docstr_tok: ["Generates","training","targets","for","Panoptic-DeepLab","."]
docstr: Args:
      ignore_label: Integer, the ignore label for semantic segmentation.
      thing_ids: Set, a set of ids from contiguous category ids belonging
          to thing categories.
      sigma: the sigma for Gaussian kernel.
      ignore_stuff_in_offset: Boolean, whether to ignore stuff region when
          training the offset branch.
      small_instance_area: Integer, indicates largest area for small instances.
      small_instance_weight: Integer, indicates semantic loss weights for
          small instances.
      ignore_crowd_in_semantic: Boolean, whether to ignore crowd region in
          semantic segmentation branch, crowd region is ignored in the original
          TensorFlow implementation.
docstr_tok: ["Args",":","ignore_label",":","Integer",",","the","ignore","label","for","semantic","segmentation",".","thing_ids",":","Set",",","a","set","of","ids","from","contiguous","category","ids","belonging","to","thing","categories",".","sigma",":","the","sigma","for","Gaussian","kernel",".","ignore_stuff_in_offset",":","Boolean",",","whether","to","ignore","stuff","region","when","training","the","offset","branch",".","small_instance_area",":","Integer",",","indicates","largest","area","for","small","instances",".","small_instance_weight",":","Integer",",","indicates","semantic","loss","weights","for","small","instances",".","ignore_crowd_in_semantic",":","Boolean",",","whether","to","ignore","crowd","region","in","semantic","segmentation","branch",",","crowd","region","is","ignored","in","the","original","TensorFlow","implementation","."]
code: def __init__(
      self,
      ignore_label,
      thing_ids,
      sigma=8,
      ignore_stuff_in_offset=False,
      small_instance_area=0,
      small_instance_weight=1,
      ignore_crowd_in_semantic=False,
  ):
      """
      Args:
          ignore_label: Integer, the ignore label for semantic segmentation.
          thing_ids: Set, a set of ids from contiguous category ids belonging
              to thing categories.
          sigma: the sigma for Gaussian kernel.
          ignore_stuff_in_offset: Boolean, whether to ignore stuff region when
              training the offset branch.
          small_instance_area: Integer, indicates largest area for small instances.
          small_instance_weight: Integer, indicates semantic loss weights for
              small instances.
          ignore_crowd_in_semantic: Boolean, whether to ignore crowd region in
              semantic segmentation branch, crowd region is ignored in the original
              TensorFlow implementation.
      """
      self.ignore_label = ignore_label
      self.thing_ids = set(thing_ids)
      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
  
      # Generate the default Gaussian image for each center
      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)
      )
  
imports: import numpy
  import torch
label_desc: Use image node_id 1 to create a new PanopticDeepLabTargetGenerator object  with example: obj = PanopticDeepLabTargetGenerator(ignore_label, thing_ids, sigma, ignore_stuff_in_offset, small_instance_area, small_instance_weight, ignore_crowd_in_semantic)