← all repositories
sniklaus/pytorch-pwc

PWC-Net in PyTorch, minus the CUDA headaches

A personal reimplementation that matches the official Caffe PWC-Net by reusing its weights — and reportedly runs where the official PyTorch port chokes.

★660 stars Python Computer Vision
pytorch-pwc
Too new to rank. Velocity needs a few days of history.
star history

What it does Optical flow estimation: feed it two frames, get a .flo flow field. It’s Simon Niklaus’s PyTorch reimplementation of PWC-Net (CVPR 2018), NVIDIA’s pyramid-warping-cost-volume network. The trick is that it loads the original Caffe weights rather than training from scratch, so it reproduces the Caffe version’s results.

The interesting bit The official PyTorch port initially underperformed the Caffe original — until its authors adopted this repo’s weights-reuse approach. Meanwhile, users kept hitting CUDA issues with the official version; this one apparently doesn’t. Sometimes the valuable contribution is just making the thing actually run.

Key highlights

  • Matches the official Caffe implementation’s performance by using its pretrained weights
  • Correlation layer implemented in CUDA via CuPy, so an NVIDIA GPU is required
  • Two models selectable via run.py --model
  • Part of a family: the author also maintains PyTorch ports of UnFlow, SpyNet, and LiteFlowNet
  • Author reports results identical to Caffe on his examples, though correctness is not guaranteed

Caveats

  • Weights are non-commercial share-alike per the NVlabs license — check before commercial use
  • CuPy dependency means no CPU-only fallback

Verdict If you need PWC-Net-quality optical flow in a PyTorch pipeline and the official port has been fighting you, this is the pragmatic choice. If you wanted a from-scratch training setup or CPU support, look elsewhere.

Frequently asked

What is sniklaus/pytorch-pwc?
A personal reimplementation that matches the official Caffe PWC-Net by reusing its weights — and reportedly runs where the official PyTorch port chokes.
Is pytorch-pwc open source?
Yes — sniklaus/pytorch-pwc is open source, released under the GPL-3.0 license.
What language is pytorch-pwc written in?
sniklaus/pytorch-pwc is primarily written in Python.
How popular is pytorch-pwc?
sniklaus/pytorch-pwc has 660 stars on GitHub.
Where can I find pytorch-pwc?
sniklaus/pytorch-pwc is on GitHub at https://github.com/sniklaus/pytorch-pwc.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.