sniklaus / pytorch-spynet

a reimplementation of Optical Flow Estimation using a Spatial Pyramid Network in PyTorch
GNU General Public License v3.0
317 stars 47 forks source link

backwarp function #18

Closed mcsuy1998 closed 3 years ago

mcsuy1998 commented 3 years ago

I was comparing the backwarp function between pytorch-spynet and pytorch-pwc and they are different. Does it matter which one is used? Furthermore, in the model I am developing, I am going to need to warp the image according to the optical flow, do we just use either one of the 2 backwarp functions used in the 2 models. So for example if I used pytorch-spynet then I would use the backwarp of pytorch-spynet, and vice versa for pytorch-pwc?

sniklaus commented 3 years ago

There are slight variances in the way the original authors did the backward warping, and I modeled the backward warping such that it mimics the official implementation(s). If you do not take these details into consideration, then the pre-trained weights may yield slightly different result. If you use an optical flow estimate for your own purposes, you can use any backward function that you want, just be aware that some backward warping methods have (resampling) issues.