Rotate
- class deepinv.transform.Rotate(*args, limits: float = 360.0, multiples: float = 1.0, positive: bool = False, interpolation_mode: InterpolationMode = InterpolationMode.NEAREST, **kwargs)[source]
Bases:
Transform
2D Rotations.
Generates
n_trans
randomly rotated versions of 2D images with zero padding (without replacement).Picks integer angles between -limits and limits, by default -360 to 360. Set
positive=True
to clip to positive degrees. For exact pixel rotations (0, 90, 180, 270 etc.), setmultiples=90
.By default, output will be cropped/padded to input shape. Set
constant_shape=False
to let output shape differ from input shape.See
deepinv.transform.Transform
for further details and examples.- Parameters:
limits (float) – images are rotated in the range of angles (-limits, limits).
multiples (float) – angles are selected uniformly from \(\pm\) multiples of
multiples
. Default to 1 (i.e integers) When multiples is a multiple of 90, no interpolation is performed.positive (bool) – if True, only consider positive angles.
n_trans (int) – number of transformed versions generated per input image.
rng (torch.Generator) – random number generator, if
None
, usetorch.Generator()
, defaults toNone
Examples using Rotate
:
Image transforms for equivariance & augmentations
Image transformations for Equivariant Imaging
Self-supervised learning with Equivariant Imaging for MRI.