docstr: Rescale image to the specified target size, and capped at max_size
  if max_size != 0.
  If target_size is list, selected a scale randomly as the specified
  target size.
  
  Args:
      target_size (int|list): the target size of image's short side,
          multi-scale training is adopted when type is list.
      max_size (int): the max size of image
      interp (int): the interpolation method
      use_cv2 (bool): use the cv2 interpolation method or use PIL
          interpolation method
docstr_tok: ["Rescale","image","to","the","specified","target","size",",","and","capped","at","max_size","if","max_size","!","=","0",".","If","target_size","is","list",",","selected","a","scale","randomly","as","the","specified","target","size",".","Args",":","target_size","(","int|list",")",":","the","target","size","of","image","'s","short","side",",","multi-scale","training","is","adopted","when","type","is","list",".","max_size","(","int",")",":","the","max","size","of","image","interp","(","int",")",":","the","interpolation","method","use_cv2","(","bool",")",":","use","the","cv2","interpolation","method","or","use","PIL","interpolation","method"]
code: def __init__(
      self,
      target_size=0,
      max_size=0,
      interp=cv2.INTER_LINEAR,
      use_cv2=True,
  ):
      """
      Rescale image to the specified target size, and capped at max_size
      if max_size != 0.
      If target_size is list, selected a scale randomly as the specified
      target size.
  
      Args:
          target_size (int|list): the target size of image's short side,
              multi-scale training is adopted when type is list.
          max_size (int): the max size of image
          interp (int): the interpolation method
          use_cv2 (bool): use the cv2 interpolation method or use PIL
              interpolation method
      """
      self.max_size = int(max_size)
      self.interp = int(interp)
      self.use_cv2 = use_cv2
      self.target_size = target_size
  
imports: from __future__ import absolute_import
  from __future__ import print_function
  from __future__ import division
  import os
  import random
  import cv2
  import numpy
  from PIL import Image
label_desc: Use image node_id 1 to create a new ResizeImage object from inherited base classes: object with example: obj = ResizeImage(target_size, max_size, interp, use_cv2)