tensorflow / addons

Useful extra functionality for TensorFlow 2.x maintained by SIG-addons
Apache License 2.0
1.69k stars 610 forks source link

Resampling using interpolations other than bilinear #2779

Open andrevitorelli opened 1 year ago

andrevitorelli commented 1 year ago

Describe the feature and the current behavior/state. Addition of interpolators beyond bilinear in resampler_ops.

As detailed in #2535, gradients of the bilinear interpolation fail when applied to an integer-pixel warp. This is expected, as in bilinear interpolation, pixel positions will correspond to non-differentiable corners in the interpolated function. This is an issue when using tensorflow addons for our(@andrevitorelli, @eiffl, @b-remy, @aguinot, @dr-zero) projects, at CosmoStat/autometacal and DifferentiableUniverseInitiative/GalFlow to implement the same techniques as esheldon/ngmix with TensorFlow.

Relevant information

Which API type would this fall under (layer, metric, optimizer, etc.) custom_ops Who will benefit with this feature? Anyone using resampling or affine transformations of images through resampling. Any other info. In our fork, we currently have implementations of cubic and quintic interpolations, though we would like to have more in the future (such as Lanczos).