Image Augmentations#

The augmentation operators, grouped by what they change. They take float tensors of shape (B, C, H, W), or (B, C, D, H, W) for the 3D transforms; color transforms expect values in [0, 1]. Each operator applies with probability p, drawn per sample, except the crops, the resizes, RandomMixUpV2, RandomCutMixV2, PatchMix, Normalize, Denormalize and RandomDissolving, which transform the whole batch or none of it. same_on_batch=True makes any other operator use one draw for the whole batch. In the class descriptions, “selected” samples are the ones p picked. Combine operators with AugmentationSequential.

2D intensity transforms

2D transforms that change pixel values but not their positions: color jitter, blur, noise, illumination, JPEG, weather effects.

2D geometric transforms

2D transforms that move pixels: crops, flips, affine, perspective, elastic, thin-plate-spline, erasing.

2D mix transforms

2D transforms that combine several images: CutMix, MixUp, Mosaic, Jigsaw, Transplantation.

3D transforms

Geometric, intensity and mix transforms for volumetric (B, C, D, H, W) data.