class_docstr: Remove degenerate/invalid bounding boxes and their corresponding labels and masks.
  
  This transform removes bounding boxes and their associated labels/masks that:
  
  - are below a given ``min_size``: by default this also removes degenerate boxes that have e.g. X2 <= X1.
  - have any coordinate outside of their corresponding image. You may want to
    call :class:`~torchvision.transforms.v2.ClampBoundingBoxes` first to avoid undesired removals.
  
  It is recommended to call it at the end of a pipeline, before passing the
  input to the models. It is critical to call this transform if
  :class:`~torchvision.transforms.v2.RandomIoUCrop` was called.
  If you want to be extra careful, you may call it after all transforms that
  may modify bounding boxes but once at the end should be enough in most
  cases.
  
  Args:
      min_size (float, optional) The size below which bounding boxes are removed. Default is 1.
      labels_getter (callable or str or None, optional): indicates how to identify the labels in the input.
          By default, this will try to find a "labels" key in the input (case-insensitive), if
          the input is a dict or it is a tuple whose second element is a dict.
          This heuristic should work well with a lot of datasets, including the built-in torchvision datasets.
          It can also be a callable that takes the same input
          as the transform, and returns the labels.
class_docstr_tok: ["Remove","degenerate\/invalid","bounding","boxes","and","their","corresponding","labels","and","masks",".","This","transform","removes","bounding","boxes","and","their","associated","labels\/masks","that",":","-","are","below","a","given","``","min_size","``",":","by","default","this","also","removes","degenerate","boxes","that","have","e.g",".","X2","<","=","X1",".","-","have","any","coordinate","outside","of","their","corresponding","image",".","You","may","want","to","call",":","class",":","`","~torchvision.transforms.v2.ClampBoundingBoxes","`","first","to","avoid","undesired","removals",".","It","is","recommended","to","call","it","at","the","end","of","a","pipeline",",","before","passing","the","input","to","the","models",".","It","is","critical","to","call","this","transform","if",":","class",":","`","~torchvision.transforms.v2.RandomIoUCrop","`","was","called",".","If","you","want","to","be","extra","careful",",","you","may","call","it","after","all","transforms","that","may","modify","bounding","boxes","but","once","at","the","end","should","be","enough","in","most","cases",".","Args",":","min_size","(","float",",","optional",")","The","size","below","which","bounding","boxes","are","removed",".","Default","is","1.","labels_getter","(","callable","or","str","or","None",",","optional",")",":","indicates","how","to","identify","the","labels","in","the","input",".","By","default",",","this","will","try","to","find","a","``","labels","''","key","in","the","input","(","case-insensitive",")",",","if","the","input","is","a","dict","or","it","is","a","tuple","whose","second","element","is","a","dict",".","This","heuristic","should","work","well","with","a","lot","of","datasets",",","including","the","built-in","torchvision","datasets",".","It","can","also","be","a","callable","that","takes","the","same","input","as","the","transform",",","and","returns","the","labels","."]
code: def _transform(self, inpt: Any, params: Dict[str, Any]) -> Any:
      is_label = inpt is not None and inpt is params["labels"]
      is_bounding_boxes_or_mask = isinstance(
          inpt, (tv_tensors.BoundingBoxes, tv_tensors.Mask)
      )
  
      if not (is_label or is_bounding_boxes_or_mask):
          return inpt
  
      output = inpt[params["valid"]]
  
      if is_label:
          return output
  
      return tv_tensors.wrap(output, like=inpt)
  
imports: import warnings
  from typing import Any, Callable, cast, Dict, List, Optional, Sequence, Type, Union
  import PIL.Image
  import torch
  from torch.utils._pytree import tree_flatten, tree_unflatten
  from torchvision import transforms, tv_tensors
  from torchvision.transforms.v2 import functional, Transform
  from ._utils import _parse_labels_getter, _setup_number_or_seq, _setup_size, get_bounding_boxes, has_any, is_pure_tensor
label_desc: Use image node_id 3 for calling the SanitizeBoundingBoxes obj's underlying member method code with example usage: obj._transform(inpt, params) and returns: tv_tensors, inpt, output