Skip to content

MohammadJohari/pytorch-liteflownet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pytorch-liteflownet

This is a forked copy of pytorch-liteflownet, which is itself a personal reimplementation of LiteFlowNet [1] using PyTorch. This forked repository is customized for allowing reading and processing multiple image pairs in a directory.

Should you be making use of this work, please cite the original paper [1] accordingly and make sure to adhere to the licensing terms of the authors. Also, please acknowledge the original reimplementation appropriately [2].

Paper

For the original Caffe version of this work, please see: https://github.com/twhui/LiteFlowNet
Another optical flow implementation from me: https://github.com/sniklaus/pytorch-pwc
And another optical flow implementation from me: https://github.com/sniklaus/pytorch-spynet
Yet another optical flow implementation from me: https://github.com/sniklaus/pytorch-unflow

setup

The correlation layer is implemented in CUDA using CuPy, which is why CuPy is a required dependency. It can be installed using pip install cupy or alternatively using one of the provided binary packages as outlined in the CuPy repository. If you would like to use Docker, you can take a look at this pull request to get started.

usage

To run it on your own pair of images, use the following command. You can choose between three models, please make sure to see their paper / the code for more details.

python run.py --model default --first ./images/first.png --second ./images/second.png --out ./out.flo

I am afraid that I cannot guarantee that this reimplementation is correct. However, it produced results pretty much identical to the implementation of the original authors in the examples that I tried. There are some numerical deviations that stem from differences in the DownsampleLayer of Caffe and the torch.nn.functional.interpolate function of PyTorch. Please feel free to contribute to this repository by submitting issues and pull requests.

comparison

Comparison

license

As stated in the licensing terms of the authors of the paper, their material is provided for research purposes only. Please make sure to further consult their licensing terms.

references

[1]  @inproceedings{Hui_CVPR_2018,
         author = {Tak-Wai Hui and Xiaoou Tang and Chen Change Loy},
         title = {{LiteFlowNet}: A Lightweight Convolutional Neural Network for Optical Flow Estimation},
         booktitle = {IEEE Conference on Computer Vision and Pattern Recognition},
         year = {2018}
     }
[2]  @misc{pytorch-liteflownet,
         author = {Simon Niklaus},
         title = {A Reimplementation of {LiteFlowNet} Using {PyTorch}},
         year = {2019},
         howpublished = {\url{https://github.com/sniklaus/pytorch-liteflownet}}
    }

About

a reimplementation of LiteFlowNet in PyTorch that matches the official Caffe version

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%