docstr: :param input_size: resize尺寸,数字或者list的形式，如果为list形式，就是[w,h]
  :param ramdon_rate: 随机系数
  :param keep_ratio: 是否保持长宽比
  :return:
docstr_tok: [":","param","input_size",":","resize\u5c3a\u5bf8",",","\u6570\u5b57\u6216\u8005list\u7684\u5f62\u5f0f\uff0c\u5982\u679c\u4e3alist\u5f62\u5f0f\uff0c\u5c31\u662f","[","w",",","h","]",":","param","ramdon_rate",":","\u968f\u673a\u7cfb\u6570",":","param","keep_ratio",":","\u662f\u5426\u4fdd\u6301\u957f\u5bbd\u6bd4",":","return",":"]
code: def __init__(self, size, random_rate, keep_ratio=False):
      """
      :param input_size: resize尺寸,数字或者list的形式，如果为list形式，就是[w,h]
      :param ramdon_rate: 随机系数
      :param keep_ratio: 是否保持长宽比
      :return:
      """
      if isinstance(size, numbers.Number):
          if size < 0:
              raise ValueError(
                  "If input_size is a single number, it must be positive."
              )
          size = (size, size)
      elif (
          isinstance(size, list)
          or isinstance(size, tuple)
          or isinstance(size, np.ndarray)
      ):
          if len(size) != 2:
              raise ValueError(
                  "If input_size is a sequence, it must be of len 2."
              )
          size = (size[0], size[1])
      else:
          raise Exception(
              "input_size must in Number or list or tuple or np.ndarray"
          )
      self.size = size
      self.keep_ratio = keep_ratio
      self.random_rate = random_rate
  
imports: import math
  import numbers
  import random
  import cv2
  import numpy
  from skimage.util import random_noise
label_desc: Use image node_id 1 to create a new RandomResize object  with example: obj = RandomResize(size, random_rate, keep_ratio)