Compose data augmentation pipelines for image classification, segmentation, object detection, and 3D volumes in Julia.
Install the registered package and the sample images used below.
using Pkg
Pkg.add(["DataAugmentation", "TestImages"])Compose a random rotation and crop with |>. Use itemdata to get the resulting pixel array.
using DataAugmentation, TestImages
image = Image(testimage("lighthouse"))
tfm = Rotate(15) |> RandomResizeCrop((192, 256))
pixels = itemdata(tfm(image))Pass aligned items as a tuple with tfm((image, mask, boxes)) to share the random geometry. Here FlipX and RandomIoUCrop move the segmentation mask and labeled boxes with the image.
MixUp blends paired images. CutMix copies a rectangular patch from one image into another. Both return an ImageBatch with class weights that reflect the mix.
- Browse crops, warps, color transforms, and policies such as
RandAugmentandAutoAugment. Transformations - Run complete examples for masks, keypoints, boxes, and volumes. Pipelines
- Prepare image tensors, load batches, and train a model. Using with Flux


