(self, size, random_rate, keep_ratio=False)
:param input_size: resize尺寸,数字或者list的形式，如果为list形式，就是[w,h]
        :param ramdon_rate: 随机系数
        :param keep_ratio: 是否保持长宽比
        :return:
:param input_size: resize尺寸,数字或者list的形式，如果为list形式，就是[w,h]
        :param ramdon_rate: 随机系数
        :param keep_ratio: 是否保持长宽比
        :return:
: param input_size : resize尺寸 数字或者list的形式，如果为list形式，就是 [ w h ] : param ramdon_rate : 随机系数 : param keep_ratio : 是否保持长宽比 : return :
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
def __init__ ( self , size , random_rate , keep_ratio = False ) : 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