class_docstr: Translate the images, bboxes, masks and segmentation map vertically.
  
  Required Keys:
  
  - img
  - gt_bboxes (BaseBoxes[torch.float32]) (optional)
  - gt_masks (BitmapMasks | PolygonMasks) (optional)
  - gt_seg_map (np.uint8) (optional)
  
  Modified Keys:
  
  - img
  - gt_bboxes
  - gt_masks
  - gt_seg_map
  
  Added Keys:
  
  - homography_matrix
  
  Args:
      prob (float): The probability for perform transformation and
          should be in range 0 to 1. Defaults to 1.0.
      level (int, optional): The level should be in range [0, _MAX_LEVEL].
          If level is None, it will generate from [0, _MAX_LEVEL] randomly.
          Defaults to None.
      min_mag (float): The minimum pixel's offset ratio for vertical
          translation. Defaults to 0.0.
      max_mag (float): The maximum pixel's offset ratio for vertical
          translation. Defaults to 0.1.
      reversal_prob (float): The probability that reverses the vertical
          translation magnitude. Should be in range [0,1]. Defaults to 0.5.
      img_border_value (int | float | tuple): The filled values for
          image border. If float, the same fill value will be used for
          all the three channels of image. If tuple, it should be 3 elements.
          Defaults to 128.
      mask_border_value (int): The fill value used for masks. Defaults to 0.
      seg_ignore_label (int): The fill value used for segmentation map.
          Note this value must equals ``ignore_label`` in ``semantic_head``
          of the corresponding config. Defaults to 255.
      interpolation (str): Interpolation method, accepted values are
          "nearest", "bilinear", "bicubic", "area", "lanczos" for 'cv2'
          backend, "nearest", "bilinear" for 'pillow' backend. Defaults
          to 'bilinear'.
code: def __init__(
      self,
      prob: float = 1.0,
      level: Optional[int] = None,
      min_mag: float = 0.0,
      max_mag: float = 0.1,
      reversal_prob: float = 0.5,
      img_border_value: Union[int, float, tuple] = 128,
      mask_border_value: int = 0,
      seg_ignore_label: int = 255,
      interpolation: str = "bilinear",
  ) -> None:
      assert 0.0 <= min_mag <= 1.0, (
          f"min_mag ratio for TranslateY should be "
          f"in range [0,1], got {min_mag}."
      )
      assert 0.0 <= max_mag <= 1.0, (
          f"max_mag ratio for TranslateY should be "
          f"in range [0,1], got {max_mag}."
      )
      super().__init__(
          prob=prob,
          level=level,
          min_mag=min_mag,
          max_mag=max_mag,
          reversal_prob=reversal_prob,
          img_border_value=img_border_value,
          mask_border_value=mask_border_value,
          seg_ignore_label=seg_ignore_label,
          interpolation=interpolation,
      )
  
imports: from typing import Optional, Union
  import cv2
  import mmcv
  import numpy
  from mmcv.transforms import BaseTransform
  from mmcv.transforms.utils import cache_randomness
  from mmdet.registry import TRANSFORMS
  from mmdet.structures.bbox import autocast_box_type
  from .augment_wrappers import _MAX_LEVEL, level_to_mag
label_desc: Use image node_id 1 to create a new TranslateY object from inherited base classes: GeomTransform with example: obj = TranslateY(prob, level, min_mag, max_mag, reversal_prob, img_border_value, mask_border_value, seg_ignore_label, interpolation)