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 and y_offset which are the multipliers of each of the image corners corners (-1, -1), (1, -1), (1, 1), and (-1, 1).

_static/example_images/Perspective.png
class tormentor.Rotate(aug_id=None, seed=None)[source]

Rotates the image around the center.

_static/example_images/Rotate.png
class tormentor.Zoom(aug_id=None, seed=None)[source]

Augments by scaling images preserving their aspect ratio.

_static/example_images/Zoom.png
class tormentor.Scale(aug_id=None, seed=None)[source]

Augmentation by scaling images preserving aspect ratio.

_static/example_images/Scale.png
class tormentor.Translate(aug_id=None, seed=None)[source]

Augmentation by translating images.

_static/example_images/Translate.png
class tormentor.ScaleTranslate(aug_id=None, seed=None)[source]

Augmentation by scaling and translating images preserving aspect ratio.

_static/example_images/ScaleTranslate.png
class tormentor.Flip(aug_id=None, seed=None)[source]

Implementation of augmentation by flipping the X or Y axis.

_static/example_images/Flip.png
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 to harmonic_smoothing or n log(n) depending of how the gaussian filters are implemented.

_static/example_images/ElasticTransform.png
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.

_static/example_images/Wrap.png
class tormentor.Shred(aug_id=None, seed=None)