Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.


Repository files navigation

Optical Flow by Google Research VisCam


Dataset, code, and checkpoints for two optical flow papers from Google Research Viscam.

Disentangling Architecture and Training for Optical Flow
Deqing Sun*,T, Charles Herrmann*, Fitsum Reda, Michael Rubinstein, David Fleet, William T. Freeman
Google Research
In ECCV 2022. * denotes equal technical contribution, T denotes project lead.

Teaser image.

Left: Large improvements with newly trained PWC-Net, IRR-PWC and RAFT (left: originally published results in blue; results of our newly trained models in red). The newly trained RAFT is more accurate than all published methods on KITTI 2015 at the time of writing.

Right: Visual comparison on a Davis sequence between the original [43] and our newly trained PWC-Net and RAFT, shows improved flow details, e.g. the hole between the cart and the person at the back. The newly trained PWC-Net recovers the hole between the cart and the front person better than RAFT.

AutoFlow: Learning a Better Training Set for Optical Flow
Deqing Sun, Daniel Vlasic , Charles Herrmann, Varun Jampani, Michael Krainin, Huiwen Chang, Ramin Zabih, William T. Freeman, Ce Liu
Google Research
In CVPR 2021 (Oral).


Pre-trained Models

Create a directory where you can keep large files. Ideally, not in this directory.

> mkdir <pretrained_models>

Download pre-trained TF2 Saved Models from google drive and put into <pretrained_models>.

The downloaded folder should have the following structure:

├── eccv_disentangling_architecture_and_train/
│   ├── pwc_it_pre/
│   ├── pwc_it_ft/
│   ├── raft_it_pre/
│   ├── raft_it_ft/

Running the optical flow network

To run inference on examples frames we will use the "OpticalFlow-Inference.ipynb" colab in colabs/. To run the colab, make sure that you have installed all the required packages with the following command.

> pip install -r requirements.txt

Then make sure you have the pre-trained models downloaded to the correct folder as shown in the section above. Then start a colab kernel using the follow command.

> jupyter notebook --NotebookApp.allow_origin='' --port=8888   -NotebookApp.port_retries=0

Then navigate to the "OpticalFlow-Inference.ipynb" and run all the cells.

Inference example.

Example of retrained PWC-Net from our most recent submission (run in this inference colab)


The src/ directory currently contains the augmentation module (the Improved Training result uses the "pwc" augmentation from the augmentations module). The full train loop will be posted soon.


If you find this useful in your works, please acknowledge it appropriately by citing:

  title={Disentangling Architecture and Training for Optical Flow},
  author={Sun, Deqing and Herrmann, Charles and Reda, Fitsum and Rubinstein, Michael and Fleet, David and Freeman, William T},
  journal={arXiv preprint arXiv:2203.10712},
  title={Autoflow: Learning a better training set for optical flow},
  author={Sun, Deqing and Vlasic, Daniel and Herrmann, Charles and Jampani, Varun and Krainin, Michael and Chang, Huiwen and Zabih, Ramin and Freeman, William T and Liu, Ce},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},

Contact: Deqing Sun (deqingsun @ and Charles Herrmann (irwinherrmann @

Coding style

  • 2 spaces for indentation
  • 80 character line length
  • PEP8 formatting


This is not an officially supported Google product.


No description, website, or topics provided.







No releases published