sniklaus/pytorch-liteflownet
a reimplementation of LiteFlowNet in PyTorch that matches the official Caffe version
What it solves
Optical flow estimation is the task of computing the motion of every pixel between two images. LiteFlowNet is a lightweight convolutional neural network designed for this purpose, and this project brings it to PyTorch so you can use it without the original Caffe framework.
How it works
This reimplementation replicates the LiteFlowNet architecture in PyTorch. A key component is the correlation layer, which is implemented in CUDA using CuPy (a required dependency). The provided command-line tool takes two images, runs one of three selectable models, and writes the flow output to a .flo file. The results closely match the original Caffe implementation, though minor numerical differences exist because of downsampling differences between Caffe and PyTorch.
Who it’s for
Researchers, students, or developers working on optical flow, video analysis, or motion estimation who prefer the PyTorch ecosystem. It is also useful for anyone who needs a PyTorch-accessible version of LiteFlowNet for experimentation or integration into larger projects.
Highlights
- Personal reimplementation of LiteFlowNet (originally in Caffe) using PyTorch.
- Utilizes a CUDA-based correlation layer via CuPy for fast computation.
- Produces results nearly identical to the original implementation across tested examples.
- Offers three model variations to choose from.
- Simple command-line interface:
python run.py --model default --one image1.png --two image2.png --out result.flo. - Docker support is available via the linked pull request.
- Follows the authors' licensing terms, which restrict use to research purposes.
Related
- Project
- Project
- Project
- Project