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)
      im_info (dict): info of image
  Returns:
      im (np.ndarray):  processed image (np.ndarray)
      im_info (dict): info of processed image
docstr_tok: ["Args",":","im","(","np.ndarray",")",":","image","(","np.ndarray",")","im_info","(","dict",")",":","info","of","image","Returns",":","im","(","np.ndarray",")",":","processed","image","(","np.ndarray",")","im_info","(","dict",")",":","info","of","processed","image"]
code: def __call__(self, im, im_info):
      """
      Args:
          im (np.ndarray): image (np.ndarray)
          im_info (dict): info of image
      Returns:
          im (np.ndarray):  processed image (np.ndarray)
          im_info (dict): info of processed image
      """
      im_channel = im.shape[2]
      im_scale_x, im_scale_y = self.generate_scale(im)
      if self.use_cv2:
          im = cv2.resize(
              im,
              None,
              None,
              fx=im_scale_x,
              fy=im_scale_y,
              interpolation=self.interp,
          )
      else:
          resize_w = int(im_scale_x * float(im.shape[1]))
          resize_h = int(im_scale_y * float(im.shape[0]))
          if self.max_size != 0:
              raise TypeError(
                  "If you set max_size to cap the maximum size of image,"
                  "please set use_cv2 to True to resize the image."
              )
          im = im.astype("uint8")
          im = Image.fromarray(im)
          im = im.resize((int(resize_w), int(resize_h)), self.interp)
          im = np.array(im)
  
      # padding im when image_shape fixed by infer_cfg.yml
      if self.max_size != 0 and self.image_shape is not None:
          padding_im = np.zeros(
              (self.max_size, self.max_size, im_channel),
              dtype=np.float32,
          )
          im_h, im_w = im.shape[:2]
          padding_im[:im_h, :im_w, :] = im
          im = padding_im
  
      im_info["scale"] = [im_scale_x, im_scale_y]
      im_info["resize_shape"] = im.shape[:2]
      return im, im_info
  
imports: import cv2
  import numpy
  from PIL import Image
label_desc: Use image node_id 2 for calling the Resize obj's underlying member method code with example usage: obj.__call__(im, im_info) and returns: im,  im_info