ClementPinard / FlowNetPytorch

Pytorch implementation of FlowNet by Dosovitskiy et al.
MIT License
842 stars 206 forks source link

About warping. #22

Closed chuchienshu closed 6 years ago

chuchienshu commented 6 years ago

Hi @ClementPinard, I am wondering about this codeclass RandomColorWarp(object) .Is it the same operation as caffe code:warping. If so, the(inputs, target) are frame_1 and predict_flow respectively, right? Thanks a lot!

ClementPinard commented 6 years ago

Hello, The random color warp is about color modification. In other word, there is no grid resampling. There is just layer mixing (going to transpose RGB into e.g. BRG, or any other combination) for input

inputs is for image pair (so frame_1 and frame_2) and target is for groud truth flow. Actually, this transformation does not modify the flow map at all (target is just returned without any modification). The reason we take flow as input is because it fits in the workflow composed of several functions that transform inputs and flow accrodingly. While some function make transformations equivariant (such as spatial transformatons, cropping, scaling that affects optical flow), color warping is invariant for flow as long as you do it for both input images accordingly.

The equivalent code for caffe flownet is located in https://github.com/lmb-freiburg/flownet2/blob/master/src/caffe/layers/data_augmentation_layer.cu#L72

chuchienshu commented 6 years ago

Thanks for your detailed explanation.nice !