class_docstr: A general geometric augmentation tool for text images in the CVPR 2020
  paper "Learn to Augment: Joint Data Augmentation and Network Optimization
  for Text Recognition". It applies distortion, stretching, and perspective
  transforms to an image.
  
  This implementation is adapted from
  https://github.com/RubanSeven/Text-Image-Augmentation-python/blob/master/augment.py  # noqa
  
  TODO: Split this transform into three transforms.
  
  Required Keys:
  
  - img
  
  Modified Keys:
  
  - img
  - img_shape
class_docstr_tok: ["A","general","geometric","augmentation","tool","for","text","images","in","the","CVPR","2020","paper","``","Learn","to","Augment",":","Joint","Data","Augmentation","and","Network","Optimization","for","Text","Recognition","''",".","It","applies","distortion",",","stretching",",","and","perspective","transforms","to","an","image",".","This","implementation","is","adapted","from","https",":","\/\/github.com\/RubanSeven\/Text-Image-Augmentation-python\/blob\/master\/augment.py","#","noqa","TODO",":","Split","this","transform","into","three","transforms",".","Required","Keys",":","-","img","Modified","Keys",":","-","img","-","img_shape"]
docstr: Warp the image.
docstr_tok: ["Warp","the","image","."]
code: def warp_mls(
      self,
      src: np.ndarray,
      src_pts: List[int],
      dst_pts: List[int],
      dst_w: int,
      dst_h: int,
      trans_ratio: float = 1.0,
  ) -> np.ndarray:
      """Warp the image."""
      rdx, rdy = self._calc_delta(dst_w, dst_h, src_pts, dst_pts, 100)
      return self._gen_img(
          src, rdx, rdy, dst_w, dst_h, 100, trans_ratio
      )
  
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 6 for calling the TextRecogGeneralAug obj's underlying member method code with example usage: obj.warp_mls(src, src_pts, dst_pts, dst_w, dst_h, trans_ratio) and returns: self