class_docstr: Resize an image.
  
  Args:
      target_size (list|tuple, optional): The target size of image. Default: (512, 512).
      interp (str, optional): The interpolation mode of resize is consistent with opencv.
          ['NEAREST', 'LINEAR', 'CUBIC', 'AREA', 'LANCZOS4', 'RANDOM']. Note that when it is
          'RANDOM', a random interpolation mode would be specified. Default: "LINEAR".
  
  Raises:
      TypeError: When 'target_size' type is neither list nor tuple.
      ValueError: When "interp" is out of pre-defined methods ('NEAREST', 'LINEAR', 'CUBIC',
      'AREA', 'LANCZOS4', 'RANDOM').
docstr: Args:
      im (np.ndarray): The Image data.
      label (np.ndarray, optional): The label data. Default: None.
  
  Returns:
      (tuple). When label is None, it returns (im, ), otherwise it returns (im, label),
  
  Raises:
      TypeError: When the 'img' type is not numpy.
      ValueError: When the length of "im" shape is not 3.
docstr_tok: ["Args",":","im","(","np.ndarray",")",":","The","Image","data",".","label","(","np.ndarray",",","optional",")",":","The","label","data",".","Default",":","None",".","Returns",":","(","tuple",")",".","When","label","is","None",",","it","returns","(","im",",",")",",","otherwise","it","returns","(","im",",","label",")",",","Raises",":","TypeError",":","When","the","'img","'","type","is","not","numpy",".","ValueError",":","When","the","length","of","``","im","''","shape","is","not","3","."]
code: def __call__(self, im: np.ndarray, label: np.ndarray = None) -> Tuple:
      """
      Args:
          im (np.ndarray): The Image data.
          label (np.ndarray, optional): The label data. Default: None.
  
      Returns:
          (tuple). When label is None, it returns (im, ), otherwise it returns (im, label),
  
      Raises:
          TypeError: When the 'img' type is not numpy.
          ValueError: When the length of "im" shape is not 3.
      """
  
      if not isinstance(im, np.ndarray):
          raise TypeError("Resize: image type is not numpy.")
      if len(im.shape) != 3:
          raise ValueError("Resize: image is not 3-dimensional.")
      if self.interp == "RANDOM":
          interp = random.choice(list(self.interp_dict.keys()))
      else:
          interp = self.interp
      im = F.resize(im, self.target_size, self.interp_dict[interp])
      if label is not None:
          label = F.resize(label, self.target_size, cv2.INTER_NEAREST)
  
      if label is None:
          return (im,)
      else:
          return (im, label)
  
imports: import os
  import random
  from typing import Callable, Union, List, Tuple
  import cv2
  import numpy
  from PIL import Image
  import paddlehub.vision.functional
label_desc: Use image node_id 2 for calling the Resize obj's underlying member method code with example usage: obj.__call__(im, label) and returns: im, im,  label