• Stars
    star
    602
  • Rank 73,885 (Top 2 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 6 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a reimplementation of PWC-Net in PyTorch that matches the official Caffe version

pytorch-pwc

This is a personal reimplementation of PWC-Net [1] using PyTorch. Should you be making use of this work, please cite the paper accordingly. Also, make sure to adhere to the licensing terms of the authors. Should you be making use of this particular implementation, please acknowledge it appropriately [2].

Paper

For the original version of this work, please see: https://github.com/NVlabs/PWC-Net
Other optical flow implementations from me: pytorch-unflow, pytorch-spynet, pytorch-liteflownet

background

The authors of PWC-Net are thankfully already providing a reference implementation in PyTorch. However, its initial version did not reach the performance of the original Caffe version. This is why I created this repositroy, in which I replicated the performance of the official Caffe version by utilizing its weights.

The official PyTorch implementation has adopted my approach of using the Caffe weights since then, which is why they are all performing equally well now. Many people have reported issues with CUDA when trying to get the official PyTorch version to run though, while my reimplementaiton does not seem to be subject to such problems.

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.

usage

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

python run.py --model default --one ./images/one.png --two ./images/two.png --out ./out.flo

I am afraid that I cannot guarantee that this reimplementation is correct. However, it produced results identical to the Caffe implementation of the original authors in the examples that I tried. 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, the models are free for non-commercial share-alike purpose. Please make sure to further consult their licensing terms.

references

[1]  @inproceedings{Sun_CVPR_2018,
         author = {Deqing Sun and Xiaodong Yang and Ming-Yu Liu and Jan Kautz},
         title = {{PWC-Net}: {CNNs} for Optical Flow Using Pyramid, Warping, and Cost Volume},
         booktitle = {IEEE Conference on Computer Vision and Pattern Recognition},
         year = {2018}
     }
[2]  @misc{pytorch-pwc,
         author = {Simon Niklaus},
         title = {A Reimplementation of {PWC-Net} Using {PyTorch}},
         year = {2018},
         howpublished = {\url{https://github.com/sniklaus/pytorch-pwc}}
    }

More Repositories

1

3d-ken-burns

an implementation of 3D Ken Burns Effect from a Single Image using PyTorch
Python
1,497
star
2

sepconv-slomo

an implementation of Video Frame Interpolation via Adaptive Separable Convolution using PyTorch
Python
1,008
star
3

pytorch-hed

a reimplementation of Holistically-Nested Edge Detection in PyTorch
Python
451
star
4

softmax-splatting

an implementation of softmax splatting for differentiable forward warping using PyTorch
Python
436
star
5

pytorch-liteflownet

a reimplementation of LiteFlowNet in PyTorch that matches the official Caffe version
Python
400
star
6

pytorch-spynet

a reimplementation of Optical Flow Estimation using a Spatial Pyramid Network in PyTorch
Python
298
star
7

wasm-raytracer

a performance comparison of a simple raytracer in JavaScript, asm.js, WebAssembly, and GLSL
HTML
168
star
8

pytorch-unflow

a reimplementation of UnFlow in PyTorch that matches the official TensorFlow version
Python
143
star
9

youtube-watchmarker

a browser extension that keeps track of your YouTube watch history and marks videos that you have already watched
JavaScript
141
star
10

pytorch-extension

an example of a CUDA extension for PyTorch using CuPy which computes the Hadamard product of two tensors
Python
118
star
11

revisiting-sepconv

an implementation of Revisiting Adaptive Convolutions for Video Frame Interpolation using PyTorch
Python
77
star
12

arxiv-doom

a parody of the ever-increasing amount of papers that appear on arXiv
HTML
32
star
13

teaching-vision

the framework for my computer vision class, in which the students are ought to solve various exercises
Python
24
star
14

teaching-webdev

the framework for my full stack web development class, in which the students are ought to solve various exercises
HTML
22
star
15

bookmark-tab

JavaScript
14
star
16

teaching-minichess

the framework for my advanced artificial intelligence class, in which an artificial chess player is ought to be implemented
C
14
star
17

nes-memoryview

visualizing the value of each individual byte in an emulated NES as a time series
HTML
9
star
18

teaching-confour

the framework for my advanced artificial intelligence class, in which an connect-four player is ought to be implemented
C
3
star
19

resume

my personal resume written in LaTeX for others to use
HTML
1
star