Spatial Augmentations¶
- class tormentor.Perspective(aug_id=None, seed=None)[source]¶
Applies a perspective transformation on the data by moving the corners of an image.
This augmentation is parametrised by two random variables
x_offset
andy_offset
which are the multipliers of each of the image corners corners (-1, -1), (1, -1), (1, 1), and (-1, 1).
- class tormentor.Zoom(aug_id=None, seed=None)[source]¶
Augments by scaling images preserving their aspect ratio.
- class tormentor.Scale(aug_id=None, seed=None)[source]¶
Augmentation by scaling images preserving aspect ratio.
- class tormentor.ScaleTranslate(aug_id=None, seed=None)[source]¶
Augmentation by scaling and translating images preserving aspect ratio.
- class tormentor.Flip(aug_id=None, seed=None)[source]¶
Implementation of augmentation by flipping the X or Y axis.
- class tormentor.ElasticTransform(aug_id=None, seed=None)[source]¶
Augmentation ElasticTransform.
This augmentation does not guaranty to be a homomorphism. In order for the augmentation to behave as a homomorphism,
harmonic_smoothing
must be quite low. On the other hand, the complexity of the operation is n**2 with respect toharmonic_smoothing
or n log(n) depending of how the gaussian filters are implemented.
- class tormentor.Wrap(aug_id=None, seed=None)[source]¶
Augmentation Wrap.
This augmentation acts like many simultaneous elastic transforms with gaussian sigmas set at varius harmonics.
- Distributions:
roughness
: Quantification of the local inconsistency of the distortion effect.intensity
: Quantification of the intensity of the distortion effect.
- class tormentor.Shred(aug_id=None, seed=None)¶