Coder Social home page Coder Social logo

liuguoyou / arflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lliuz/arflow

0.0 2.0 0.0 67.46 MB

The official PyTorch implementation of the paper "Learning by Analogy: Reliable Supervision from Transformations for Unsupervised Optical Flow Estimation".

License: MIT License

Dockerfile 0.96% Python 81.16% C++ 5.41% Cuda 12.48%

arflow's Introduction

ARFlow โ€” Official PyTorch Implementation

Python 3.6 PyTorch 1.1.0 License MIT

This repository contains the official PyTorch implementation of the paper "Learning by Analogy: Reliable Supervision from Transformations for Unsupervised Optical Flow Estimation".

For any inquiries, please contact Liang Liu at [email protected]

Using the Code

Requirements

This code has been developed under Python3, PyTorch 1.1.0 and CUDA 9.0 on Ubuntu 16.04.

We strongly recommend that using docker to ensure you can get the same results as us. The Dockerfile is available. Also, you can build the environment by following:

# Install python packages
pip3 install -r requirements.txt

# Compile the coorelation package with gcc and g++ >= 4.9
cd ./models/correlation_package
python3 setup.py install

# Additional dependencies for training
sudo apt-get update && apt-get install -y libsm6 libxext6 libxrender-dev
pip3 install 'opencv-python>=3.0,<4.0' path.py tensorboardX fast_slic

If you have any trouble with the correlation package, we also provide an alternative implementation. You can modify the import lines in models/pwclite.py to use it.

Inference

The checkpoints folder contains the pre-trained models of ARFlow and ARFlow-mv for various datasets.

A minimal example of using a pre-trained is given in inference.py. For two-view models, just run with:

python3 inference.py -m checkpoints/KITTI15/pwclite_ar.tar -s 384 640 \
  -i examples/img1.png examples/img2.png

For multi-view model, input with 3 frames:

python3 inference.py -m checkpoints/KITTI15/pwclite_ar_mv.tar -s 384 640 \
  -i examples/img0.png examples/img1.png examples/img2.png

We recommend input with 384x640 for KITTI and Cityscapes models, 448x1024 for Sintel models.

Training

Here we provide the complete training pipeline for ARFlow on Sintel dataset:

  1. Pre-train on the Sintel raw movie. Also, you can skip this step with our pretrained model.

    python3 train.py -c sintel_raw.json
  2. Fine-tune on the Sintel training set. We provide both settings for training with or without AR for your convenience.

    # without AR
    python3 train.py -c sintel_ft.json
    # with AR
    python3 train.py -c sintel_ft_ar.json

The default configuration uses the whole training set for training and validation. We strongly recommend you use the re-split sets as in our ablation studies. You can modify the config file by setting train_subsplit to 'train' and setting val_subsplit to 'val'.

Evaluation

Also, a complete evaluation for a model can be simply run with the option -e, for example:

python3 train.py -c configs/sintel_ft.json -m checkpoints/Sintel/pwclite_ar.tar -e 

Datasets in the paper

Due to copyright issues, please download the dataset from the official websites.

We have upload the Sintel Raw dataset to Google Drive and Baidu Cloud (Key: mxe9). This dataset is created by manually dividing all frames into folders by shot. It should follow the license in the Sintel benchmark.

Citation

If you think this work is useful for your research, please consider citing:

@inproceedings{liu2020learning,
   title = {Learning by Analogy: Reliable Supervision from Transformations for Unsupervised Optical Flow Estimation},
   author = {Liu, Liang and Zhang, Jiangning and He, Ruifei and Liu, Yong and Wang, Yabiao and Tai, Ying and Luo, Donghao and Wang, Chengjie and Li, Jilin and Huang, Feiyue},
   booktitle = {IEEE Conference on Computer Vision and Pattern Recognition(CVPR)},
   year = {2020}
}

Acknowledgements

We thank Pengpeng Liu for in-depth discussions and helpful comments. Also, we thank for portions of the source code from some great works such as Fast-SLIC, IRR.

arflow's People

Contributors

lliuz avatar

Watchers

 avatar paper2code - bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.