ClementPinard / FlowNetPytorch

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

Disparity / Flow normalization #18

Closed tlkvstepan closed 6 years ago

tlkvstepan commented 6 years ago

Hi @ClementPinard, i have a small question. Why do you normalize disparities / flows by std=20. Where did you find this in the original code? Thank you!

ClementPinard commented 6 years ago

From the deploy.tpl.prototxt of flownetS in caffe code, line 893

layer {
  name: "Eltwise4"
  type: "Eltwise"
  bottom: "predict_flow2"
  top: "blob44"
  eltwise_param {
    operation: SUM
    coeff: 20.0
  }
}

Coeff is 20, meaning network is trained to output 1/20 of original flow. It is also consistent with pretrained weights of caffe network !

Clement

tlkvstepan commented 6 years ago

Thank you!

tlkvstepan commented 6 years ago

I am working with DispNetCorr1D model and it does not have this line..

ClementPinard commented 6 years ago

DispNet output is indeed not multiplied by 20 (but it's not flow net 😉 ). Also, Correlation module is not avalaible for the moment in pytorch (if you have a functional solution for this, I'd be glad to add it to this repo !) But I guess you can remove it pretty easily if you want, or just add the option --div-flow 1 to your command.

tlkvstepan commented 6 years ago

I am working with DispNetCorr1 with the end goal to re-implement CRL and I have my own repository (which is private right now), but I will be glad to contribute missing parts to yours.

ClementPinard commented 6 years ago

That would be super cool ! Did you manage to get a working cuda layer of CRL ? I'm not much of a cuda guy so I did not even try to implement it :disappointed:

ClementPinard commented 6 years ago

Hey, you might want to test this correlation module : https://github.com/NVIDIA/flownet2-pytorch/tree/master/networks/correlation_package

tlkvstepan commented 6 years ago

@ClementPinard thank you for the link. I will test it out and compare with pytorch cuda implementation (which is, I think, already quite fast).

tlkvstepan commented 6 years ago

Thank you again their project is amazing!