code: def __init__(self, target_size=(512, 512), random_interp=False):
      if isinstance(target_size, list) or isinstance(
          target_size, tuple
      ):
          if len(target_size) != 2:
              raise ValueError(
                  "`target_size` should include 2 elements, but it is {}".format(
                      target_size
                  )
              )
      else:
          raise TypeError(
              "Type of `target_size` is invalid. It should be list or tuple, but it is {}".format(
                  type(target_size)
              )
          )
  
      self.target_size = target_size
      self.random_interp = random_interp
      self.interps = [
          cv2.INTER_NEAREST,
          cv2.INTER_LINEAR,
          cv2.INTER_CUBIC,
      ]
  
imports: import os
  import random
  import string
  import cv2
  import numpy
  from paddleseg.transforms import functional
  from paddleseg.cvlibs import manager
  from paddleseg.utils import seg_env
  from PIL import Image
label_desc: Use image node_id 1 to create a new Resize object  with example: obj = Resize(target_size, random_interp)