class_docstr: Resize the image to the base shape, downsample it with gaussian pyramid,
  and rescale it back to original size.
  
  Adapted from https://github.com/FangShancheng/ABINet.
  
  Required Keys:
  
  - img (ndarray)
  
  Modified Keys:
  
  - img (ndarray)
  
  Args:
      factor (int): The decay factor from base size, or the number of
          downsampling operations from the base layer.
      base_shape (tuple[int, int]): The shape (width, height) of the base
          layer of the pyramid.
      randomize_factor (bool): If True, the final factor would be a random
          integer in [0, factor].
class_docstr_tok: ["Resize","the","image","to","the","base","shape",",","downsample","it","with","gaussian","pyramid",",","and","rescale","it","back","to","original","size",".","Adapted","from","https",":","\/\/github.com\/FangShancheng\/ABINet",".","Required","Keys",":","-","img","(","ndarray",")","Modified","Keys",":","-","img","(","ndarray",")","Args",":","factor","(","int",")",":","The","decay","factor","from","base","size",",","or","the","number","of","downsampling","operations","from","the","base","layer",".","base_shape","(","tuple","[","int",",","int","]",")",":","The","shape","(","width",",","height",")","of","the","base","layer","of","the","pyramid",".","randomize_factor","(","bool",")",":","If","True",",","the","final","factor","would","be","a","random","integer","in","[","0",",","factor","]","."]
code: def __repr__(self) -> str:
      repr_str = self.__class__.__name__
      repr_str += f"(factor = {self.factor}"
      repr_str += f", randomize_factor = {self.randomize_factor}"
      repr_str += f", base_w = {self.base_w}"
      repr_str += f", base_h = {self.base_h})"
      return repr_str
  
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 4 for calling the PyramidRescale obj's underlying member method code with example usage: obj.__repr__() and returns: repr_str