Skip to content

Utilities to create random deformations in tensorflow

Notifications You must be signed in to change notification settings

adler-j/tfdeform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tfdeform

This is a small utility library to create random large deformations in tensorflow. It is mainly intended for data-augmentation.

Example

Example of deforming the "face" image. The size (distance travelled) of the deformation is approximately 100 pixels with a correlation length of 100 pixels.

# Generate a deformation field
offset = tfdeform.create_deformation_momentum(
    shape=[1, *shape], std=100.0, distance=100.0)
    
# Apply the deformation field to an image
face_deform = tfdeform.dense_image_warp(face, offset)
Input image Deformed image
true deformed

Implementation details

The implementation is done using the geodesic shooting method, which should guarantee that the generated deformation is a diffeomorphism. Everything runs in tensorflow so it should be reasonably fast. Batch computation is supported.

About

Utilities to create random deformations in tensorflow

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages