def __init__(self, brightness_limit=0.2, contrast_limit=0.2, always_apply=False, p=0.5): super(IndependentRandomBrightnessContrast, self).__init__(always_apply, p) self.brightness_limit = A.to_tuple(brightness_limit) self.contrast_limit = A.to_tuple(contrast_limit)
def __init__( self, shear_x=0.1, shear_y=0.1, interpolation=cv2.INTER_LINEAR, border_mode=cv2.cv2.BORDER_REFLECT_101, value=None, always_apply=False, p=0.5, ): super().__init__(always_apply, p) self.shear_x = albu.to_tuple(shear_x) self.shear_y = albu.to_tuple(shear_y) self.interpolation = interpolation self.border_mode = border_mode self.value = value
def __init__(self, max_angle=2.0, interpolation=0, always_apply=False, p=0.25): super(RandomRotate, self).__init__(always_apply, p) self.max_angle = to_tuple(max_angle, bias=0) self.interpolation = interpolation
def __init__(self, scale_limit=(0.5, 2), interpolation='bilinear', always_apply=False, p=1.0): super(RandomScale, self).__init__(interpolation=interpolation, always_apply=always_apply, p=p) self.scale_limit = albu.to_tuple(scale_limit)
def __init__(self, shift_limit=2, interpolation=0, always_apply=False, p=0.75): super(RandomShift, self).__init__(always_apply, p) if type(shift_limit) == int: shift_limit = [shift_limit, shift_limit] self.shift_limit = [to_tuple(sl, bias=0) for sl in shift_limit] self.interpolation = interpolation
def __init__(self, scale_limit=0.1, interpolation=0, always_apply=False, p=0.5): super(RandomScale, self).__init__(always_apply, p) if type(scale_limit) == float: scale_limit = [scale_limit, scale_limit] self.scale_limit = [to_tuple(sl, bias=1.0) for sl in scale_limit] self.interpolation = interpolation
def __init__(self, scale_limit=(0.5, 2), interpolation=cv2.INTER_LINEAR, scale_step=None, always_apply=False, p=1.0): super(RandomScale, self).__init__(interpolation=interpolation, always_apply=always_apply, p=p) self.scale_limit = albu.to_tuple(scale_limit) self.scale_step = scale_step
def __init__( self, limit=90, interpolation=cv2.INTER_LINEAR, border_mode=cv2.BORDER_REFLECT_101, value=None, always_apply=False, p=0.5, ): super(ExpandRotate, self).__init__(always_apply, p) self.limit = albu.to_tuple(limit) self.interpolation = interpolation self.border_mode = border_mode self.value = value
def __init__( self, limit=0.0625, interpolation=cv2.INTER_LINEAR, border_mode=cv2.BORDER_REFLECT_101, value=None, mask_value=None, always_apply=False, p=0.5, ): super(VerticalShift, self).__init__(always_apply, p) self.limit = albu.to_tuple(limit) self.interpolation = interpolation self.border_mode = border_mode self.value = value self.mask_value = mask_value
def get_transform_init_args(self): return { "interpolation": self.interpolation, "max_angle": to_tuple(self.max_angle[0], bias=0)[1] }
def get_transform_init_args(self): return { "interpolation": self.interpolation, "shift_limit": to_tuple(self.shift_limit[0], bias=0)[1] }
def __init__(self, limit=.2, p=.5): super(RandomContrastGray, self).__init__(p) self.limit = A.to_tuple(limit)
def get_transform_init_args(self): return {"interpolation": self.interpolation, "scale_limit_x": A.to_tuple(self.scale_limit_x, bias=-1.0), "scale_limit_y": A.to_tuple(self.scale_limit_y, bias=-1.0)}
def __init__(self, scale_limit_x=0.1, scale_limit_y=0.1, interpolation=cv2.INTER_LINEAR, always_apply=False, p=0.5): super(RandomIndependentScale, self).__init__(always_apply, p) self.scale_limit_x = A.to_tuple(scale_limit_x, bias=1.0) self.scale_limit_y = A.to_tuple(scale_limit_y, bias=1.0) self.interpolation = interpolation