class_docstr: Resize image to a size determinned by `scale` and `size`.
  
  Args:
      size(tuple|list): The reference size to resize. A tuple or list with length 2.
      scale(tupel|list, optional): A range of scale base on `size`. A tuple or list with length 2. Default: None.
class_docstr_tok: ["Resize","image","to","a","size","determinned","by","`","scale","`","and","`","size","`",".","Args",":","size","(","tuple|list",")",":","The","reference","size","to","resize",".","A","tuple","or","list","with","length","2.","scale","(","tupel|list",",","optional",")",":","A","range","of","scale","base","on","`","size","`",".","A","tuple","or","list","with","length","2",".","Default",":","None","."]
code: def __call__(self, data):
      h, w = data["img"].shape[:2]
      if self.scale is not None:
          scale = np.random.uniform(self.scale[0], self.scale[1])
      else:
          scale = 1.0
      if self.size is not None:
          scale_factor = max(self.size[0] / w, self.size[1] / h)
      else:
          scale_factor = 1
      scale = scale * scale_factor
  
      w = int(round(w * scale))
      h = int(round(h * scale))
      data["img"] = functional.resize(data["img"], (w, h))
      for key in data.get("gt_fields", []):
          if key == "trimap":
              data[key] = functional.resize(
                  data[key], (w, h), cv2.INTER_NEAREST
              )
          else:
              data[key] = functional.resize(data[key], (w, h))
      return data
  
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 2 for calling the RandomResize obj's underlying member method code with example usage: obj.__call__(data) and returns: data