Colorspace Transformations

ByteToFloat

class augmax.ByteToFloat(input_types: Array | Tuple[Array | Tuple[PyTree, ...] | List[PyTree] | Dict[Hashable, PyTree] | InputType | None, ...] | List[Array | Tuple[PyTree, ...] | List[PyTree] | Dict[Hashable, PyTree] | InputType | None] | Dict[Hashable, Array | Tuple[PyTree, ...] | List[PyTree] | Dict[Hashable, PyTree] | InputType | None] | InputType | None = None)[source]

Transforms images from uint8 representation (values 0-255) to normalized float representation (values 0.0-1.0)

../_images/ByteToFloat_0.png ../_images/ByteToFloat_1.png ../_images/ByteToFloat_2.png

Augmentation Examples for ByteToFloat()

Normalize

class augmax.Normalize(mean: Array = array([0.485, 0.456, 0.406]), std: Array = array([0.229, 0.224, 0.225]), input_types=None)[source]

Normalizes images using given coefficients using the mapping

\[p_k \longmapsto \frac{p_k - \mathtt{mean}_k}{\mathtt{std}_k}\]
Parameters:
  • mean (jnp.ndarray) – Mean values for each channel

  • std (jnp.ndarray) – Standard deviation for each channel

../_images/Normalize_0.png ../_images/Normalize_1.png ../_images/Normalize_2.png

Augmentation Examples for Normalize()

ChannelShuffle

class augmax.ChannelShuffle(p: float = 0.5, input_types=None)[source]

Randomly shuffles an images channels.

Parameters:

p (float) – Probability of applying the transformation

../_images/ChannelShuffle_0.png ../_images/ChannelShuffle_1.png ../_images/ChannelShuffle_2.png

Augmentation Examples for ChannelShuffle(p=1.0)

ChannelDrop

class augmax.ChannelDrop(p: float = 0.5, input_types=None)[source]

Randomly drops a channelf from the image

Parameters:

p (float) – Probability of applying the transformation

../_images/ChannelDrop_0.png ../_images/ChannelDrop_1.png ../_images/ChannelDrop_2.png

Augmentation Examples for ChannelDrop(p=1.0)

RandomGrayscale

class augmax.RandomGrayscale(p: float = 0.5, input_types=None)[source]

Randomly converts the image to grayscale.

Parameters:

p (float) – Probability of applying the transformation

../_images/RandomGrayscale_0.png ../_images/RandomGrayscale_1.png ../_images/RandomGrayscale_2.png

Augmentation Examples for RandomGrayscale(p=1.0)

RandomBrightness

class augmax.RandomBrightness(range: Tuple[float, float] = (-1.0, 1.0), p: float = 0.5, input_types=None)[source]

Randomly adjusts the image brightness.

Parameters:
  • range (float, float)

  • p (float) – Probability of applying the transformation

../_images/RandomBrightness_0.png ../_images/RandomBrightness_1.png ../_images/RandomBrightness_2.png

Augmentation Examples for RandomBrightness(p=1.0)

RandomContrast

class augmax.RandomContrast(range: Tuple[float, float] = (-1.0, 1.0), p: float = 0.5, input_types=None)[source]

Randomly adjusts the image contrast.

Parameters:
  • range (float, float)

  • p (float) – Probability of applying the transformation

../_images/RandomContrast_0.png ../_images/RandomContrast_1.png ../_images/RandomContrast_2.png

Augmentation Examples for RandomContrast(p=1.0)

RandomGamma

class augmax.RandomGamma(range: Tuple[float, float] = (0.25, 4.0), p: float = 0.5, input_types=None)[source]

Randomly adjusts the image gamma.

Parameters:
  • range (float, float)

  • p (float) – Probability of applying the transformation

../_images/RandomGamma_0.png ../_images/RandomGamma_1.png ../_images/RandomGamma_2.png

Augmentation Examples for RandomGamma(p=1.0)

RandomChannelGamma

class augmax.RandomChannelGamma(range: Tuple[float, float] = (0.25, 4.0), p: float = 0.5, input_types=None)[source]

Randomly adjusts each channel’s gamma.

Parameters:
  • range (float, float)

  • p (float) – Probability of applying the transformation

../_images/RandomChannelGamma_0.png ../_images/RandomChannelGamma_1.png ../_images/RandomChannelGamma_2.png

Augmentation Examples for RandomChannelGamma(p=1.0)

ColorJitter

class augmax.ColorJitter(brightness: float = 0.1, contrast: float = 0.1, saturation: float = 0.1, hue: float = 0.1, p: float = 0.5, input_types=None)[source]

Randomly jitter the image colors.

Parameters:
  • range (float, float)

  • p (float) – Probability of applying the transformation

../_images/ColorJitter_0.png ../_images/ColorJitter_1.png ../_images/ColorJitter_2.png

Augmentation Examples for ColorJitter(p=1.0)

Solarization

class augmax.Solarization(threshold: float = 0.5, p: float = 0.5, input_types=None)[source]

Randomly solarizes the image.

Parameters:
  • range (float, float)

  • p (float) – Probability of applying the transformation

../_images/Solarization_0.png ../_images/Solarization_1.png ../_images/Solarization_2.png

Augmentation Examples for Solarization(p=1.0)