class_docstr: Load and process the ``instances`` and ``seg_map`` annotation provided
  by dataset. It must load ``instances_ids`` which is only used in the
  tracking tasks. 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,
              # Used in tracking.
              # Id of instances.
              'instance_id': 100,
              # Used in instance/panoptic segmentation. The segmentation mask
              # of the instance or the information of segments.
              # 1. If list[list[float]], it represents a list of polygons,
              # one for each connected component of the object. Each
              # list[float] is one simple polygon in the format of
              # [x1, y1, ..., xn, yn] (n >= 3). The Xs and Ys are absolute
              # coordinates in unit of pixels.
              # 2. If dict, it represents the per-pixel segmentation mask in
              # COCO's compressed RLE format. The dict should have keys
              # “size” and “counts”.  Can be loaded by pycocotools
              'mask': list[list[float]] or dict,
              }
          ]
          # 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': np.ndarray(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 (optional)
  - width (optional)
  - instances
    - bbox (optional)
    - bbox_label
    - instance_id (optional)
    - mask (optional)
    - ignore_flag (optional)
  - seg_map_path (optional)
  
  Added Keys:
  
  - gt_bboxes (np.float32)
  - gt_bboxes_labels (np.int32)
  - gt_instances_ids (np.int32)
  - gt_masks (BitmapMasks | PolygonMasks)
  - gt_seg_map (np.uint8)
  - gt_ignore_flags (np.bool)
class_docstr_tok: ["Load","and","process","the","``","instances","``","and","``","seg_map","``","annotation","provided","by","dataset",".","It","must","load","``","instances_ids","``","which","is","only","used","in","the","tracking","tasks",".","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",",","#","Used","in","tracking",".","#","Id","of","instances",".","'instance_id","'",":","100",",","#","Used","in","instance\/panoptic","segmentation",".","The","segmentation","mask","#","of","the","instance","or","the","information","of","segments",".","#","1",".","If","list","[","list","[","float","]","]",",","it","represents","a","list","of","polygons",",","#","one","for","each","connected","component","of","the","object",".","Each","#","list","[","float","]","is","one","simple","polygon","in","the","format","of","#","[","x1",",","y1",",","...",",","xn",",","yn","]","(","n",">","=","3",")",".","The","Xs","and","Ys","are","absolute","#","coordinates","in","unit","of","pixels",".","#","2",".","If","dict",",","it","represents","the","per-pixel","segmentation","mask","in","#","COCO","'s","compressed","RLE","format",".","The","dict","should","have","keys","#","\u201c","size","\u201d","and","\u201c","counts","\u201d",".","Can","be","loaded","by","pycocotools","'mask","'",":","list","[","list","[","float","]","]","or","dict",",","}","]","#","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","'",":","np.ndarray","(","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","(","optional",")","-","width","(","optional",")","-","instances","-","bbox","(","optional",")","-","bbox_label","-","instance_id","(","optional",")","-","mask","(","optional",")","-","ignore_flag","(","optional",")","-","seg_map_path","(","optional",")","Added","Keys",":","-","gt_bboxes","(","np.float32",")","-","gt_bboxes_labels","(","np.int32",")","-","gt_instances_ids","(","np.int32",")","-","gt_masks","(","BitmapMasks","|","PolygonMasks",")","-","gt_seg_map","(","np.uint8",")","-","gt_ignore_flags","(","np.bool",")"]
code: def __init__(self, **kwargs) -> None:
      super().__init__(**kwargs)
  
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 1 to create a new LoadTrackAnnotations object from inherited base classes: LoadAnnotations with example: obj = LoadTrackAnnotations()