class_docstr: Random affine transform of the image w.r.t to the image center.
  Transformations involve:
  
  - Translation ("move" image on the x-/y-axis)
  - Rotation
  - Scaling ("zoom" in/out)
  - Shear (move one side of the image, turning a square into a trapezoid)
docstr: Args:
      scale (tuple of 2 floats): scaling factor interval, e.g (a, b), then scale is
          randomly sampled from the range a <= scale <= b. Will keep
          original scale by default.
      translate_frac (tuple of 2 floats): tuple of max abs fraction for horizontal
          and vertical translation. For example translate_frac=(a, b), then horizontal shift
          is randomly sampled in the range 0 < dx < img_width * a and vertical shift is
          randomly sampled in the range 0 < dy < img_height * b. Will
          not translate by default.
      shear (float): max abs shear value in degrees between 0 to 180
      interp: cv2 interpolation method
      border: cv2 border method
      border_value: cv2 border value for border=cv2.BORDER_CONSTANT
docstr_tok: ["Args",":","scale","(","tuple","of","2","floats",")",":","scaling","factor","interval",",","e.g","(","a",",","b",")",",","then","scale","is","randomly","sampled","from","the","range","a","<","=","scale","<","=","b",".","Will","keep","original","scale","by","default",".","translate_frac","(","tuple","of","2","floats",")",":","tuple","of","max","abs","fraction","for","horizontal","and","vertical","translation",".","For","example","translate_frac=","(","a",",","b",")",",","then","horizontal","shift","is","randomly","sampled","in","the","range","0","<","dx","<","img_width","*","a","and","vertical","shift","is","randomly","sampled","in","the","range","0","<","dy","<","img_height","*","b",".","Will","not","translate","by","default",".","shear","(","float",")",":","max","abs","shear","value","in","degrees","between","0","to","180","interp",":","cv2","interpolation","method","border",":","cv2","border","method","border_value",":","cv2","border","value","for","border=cv2.BORDER_CONSTANT"]
code: def __init__(
      self,
      scale=None,
      translate_frac=None,
      rotate_max_deg=0.0,
      shear=0.0,
      interp=cv2.INTER_LINEAR,
      border=cv2.BORDER_REPLICATE,
      border_value=0,
  ):
      """
      Args:
          scale (tuple of 2 floats): scaling factor interval, e.g (a, b), then scale is
              randomly sampled from the range a <= scale <= b. Will keep
              original scale by default.
          translate_frac (tuple of 2 floats): tuple of max abs fraction for horizontal
              and vertical translation. For example translate_frac=(a, b), then horizontal shift
              is randomly sampled in the range 0 < dx < img_width * a and vertical shift is
              randomly sampled in the range 0 < dy < img_height * b. Will
              not translate by default.
          shear (float): max abs shear value in degrees between 0 to 180
          interp: cv2 interpolation method
          border: cv2 border method
          border_value: cv2 border value for border=cv2.BORDER_CONSTANT
      """
      if scale is not None:
          assert (
              isinstance(scale, tuple) and len(scale) == 2
          ), "Argument scale should be a tuple of two floats, e.g (a, b)"
  
      if translate_frac is not None:
          assert (
              isinstance(translate_frac, tuple)
              and len(translate_frac) == 2
          ), "Argument translate_frac should be a tuple of two floats, e.g (a, b)"
  
      assert (
          shear >= 0.0
      ), "Argument shear should be between 0.0 and 180.0"
  
      super(Affine, self).__init__()
      self._init(locals())
  
imports: import math
  import numpy
  import cv2
  from .base import ImageAugmentor
  from .transform import WarpAffineTransform, CropTransform, TransformList
label_desc: Use image node_id 1 to create a new Affine object from inherited base classes: ImageAugmentor with example: obj = Affine(scale, translate_frac, rotate_max_deg, shear, interp, border, border_value)