I’m using the C+±API to implement an optical flow method.
I successfully implemented a convolutional network for computing optical flow on very low-resolution (24x32) image, I can scale that flow and I want to warp the image so I can continue estimating optical flow on a higher-resolution level.
I can’t find the values for the interpolation mode and border mode, neither in the docs nor in the code and this doesn’t compile:
torch::grid_sampler_2d(img, flow, torch::kBilinear, torch::kBorder, true);
Thank you for your reply. Seems like grid_sampler_2d is more like a low-level function, not to be used by “normal” users. I use grid_sample now and it works as expected:
namespace F = torch::nn::functional;
F::grid_sample(img1_t, map_t, F::GridSampleFuncOptions()
.mode(torch::kBilinear)
.padding_mode(torch::kBorder)
.align_corners(true));