NVIDIA / flownet2-pytorch

Pytorch implementation of FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks
Other
3.15k stars 741 forks source link

Augmentation issues? #26

Open PkuRainBow opened 6 years ago

PkuRainBow commented 6 years ago

I find that in the original version of the FlowNet/ FlowNet-2,the data augmentation techniques include :

translation rotation scaling gaussian noise contrast multiplicative color changes

But it seems that there only exists the center crop augmentation op in the current implementations.

fitsumreda commented 6 years ago

we've not implemented data augmentations yet. Currently, random crop is supported. Feel free to do a PR to port the data augmentations from flownet2-caffe

PkuRainBow commented 6 years ago

@fitsumreda We will try to reimplement it. I recommend a torch version below(transform it to pytorch will be more convenient):

https://github.com/anuragranj/spynet/blob/master/transforms.lua

https://github.com/anuragranj/spynet/blob/master/donkey.lua
ClementPinard commented 6 years ago

You can find a flow augmentation here : https://github.com/ClementPinard/FlowNetPytorch/blob/master/flow_transforms.py

As for flownet2 implementation, they set up a very elegant solution, based on affine transformation matrices.

You can find how they construct the flow map here and how they construct the affine matrices here

I tried to explain the general workflow with LaTeX equations here : to view it, copy paste in e.g. stackedit

So basically,

It may not be the simplest way to integrate it, but this is the most flexible, because it works for every possible value of affine matrix, provided that R2 is invertible. That includes shearing, flip, and every other affine transormation.

fitsumreda commented 6 years ago

Thanks @PkuRainBow and @ClementPinard

harshdeepsokhey commented 5 years ago

Just curious if this issue has been fixed/ is required any longer. I would like to take this one up. Thanks. -H