peal.data.transformations¶
Callable image transformations used by PEAL datasets and generators.
The classes here are plugged into torchvision.transforms.Compose
pipelines built by the datasets: geometric augmentations (RandomRotation,
RandomResizeCropPad, Padding, CircularCut), channel handling
(SetChannels), invertible normalization (Normalization and its no-op
twin IdentityNormalization, both exposing invert so tensors can be
mapped back to image space) and DiffusionAugmentation, which augments an
image by encoding and re-decoding it with a PEAL generator.
Classes
Black out everything outside the ellipse inscribed in a PIL image. |
|
Augment images by a stochastic encode/decode round trip through a generator. |
|
No-op stand-in for |
|
Per-channel |
|
Symmetrically pad a |
|
Random zoom augmentation that keeps the spatial size fixed. |
|
Rotate a tensor image by a random integer angle. |
|
Convert a tensor image to a fixed number of channels. |