class_docstr: Randomly crop the image's height, either from top or bottom.
  
  Adapted from
  https://github.com/PaddlePaddle/PaddleOCR/blob/release%2F2.6/ppocr/data/imaug/rec_img_aug.py  # noqa
  
  Required Keys:
  
  - img
  
  Modified Keys:
  
  - img
  - img_shape
  
  Args:
      crop_min (int): Minimum pixel(s) to crop. Defaults to 1.
      crop_max (int): Maximum pixel(s) to crop. Defaults to 8.
class_docstr_tok: ["Randomly","crop","the","image","'s","height",",","either","from","top","or","bottom",".","Adapted","from","https",":","\/\/github.com\/PaddlePaddle\/PaddleOCR\/blob\/release","%","2F2.6\/ppocr\/data\/imaug\/rec_img_aug.py","#","noqa","Required","Keys",":","-","img","Modified","Keys",":","-","img","-","img_shape","Args",":","crop_min","(","int",")",":","Minimum","pixel","(","s",")","to","crop",".","Defaults","to","1.","crop_max","(","int",")",":","Maximum","pixel","(","s",")","to","crop",".","Defaults","to","8","."]
docstr: Transform function to crop images.
  
  Args:
      results (dict): Result dict from loading pipeline.
  
  Returns:
      dict: Cropped results.
docstr_tok: ["Transform","function","to","crop","images",".","Args",":","results","(","dict",")",":","Result","dict","from","loading","pipeline",".","Returns",":","dict",":","Cropped","results","."]
code: def transform(self, results: Dict) -> Dict:
      """Transform function to crop images.
  
      Args:
          results (dict): Result dict from loading pipeline.
  
      Returns:
          dict: Cropped results.
      """
      h = results["img"].shape[0]
      crop_pixels, crop_top = self.get_random_vars()
      crop_pixels = min(crop_pixels, h - 1)
      img = results["img"].copy()
      if crop_top:
          img = img[crop_pixels:h, :, :]
      else:
          img = img[0 : h - crop_pixels, :, :]
      results["img_shape"] = img.shape[:2]
      results["img"] = img
      return results
  
imports: import math
  import random
  from typing import Dict, List, Optional, Tuple
  import cv2
  import mmcv
  import numpy
  from mmcv.transforms.base import BaseTransform
  from mmcv.transforms.utils import cache_randomness
  from mmocr.registry import TRANSFORMS
label_desc: Use image node_id 3 for calling the CropHeight obj's underlying member method code with example usage: obj.transform(results) and returns: results