Git Product home page Git Product logo

dicl-flow's Introduction

DICL-Flow

This repository contains the code for our NeurIPS 2020 paper Displacement-Invariant Matching Cost Learning for Accurate Optical Flow Estimation.

@article{wang2020displacement,
  title={Displacement-Invariant Matching Cost Learning for Accurate Optical Flow Estimation},
  author={Wang, Jianyuan and Zhong, Yiran and Dai, Yuchao and Zhang, Kaihao and Ji, Pan and Li, Hongdong},
  journal={Advances in Neural Information Processing Systems},
  volume={33},
  year={2020}
}

Requirements

PyTorch 1.1, CUDA 9.0, and other dependencies (e.g., torchvision, tqdm). You can create a virtual environment and use pip to install the requirements. You may also install the dependencies manually.

conda create -n dicl python=3.6
conda activate dicl
pip install -r requirements.txt

Dataset

We conduct experiments on the FlyingChairs, FlyingThings3D, MPI Sintel, and KITTI optical flow datasets.

My dataset structure is listed below. You can put data at any place and set the --data flag of main.py correspondingly.

├── dataset
    ├── FlyingChairs_release
        ├── data
    ├── FlyingThings3D_subset
        ├── train
        ├── val
    ├── Sintel
        ├── training
        ├── test
    ├── KITTI2012
        ├── training
        ├── testing
    ├── KITTI2015
        ├── training
        ├── testing

Pretrained Weights

Pretrained models can be downloaded from google drive.

Training

As discussed in our paper, the training on the FlyingChairs dataset is divided into three phases for a good initialization (only single phase on other three datasets). We assume using eight GPUs while empirically the number of GPUs does not affect the final performance. You can use the commands like below:

# Chair 0 phase, only simple augmentation is applied in the first phase.
# Please note each epoch contains around 350 iteration on FlyingChairs, 22232/64
python main.py -b 64 --lr 0.001 --epochs 120 --exp_dir dicl0_chair --cfg cfgs/dicl0_chair.yml \
--data /Path/To/FlyingChairs --dataset flying_chairs

# Chair 1 phase, using context network now.
python main.py -b 64 --lr 0.001 --epochs 120 --exp_dir dicl1_chair --cfg ../cfgs/dicl1_chair.yml \
--pretrained /Path/To/dicl0/checkpoint_best.pth.tar --data /Path/To/FlyingChairs --dataset flying_chairs

# Chair 2 phase, using Displacement Aware Projection layer now.
# Drop the learning rate by half at epoch 10.
python main.py -b 64 --lr 0.001 --epochs 120 --exp_dir dicl2_chair --cfg ../cfgs/dicl2_chair.yml --milestones 10 \
--pretrained /Path/To/dicl1/checkpoint_best.pth.tar --data /Path/To/FlyingChairs --dataset flying_chairs

For other datasets, just use one command, e.g.,

python main.py -b 16 --lr 0.00025 --epochs 50 --pretrained /Path/To/dicl2/checkpoint_best.pth.tar
--exp_dir dicl3_thing --cfg cfgs/dicl3_thing.yml --data /Path/To/FlyingThings --dataset flying_things

Evaluation

You can evaluate a trained model like below, where -e indicates evaluation:

# Sintel Dataset
python main.py -b 1 -e --pretrained pretrained/ckpt_sintel.pth.tar --cfg cfgs/dicl4_sintel.yml \
--data /Path/To/Sintel/Dataset --exp_dir /Path/To/Save/Log --dataset mpi_sintel_clean 

# KITTI Dataset
python main.py -b 1 -e --pretrained pretrained/ckpt_kitti.pth.tar --cfg cfgs/dicl5_kitti.yml \
--data /Path/To/KITTI/Dataset --exp_dir /Path/To/Save/Log --dataset KITTI

Acknowledgment

Our codes were developed on the basis of FlowNetPytorch and VCN. After the paper acceptation, we updated the part of Dataloader, learning from RAFT. Thanks a lot for their excellent works.

dicl-flow's People

Contributors

jytime avatar timetomakesense avatar joigalcar3 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.