Skip to content

augmentations

augmentations

Augmentation configuration module for data preprocessing.

This module defines configuration classes for various image augmentation strategies that can be instantiated at runtime using Hydra.

AugmentationConfig dataclass

AugmentationConfig(_target_=MISSING, p=1.0)

Base configuration for augmentation transforms.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

p float

Probability of applying the transform.

ColorJitterConfig dataclass

ColorJitterConfig(_target_='albumentations.ColorJitter', p=0.5, brightness=0.3, contrast=0.4, saturation=0.5, hue=0.1)

Bases: AugmentationConfig

Random brightness, contrast, saturation, and hue jitter.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

brightness float

Brightness jitter range.

contrast float

Contrast jitter range.

saturation float

Saturation jitter range.

hue float

Hue jitter range.

p float

Probability of applying the transform.

RandomSunFlareConfig dataclass

RandomSunFlareConfig(_target_='albumentations.RandomSunFlare', p=0.6, flare_roi=(0, 0, 1, 0.5), src_color=(255, 255, 255))

Bases: AugmentationConfig

Simulated sun-flare artifacts in the upper image region.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

flare_roi tuple[float, float, float, float]

Region of the image where the flare can appear, as fractions.

src_color tuple[int, int, int]

RGB color of the flare.

p float

Probability of applying the transform.

RandomBrightnessContrastConfig dataclass

RandomBrightnessContrastConfig(_target_='albumentations.RandomBrightnessContrast', p=0.6, brightness_limit=0.4, contrast_limit=0.4)

Bases: AugmentationConfig

Random brightness and contrast shifts.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

brightness_limit float

Maximum brightness shift as a fraction.

contrast_limit float

Maximum contrast shift as a fraction.

p float

Probability of applying the transform.

RandomGammaConfig dataclass

RandomGammaConfig(_target_='albumentations.RandomGamma', p=0.3, gamma_limit=(80, 120))

Bases: AugmentationConfig

Random gamma correction within the configured limits.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

gamma_limit tuple[int, int]

Gamma correction range in percent.

p float

Probability of applying the transform.

CLAHEConfig dataclass

CLAHEConfig(_target_='albumentations.CLAHE', p=0.3, clip_limit=4.0)

Bases: AugmentationConfig

Contrast-limited adaptive histogram equalization.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

clip_limit float

Contrast-limiting threshold for histogram equalization.

p float

Probability of applying the transform.

RandomShadowConfig dataclass

RandomShadowConfig(_target_='albumentations.RandomShadow', p=0.4)

Bases: AugmentationConfig

Random polygonal shadows cast over the image.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

p float

Probability of applying the transform.

ImageCompressionConfig dataclass

ImageCompressionConfig(_target_='albumentations.ImageCompression', p=0.2, quality_range=(50, 100), compression_type='jpeg')

Bases: AugmentationConfig

Lossy compression artifacts within a random quality range.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

quality_range tuple[int, int]

Inclusive (lower, upper) JPEG/WebP quality range.

compression_type str

Compression codec, jpeg or webp.

p float

Probability of applying the transform.

GaussianBlurConfig dataclass

GaussianBlurConfig(_target_='albumentations.GaussianBlur', p=0.5, blur_limit=(3, 7))

Bases: AugmentationConfig

Gaussian blur with a random kernel size.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

blur_limit tuple[int, int]

Kernel size range for the blur.

p float

Probability of applying the transform.

CoarseDropoutConfig dataclass

CoarseDropoutConfig(_target_='albumentations.CoarseDropout', p=0.3, num_holes_range=(8, 8), hole_height_range=(8, 8), hole_width_range=(8, 8))

Bases: AugmentationConfig

Random rectangular occlusion holes.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

num_holes_range tuple[int, int]

Inclusive range for the number of dropped regions.

hole_height_range tuple[int, int]

Inclusive height range of a dropped region in pixels.

hole_width_range tuple[int, int]

Inclusive width range of a dropped region in pixels.

p float

Probability of applying the transform.

ShiftScaleRotateConfig dataclass

ShiftScaleRotateConfig(_target_='albumentations.ShiftScaleRotate', p=0.5, rotate_limit=(0, 0), scale_limit=(-0.5, 0.6), shift_limit=(-0.0625, 0.0625))

Bases: AugmentationConfig

Random shift and scale; rotation stays disabled to keep kinematics consistent.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

rotate_limit tuple[float, float]

Rotation range in degrees.

scale_limit tuple[float, float]

Scaling range as a fraction.

shift_limit tuple[float, float]

Translation range as a fraction of the image size.

p float

Probability of applying the transform.

CenterCropConfig dataclass

CenterCropConfig(_target_='albumentations.CenterCrop', p=1.0, height=MISSING, width=MISSING)

Bases: AugmentationConfig

Center crop augmentation that preserves aspect ratio.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

height int

Will be set from DataConfig.

width int

Will be set from DataConfig.

p float

Always apply if enabled.

RotateConfig dataclass

RotateConfig(_target_='albumentations.Rotate', p=0.5, limit=(-5, 5), interpolation=1)

Bases: AugmentationConfig

Rotation augmentation that requires special handling due to paired rotation of robot actions.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

limit tuple[float, float]

Rotation range in degrees.

interpolation int

cv2.INTER_LINEAR.

p float

Probability of applying the transform.

AugmentationPipelineConfig dataclass

AugmentationPipelineConfig(_target_='albumentations.Compose', transforms=list())

Configuration for augmentation pipeline.

Attributes:

Name Type Description
_target_ str

Import path instantiated by Hydra.

transforms list[Any]

Augmentation transforms applied in order.