Euclidean

class deepinv.transform.projective.Euclidean(n_trans: int = 1, theta_max: float = 180.0, theta_z_max: float = 180.0, zoom_factor_min: float = 0.5, shift_max: float = 1.0, skew_max: float = 50.0, x_stretch_factor_min: float = 0.5, y_stretch_factor_min: float = 0.5, padding: str = 'reflection', interpolation: str = 'bilinear', device: str = 'cpu')[source]

Bases: Homography

Random Euclidean image transformations using projective transformation framework.

Special case of homography which corresponds to the actions of the Euclidean subgroup E(2). Euclidean transformations include translations, rotations and reflections. These transformations are parametrised using geometric parameters in the pinhole camera model. See deepinv.transform.Homography for more details.

Generates n_trans random transformations concatenated along the batch dimension.


Example:

Apply a random Euclidean transformation:

>>> from deepinv.transform.projective import Euclidean
>>> x = torch.randn(1, 3, 16, 16) # Random 16x16 image
>>> transform = Euclidean(n_trans = 1)
>>> x_T = transform(x)
Parameters:
  • theta_z_max (float) – Maximum 2D z-rotation angle in degrees, defaults to 180.

  • shift_max (float) – Maximum shift percentage, where 1 is full shift, defaults to 1.

  • padding (str) – kornia padding mode, defaults to “reflection”

  • interpolation (str) – kornia or PIL interpolation mode, defaults to “bilinear”

  • device (str) – torch device, defaults to “cpu”.

  • n_trans – number of transformed versions generated per input image, defaults to 1.

  • rng (torch.Generator) – random number generator, if None, use torch.Generator(), defaults to None

Examples using Euclidean:

Image transforms for equivariance & augmentations

Image transforms for equivariance & augmentations

Image transformations for Equivariant Imaging

Image transformations for Equivariant Imaging