CPABDiffeomorphism#

class deepinv.transform.CPABDiffeomorphism(*args, n_tesselation=3, zero_boundary=True, volume_perservation=True, override=True, device='cpu', **kwargs)[source]#

Bases: Transform

Continuous Piecewise-Affine-based Diffeomorphism.

Wraps CPAB from the original implementation. From the paper Freifeld et al. Transformations Based on Continuous Piecewise-Affine Velocity Fields.

These diffeomorphisms benefit from fast GPU-accelerated transform + fast inverse.

Requires installing libcpab using pip install git+https://github.com/Andrewwango/libcpab.git. For more details, see libcpab docs.

Generates n_trans randomly transformed versions.

See deepinv.transform.Transform for further details and examples.

..warning

This implementation does not allow using a ``torch.Generator`` to generate reproducible transformations.
You may be able to achieve reproducibility by using a global seed instead.
Parameters:
  • n_trans (int) – number of transformed versions generated per input image.

  • n_tesselation (int) –

    see libcpab.Cpab docs.

  • zero_boundary (bool) – see libcpab.Cpab docs

  • volume_perservation (bool) – see libcpab.Cpab docs

  • override (bool) – see libcpab.Cpab docs

  • device (str, torch.device) – torch device.

Examples using CPABDiffeomorphism:#

Image transforms for equivariance & augmentations

Image transforms for equivariance & augmentations