class_docstr: Load multiple types of panoptic annotations.
  
  The annotation format is as the following:
  
  .. code-block:: python
  
      {
          'instances':
          [
              {
              # List of 4 numbers representing the bounding box of the
              # instance, in (x1, y1, x2, y2) order.
              'bbox': [x1, y1, x2, y2],
  
              # Label of image classification.
              'bbox_label': 1,
              },
              ...
          ]
          'segments_info':
          [
              {
              # id = cls_id + instance_id * INSTANCE_OFFSET
              'id': int,
  
              # Contiguous category id defined in dataset.
              'category': int
  
              # Thing flag.
              'is_thing': bool
              },
              ...
          ]
  
          # Filename of semantic or panoptic segmentation ground truth file.
          'seg_map_path': 'a/b/c'
      }
  
  After this module, the annotation has been changed to the format below:
  
  .. code-block:: python
  
      {
          # In (x1, y1, x2, y2) order, float type. N is the number of bboxes
          # in an image
          'gt_bboxes': BaseBoxes(N, 4)
           # In int type.
          'gt_bboxes_labels': np.ndarray(N, )
           # In built-in class
          'gt_masks': PolygonMasks (H, W) or BitmapMasks (H, W)
           # In uint8 type.
          'gt_seg_map': np.ndarray (H, W)
           # in (x, y, v) order, float type.
      }
  
  Required Keys:
  
  - height
  - width
  - instances
    - bbox
    - bbox_label
    - ignore_flag
  - segments_info
    - id
    - category
    - is_thing
  - seg_map_path
  
  Added Keys:
  
  - gt_bboxes (BaseBoxes[torch.float32])
  - gt_bboxes_labels (np.int64)
  - gt_masks (BitmapMasks | PolygonMasks)
  - gt_seg_map (np.uint8)
  - gt_ignore_flags (bool)
  
  Args:
      with_bbox (bool): Whether to parse and load the bbox annotation.
          Defaults to True.
      with_label (bool): Whether to parse and load the label annotation.
          Defaults to True.
      with_mask (bool): Whether to parse and load the mask annotation.
           Defaults to True.
      with_seg (bool): Whether to parse and load the semantic segmentation
          annotation. Defaults to False.
      box_type (str): The box mode used to wrap the bboxes.
      imdecode_backend (str): The image decoding backend type. The backend
          argument for :func:``mmcv.imfrombytes``.
          See :fun:``mmcv.imfrombytes`` for details.
          Defaults to 'cv2'.
      backend_args (dict, optional): Arguments to instantiate the
          corresponding backend in mmdet >= 3.0.0rc7. Defaults to None.
class_docstr_tok: ["Load","multiple","types","of","panoptic","annotations",".","The","annotation","format","is","as","the","following",":","..","code-block",":",":","python","{","'instances","'",":","[","{","#","List","of","4","numbers","representing","the","bounding","box","of","the","#","instance",",","in","(","x1",",","y1",",","x2",",","y2",")","order",".","'bbox","'",":","[","x1",",","y1",",","x2",",","y2","]",",","#","Label","of","image","classification",".","'bbox_label","'",":","1",",","}",",","...","]","'segments_info","'",":","[","{","#","id","=","cls_id","+","instance_id","*","INSTANCE_OFFSET","'id","'",":","int",",","#","Contiguous","category","id","defined","in","dataset",".","'category","'",":","int","#","Thing","flag",".","'is_thing","'",":","bool","}",",","...","]","#","Filename","of","semantic","or","panoptic","segmentation","ground","truth","file",".","'seg_map_path","'",":","'","a\/b\/c'","}","After","this","module",",","the","annotation","has","been","changed","to","the","format","below",":","..","code-block",":",":","python","{","#","In","(","x1",",","y1",",","x2",",","y2",")","order",",","float","type",".","N","is","the","number","of","bboxes","#","in","an","image","'gt_bboxes","'",":","BaseBoxes","(","N",",","4",")","#","In","int","type",".","'gt_bboxes_labels","'",":","np.ndarray","(","N",",",")","#","In","built-in","class","'gt_masks","'",":","PolygonMasks","(","H",",","W",")","or","BitmapMasks","(","H",",","W",")","#","In","uint8","type",".","'gt_seg_map","'",":","np.ndarray","(","H",",","W",")","#","in","(","x",",","y",",","v",")","order",",","float","type.","}","Required","Keys",":","-","height","-","width","-","instances","-","bbox","-","bbox_label","-","ignore_flag","-","segments_info","-","id","-","category","-","is_thing","-","seg_map_path","Added","Keys",":","-","gt_bboxes","(","BaseBoxes","[","torch.float32","]",")","-","gt_bboxes_labels","(","np.int64",")","-","gt_masks","(","BitmapMasks","|","PolygonMasks",")","-","gt_seg_map","(","np.uint8",")","-","gt_ignore_flags","(","bool",")","Args",":","with_bbox","(","bool",")",":","Whether","to","parse","and","load","the","bbox","annotation",".","Defaults","to","True",".","with_label","(","bool",")",":","Whether","to","parse","and","load","the","label","annotation",".","Defaults","to","True",".","with_mask","(","bool",")",":","Whether","to","parse","and","load","the","mask","annotation",".","Defaults","to","True",".","with_seg","(","bool",")",":","Whether","to","parse","and","load","the","semantic","segmentation","annotation",".","Defaults","to","False",".","box_type","(","str",")",":","The","box","mode","used","to","wrap","the","bboxes",".","imdecode_backend","(","str",")",":","The","image","decoding","backend","type",".","The","backend","argument","for",":","func",":","``","mmcv.imfrombytes","``",".","See",":","fun",":","``","mmcv.imfrombytes","``","for","details",".","Defaults","to","'cv2","'",".","backend_args","(","dict",",","optional",")",":","Arguments","to","instantiate","the","corresponding","backend","in","mmdet",">","=","3.0.0rc7",".","Defaults","to","None","."]
docstr: Function to load multiple types panoptic annotations.
  
  Args:
      results (dict): Result dict from :obj:``mmdet.CustomDataset``.
  
  Returns:
      dict: The dict contains loaded bounding box, label, mask and
          semantic segmentation annotations.
docstr_tok: ["Function","to","load","multiple","types","panoptic","annotations",".","Args",":","results","(","dict",")",":","Result","dict","from",":","obj",":","``","mmdet.CustomDataset","``",".","Returns",":","dict",":","The","dict","contains","loaded","bounding","box",",","label",",","mask","and","semantic","segmentation","annotations","."]
code: def transform(self, results: dict) -> dict:
      """Function to load multiple types panoptic annotations.
  
      Args:
          results (dict): Result dict from :obj:``mmdet.CustomDataset``.
  
      Returns:
          dict: The dict contains loaded bounding box, label, mask and
              semantic segmentation annotations.
      """
  
      if self.with_bbox:
          self._load_bboxes(results)
      if self.with_label:
          self._load_labels(results)
      if self.with_mask or self.with_seg:
          # The tasks completed by '_load_masks' and '_load_semantic_segs'
          # in LoadAnnotations are merged to one function.
          self._load_masks_and_semantic_segs(results)
  
      return results
  
imports: from typing import Optional, Tuple, Union
  import mmcv
  import numpy
  import pycocotools.mask
  import torch
  from mmcv.transforms import BaseTransform
  from mmcv.transforms import LoadAnnotations
  from mmcv.transforms import LoadImageFromFile
  from mmengine.fileio import get
  from mmengine.structures import BaseDataElement
  from mmdet.registry import TRANSFORMS
  from mmdet.structures.bbox import get_box_type
  from mmdet.structures.bbox.box_type import autocast_box_type
  from mmdet.structures.mask import BitmapMasks, PolygonMasks
label_desc: Use image node_id 3 for calling the LoadPanopticAnnotations obj's underlying member method code with example usage: obj.transform(results) and returns: results