Does sparse_image_warp (from TF) exist in Pytorch?

Hello,

PyTorch is great!

I’m not an image/vision expert and I’m looking for a function analogous to sparse_image_warp from TensorFlow, but in Pytorch. Does anyone know if it it exists?

Closest candidates I’ve found that don’t quite match:

Thanks a lot!

1 Like

Someone appears to have implemented it here:

See also:

1 Like

Thanks, that’s actually me :slight_smile:

Aha, well great job and thank you! Have found this spec augmentation stuff to be useful

1 Like

It seems that the code post by @liam.schoneveld can only deal with one channel image, which is used to augment speech data. I am wondering where can I find the code to tackle color image (Maybe I can simply add a dimension in the code?)

The closest analog in PyTorch is torch.nn.functional.grid_sample(), but this is actually closer to the dense_image_warp function.

The conventions for the grid are also slightly different in PyTorch, but you can probably do a conversion to fit your needs.

I hope this helps!

1 Like

Did you find one? Thanks

Can you ellaborate a bit on this?