class_docstr: Filter invalid annotations.
  
  Required Keys:
  
  - gt_bboxes (BaseBoxes[torch.float32]) (optional)
  - gt_bboxes_labels (np.int64) (optional)
  - gt_masks (BitmapMasks | PolygonMasks) (optional)
  - gt_ignore_flags (bool) (optional)
  
  Modified Keys:
  
  - gt_bboxes (optional)
  - gt_bboxes_labels (optional)
  - gt_masks (optional)
  - gt_ignore_flags (optional)
  
  Args:
      min_gt_bbox_wh (tuple[float]): Minimum width and height of ground truth
          boxes. Default: (1., 1.)
      min_gt_mask_area (int): Minimum foreground area of ground truth masks.
          Default: 1
      by_box (bool): Filter instances with bounding boxes not meeting the
          min_gt_bbox_wh threshold. Default: True
      by_mask (bool): Filter instances with masks not meeting
          min_gt_mask_area threshold. Default: False
      keep_empty (bool): Whether to return None when it
          becomes an empty bbox after filtering. Defaults to True.
class_docstr_tok: ["Filter","invalid","annotations",".","Required","Keys",":","-","gt_bboxes","(","BaseBoxes","[","torch.float32","]",")","(","optional",")","-","gt_bboxes_labels","(","np.int64",")","(","optional",")","-","gt_masks","(","BitmapMasks","|","PolygonMasks",")","(","optional",")","-","gt_ignore_flags","(","bool",")","(","optional",")","Modified","Keys",":","-","gt_bboxes","(","optional",")","-","gt_bboxes_labels","(","optional",")","-","gt_masks","(","optional",")","-","gt_ignore_flags","(","optional",")","Args",":","min_gt_bbox_wh","(","tuple","[","float","]",")",":","Minimum","width","and","height","of","ground","truth","boxes",".","Default",":","(","1.",",","1",".",")","min_gt_mask_area","(","int",")",":","Minimum","foreground","area","of","ground","truth","masks",".","Default",":","1","by_box","(","bool",")",":","Filter","instances","with","bounding","boxes","not","meeting","the","min_gt_bbox_wh","threshold",".","Default",":","True","by_mask","(","bool",")",":","Filter","instances","with","masks","not","meeting","min_gt_mask_area","threshold",".","Default",":","False","keep_empty","(","bool",")",":","Whether","to","return","None","when","it","becomes","an","empty","bbox","after","filtering",".","Defaults","to","True","."]
code: def __repr__(self):
      return (
          self.__class__.__name__
          + f"(min_gt_bbox_wh={self.min_gt_bbox_wh}, "
          f"keep_empty={self.keep_empty})"
      )
  
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 FilterAnnotations obj's underlying member method code with example usage: obj.__repr__() and returns: unknown