class_docstr: resize image by target_size and max_size
  Args:
      arch (str): model type
      target_size (int): the target size of image
      max_size (int): the max size of image
      use_cv2 (bool): whether us cv2
      image_shape (list): input shape of model
      interp (int): method of resize
docstr: Args:
      im (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",":","im","(","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, im):
      """
      Args:
          im (np.ndarray): image (np.ndarray)
      Returns:
          im_scale_x: the resize ratio of X
          im_scale_y: the resize ratio of Y
      """
      origin_shape = im.shape[:2]
      im_c = im.shape[2]
      if self.max_size != 0:
          im_size_min = np.min(origin_shape[0:2])
          im_size_max = np.max(origin_shape[0:2])
          im_scale = float(self.target_size) / float(im_size_min)
          if np.round(im_scale * im_size_max) > self.max_size:
              im_scale = float(self.max_size) / float(im_size_max)
          im_scale_x = im_scale
          im_scale_y = im_scale
      else:
          im_scale_x = float(self.target_size) / float(origin_shape[1])
          im_scale_y = float(self.target_size) / float(origin_shape[0])
      return im_scale_x, im_scale_y
  
imports: import cv2
  import numpy
  from PIL import Image
label_desc: Use image node_id 3 for calling the Resize obj's underlying member method code with example usage: obj.generate_scale(im) and returns: im_scale_x,  im_scale_y