class_docstr: Randomly crop images and make sure to contain at least one intact
  instance.
  
  Required Keys:
  
  - img
  - gt_polygons
  - gt_bboxes
  - gt_bboxes_labels
  - gt_ignored
  - gt_texts (optional)
  
  Modified Keys:
  
  - img
  - img_shape
  - gt_polygons
  - gt_bboxes
  - gt_bboxes_labels
  - gt_ignored
  - gt_texts (optional)
  
  Args:
      min_side_ratio (float): The ratio of the shortest edge of the cropped
          image to the original image size.
class_docstr_tok: ["Randomly","crop","images","and","make","sure","to","contain","at","least","one","intact","instance",".","Required","Keys",":","-","img","-","gt_polygons","-","gt_bboxes","-","gt_bboxes_labels","-","gt_ignored","-","gt_texts","(","optional",")","Modified","Keys",":","-","img","-","img_shape","-","gt_polygons","-","gt_bboxes","-","gt_bboxes_labels","-","gt_ignored","-","gt_texts","(","optional",")","Args",":","min_side_ratio","(","float",")",":","The","ratio","of","the","shortest","edge","of","the","cropped","image","to","the","original","image","size","."]
code: def __init__(self, min_side_ratio: float = 0.4) -> None:
      if not 0.0 <= min_side_ratio <= 1.0:
          raise ValueError(
              "`min_side_ratio` should be in range [0, 1],"
          )
      self.min_side_ratio = min_side_ratio
  
imports: import math
  from typing import Dict, Tuple
  import cv2
  import mmcv
  import numpy
  from mmcv.transforms import Resize
  from mmcv.transforms.base import BaseTransform
  from mmcv.transforms.utils import avoid_cache_randomness, cache_randomness
  from mmocr.registry import TRANSFORMS
  from mmocr.utils import bbox2poly, crop_polygon, is_poly_inside_rect, poly2bbox, poly2shapely, poly_make_valid, remove_pipeline_elements, rescale_polygon, shapely2poly
  from .wrappers import ImgAugWrapper
label_desc: Use image node_id 1 to create a new RandomCrop object from inherited base classes: BaseTransform with example: obj = RandomCrop(min_side_ratio)