https://github.com/vt-vl-lab/pwc-net.pytorch
Off-the-shelf PWC-Net module in PyTorch-1.0+
https://github.com/vt-vl-lab/pwc-net.pytorch
optical-flow
Last synced: over 1 year ago
JSON representation
Off-the-shelf PWC-Net module in PyTorch-1.0+
- Host: GitHub
- URL: https://github.com/vt-vl-lab/pwc-net.pytorch
- Owner: vt-vl-lab
- License: lgpl-3.0
- Created: 2019-06-13T06:46:35.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T05:15:21.000Z (over 3 years ago)
- Last Synced: 2025-03-26T15:21:19.084Z (over 1 year ago)
- Topics: optical-flow
- Language: Python
- Homepage:
- Size: 64 MB
- Stars: 32
- Watchers: 4
- Forks: 6
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## PWC-Net (PyTorch v1.0.1)
Pytorch implementation of [PWC-Net: CNNs for Optical Flow Using Pyramid, Warping, and Cost Volume](https://arxiv.org/pdf/1709.02371.pdf). We made it as a off-the-shelf package:
- After installation, just copy the whole folder `PWC_src` to your codebase to use. See demo.py for details.
### Environment
This code has been test with Python3.6 and PyTorch1.0.1, with a Tesla K80 GPU. The system is Ubuntu 14.04, and the CUDA version is 10.0. All the required python packages can be found in `requirements.txt`.
### Installation
# install custom layers
cd PWC_src/correlation_package
python setup.py install
Note: you might need to add `gencode` [here](https://github.com/vt-vl-lab/pwc-net.pytorch/blob/master/PWC_src/correlation_package/setup.py#L9), according to the GPU you use. You can find more information about `gencode` [here](https://developer.nvidia.com/cuda-gpus) and [here](http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/).
### Converted Caffe Pre-trained Models
You can find them in `models` folder.
### Inference mode
Modify the path to your input, then
```
python demo.py
```
If installation is sucessful, you should see the following:

### Reference
If you find this implementation useful in your work, please acknowledge it appropriately and cite the paper using:
````
@inproceedings{sun2018pwc,
title={PWC-Net: CNNs for optical flow using pyramid, warping, and cost volume},
author={Sun, Deqing and Yang, Xiaodong and Liu, Ming-Yu and Kautz, Jan},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
pages={8934--8943},
year={2018}
}
````
### Acknowledgments
* [sniklaus/pytorch-pwc](https://github.com/sniklaus/pytorch-pwc): Network defintion and converted PyTorch model weights.
* [NVIDIA/flownet2-pytorch](https://github.com/NVIDIA/flownet2-pytorch): Correlation module.