FluxML / DataAugmentation.jl

Flexible data augmentation library for machine and deep learning
https://fluxml.ai/DataAugmentation.jl/dev/
MIT License
41 stars 18 forks source link

Cropping can only be performed at the end of a pipeline #62

Closed darsnack closed 2 years ago

darsnack commented 2 years ago

The following works:

augmentations = Rotate(10) |>
                Zoom((0.9, 1.1)) |>
                ScaleFixed((96, 96)) |>
                Maybe(FlipX()) |>
                CenterCrop((96, 96)) |>
                ImageToTensor()

but the following breaks (i.e. the images are not 96x96)

augmentations = Rotate(10) |>
                Zoom((0.9, 1.1)) |>
                ScaleFixed((96, 96)) |>
                CenterCrop((96, 96)) |>
                Maybe(FlipX()) |>
                ImageToTensor()

I don't know if this is a technical limitation (my fuzzy reading of the source code suggests yes), but if it is, then it should be properly documented.

lorenzoh commented 2 years ago

🐛

63 fixes it.