class_docstr: Random crop and flip a patch in the image. Only used in text detection
  task.
  
  Required Keys:
  
  - img
  - gt_bboxes
  - gt_polygons
  
  Modified Keys:
  
  - img
  - gt_bboxes
  - gt_polygons
  
  Args:
      pad_ratio (float): The ratio of padding. Defaults to 0.1.
      crop_ratio (float): The ratio of cropping. Defaults to 0.5.
      iter_num (int): Number of operations. Defaults to 1.
      min_area_ratio (float): Minimal area ratio between cropped patch
          and original image. Defaults to 0.2.
      epsilon (float): The threshold of polygon IoU between cropped area
          and polygon, which is used to avoid cropping text instances.
          Defaults to 0.01.
code: def __init__(
      self,
      pad_ratio: float = 0.1,
      crop_ratio: float = 0.5,
      iter_num: int = 1,
      min_area_ratio: float = 0.2,
      epsilon: float = 1e-2,
  ) -> None:
      if not isinstance(pad_ratio, float):
          raise TypeError(
              "`pad_ratio` should be an float, "
              f"but got {type(pad_ratio)} instead"
          )
      if not isinstance(crop_ratio, float):
          raise TypeError(
              "`crop_ratio` should be a float, "
              f"but got {type(crop_ratio)} instead"
          )
      if not isinstance(iter_num, int):
          raise TypeError(
              "`iter_num` should be an integer, "
              f"but got {type(iter_num)} instead"
          )
      if not isinstance(min_area_ratio, float):
          raise TypeError(
              "`min_area_ratio` should be a float, "
              f"but got {type(min_area_ratio)} instead"
          )
      if not isinstance(epsilon, float):
          raise TypeError(
              "`epsilon` should be a float, "
              f"but got {type(epsilon)} instead"
          )
  
      self.pad_ratio = pad_ratio
      self.epsilon = epsilon
      self.crop_ratio = crop_ratio
      self.iter_num = iter_num
      self.min_area_ratio = min_area_ratio
  
imports: import math
  import random
  from typing import Dict, List, Sequence, Tuple, Union
  import cv2
  import mmcv
  import numpy
  from mmcv.transforms import RandomFlip
  from mmcv.transforms.base import BaseTransform
  from mmcv.transforms.utils import avoid_cache_randomness, cache_randomness
  from shapely.geometry import Polygon
  from mmocr.registry import TRANSFORMS
  from mmocr.utils import crop_polygon, poly2bbox, poly_intersection
label_desc: Use image node_id 1 to create a new TextDetRandomCropFlip object from inherited base classes: BaseTransform with example: obj = TextDetRandomCropFlip(pad_ratio, crop_ratio, iter_num, min_area_ratio, epsilon)