docstr: Define image scales using gaussian pyramid and rescale image to target scale.
  
  Args:
      factor: the decayed factor from base size, factor=4 keeps target scale by default.
      base_size: base size the build the bottom layer of pyramid
docstr_tok: ["Define","image","scales","using","gaussian","pyramid","and","rescale","image","to","target","scale",".","Args",":","factor",":","the","decayed","factor","from","base","size",",","factor=4","keeps","target","scale","by","default",".","base_size",":","base","size","the","build","the","bottom","layer","of","pyramid"]
code: def __init__(self, factor=4, base_size=(128, 512)):
      """Define image scales using gaussian pyramid and rescale image to target scale.
  
      Args:
          factor: the decayed factor from base size, factor=4 keeps target scale by default.
          base_size: base size the build the bottom layer of pyramid
      """
      if isinstance(factor, numbers.Number):
          self.factor = round(sample_uniform(0, factor))
      elif isinstance(factor, (tuple, list)) and len(factor) == 2:
          self.factor = round(sample_uniform(factor[0], factor[1]))
      else:
          raise Exception("factor must be number or list with length 2")
      # assert factor is valid
      self.base_h, self.base_w = base_size[:2]
  
imports: import math
  import numbers
  import random
  import cv2
  import numpy
  from paddle.vision.transforms import Compose, ColorJitter
label_desc: Use image node_id 1 to create a new CVRescale object from inherited base classes: object with example: obj = CVRescale(factor, base_size)