class_docstr: resize image by target_size and max_size
  Args:
      target_size (int): the target size of image
      keep_ratio (bool): whether keep_ratio or not, default true
      interp (int): method of resize
class_docstr_tok: ["resize","image","by","target_size","and","max_size","Args",":","target_size","(","int",")",":","the","target","size","of","image","keep_ratio","(","bool",")",":","whether","keep_ratio","or","not",",","default","true","interp","(","int",")",":","method","of","resize"]
docstr: Args:
      img (np.ndarray): image (np.ndarray)
  Returns:
      im_scale_x: the resize ratio of X
      im_scale_y: the resize ratio of Y
docstr_tok: ["Args",":","img","(","np.ndarray",")",":","image","(","np.ndarray",")","Returns",":","im_scale_x",":","the","resize","ratio","of","X","im_scale_y",":","the","resize","ratio","of","Y"]
code: def generate_scale(self, img):
      """
      Args:
          img (np.ndarray): image (np.ndarray)
      Returns:
          im_scale_x: the resize ratio of X
          im_scale_y: the resize ratio of Y
      """
      limit_side_len = self.limit_side_len
      h, w, c = img.shape
  
      # limit the max side
      if self.limit_type == "max":
          if h > w:
              ratio = float(limit_side_len) / h
          else:
              ratio = float(limit_side_len) / w
      elif self.limit_type == "min":
          if h < w:
              ratio = float(limit_side_len) / h
          else:
              ratio = float(limit_side_len) / w
      elif self.limit_type == "resize_long":
          ratio = float(limit_side_len) / max(h, w)
      else:
          raise Exception("not support limit type, image ")
      resize_h = int(h * ratio)
      resize_w = int(w * ratio)
  
      resize_h = max(int(round(resize_h / 32) * 32), 32)
      resize_w = max(int(round(resize_w / 32) * 32), 32)
  
      im_scale_y = resize_h / float(h)
      im_scale_x = resize_w / float(w)
      return im_scale_y, im_scale_x
  
imports: import cv2
  import numpy
  import imgaug.augmenters
  from keypoint_preprocess import get_affine_transform
  from PIL import Image
label_desc: Use image node_id 3 for calling the Resize_Mult32 obj's underlying member method code with example usage: obj.generate_scale(img) and returns: im_scale_y,  im_scale_x