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

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

Bases: object

Augments by changing ‘gamma’ of the image (same as gamma correction in photos or computer monitors

Parameters

gamma_range – range to sample gamma from. If one value is smaller than 1 and the other one is

larger then half the samples will have gamma <1 and the other >1 (in the inverval that was specified). Tuple of float. If one value is < 1 and the other > 1 then half the images will be augmented with gamma values smaller than 1 and the other half with > 1 :param invert_image: whether to invert the image before applying gamma augmentation :param per_channel: :param data_key: :param retain_stats: Gamma transformation will alter the mean and std of the data in the patch. If retain_stats=True, the data will be transformed to match the mean and standard deviation before gamma augmentation. retain_stats can also be callable (signature retain_stats() -> bool) :param p_per_sample:

Methods

__init__(gamma_range=(0.5, 2), invert_image=False, per_channel=False, data_key='data', retain_stats: Union[bool, Callable[[], bool]] = False, p_per_sample=1)[source]#

Augments by changing ‘gamma’ of the image (same as gamma correction in photos or computer monitors

Parameters

gamma_range – range to sample gamma from. If one value is smaller than 1 and the other one is

larger then half the samples will have gamma <1 and the other >1 (in the inverval that was specified). Tuple of float. If one value is < 1 and the other > 1 then half the images will be augmented with gamma values smaller than 1 and the other half with > 1 :param invert_image: whether to invert the image before applying gamma augmentation :param per_channel: :param data_key: :param retain_stats: Gamma transformation will alter the mean and std of the data in the patch. If retain_stats=True, the data will be transformed to match the mean and standard deviation before gamma augmentation. retain_stats can also be callable (signature retain_stats() -> bool) :param p_per_sample:

__call__(**data_dict)[source]#

Call self as a function.