cerebras.modelzoo.data.vision.segmentation.transforms.color_transforms.ContrastAugmentationTransform#

class cerebras.modelzoo.data.vision.segmentation.transforms.color_transforms.ContrastAugmentationTransform[source]#

Bases: object

Augments the contrast of data :param contrast_range:

(float, float): range from which to sample a random contrast that is applied to the data. If

one value is smaller and one is larger than 1, half of the contrast modifiers will be >1 and the other half <1 (in the inverval that was specified)

callable : must be contrast_range() -> float

Parameters

preserve_range – if True then the intensity values after contrast augmentation will be cropped to min and

max values of the data before augmentation. :param per_channel: whether to use the same contrast modifier for all color channels or a separate one for each channel :param data_key: :param p_per_sample:

Methods

__init__(contrast_range: Union[Tuple[float, float], Callable[[], float]] = (0.75, 1.25), preserve_range: bool = True, per_channel: bool = True, data_key: str = 'data', p_per_sample: float = 1, p_per_channel: float = 1)[source]#

Augments the contrast of data :param contrast_range:

(float, float): range from which to sample a random contrast that is applied to the data. If

one value is smaller and one is larger than 1, half of the contrast modifiers will be >1 and the other half <1 (in the inverval that was specified)

callable : must be contrast_range() -> float

Parameters

preserve_range – if True then the intensity values after contrast augmentation will be cropped to min and

max values of the data before augmentation. :param per_channel: whether to use the same contrast modifier for all color channels or a separate one for each channel :param data_key: :param p_per_sample:

__call__(**data_dict)[source]#

Call self as a function.