This is the official implementation of 'Learning Optical Flow with Adaptive Graph Reasoning', named as 'AGFlow' for short, AAAI 2022, [paper]
Estimating per-pixel motion between video frames, known as optical flow, is a long-standing problem in video understanding and analysis. Most contemporary optical flow techniques largely focus on addressing the cross-image matching with feature similarity, with few methods considering how to explicitly reason over the given scene for achieving a holistic motion understanding. In this work, taking a fresh perspective, we introduce a novel graph-based approach, called adaptive graph reasoning for optical flow (AGFlow), to emphasize the value of scene/context information in optical flow. Our key idea is to decouple the context reasoning from the matching procedure, and exploit scene information to effectively assist motion estimation by learning to reason over the adaptive graph. The proposed AGFlow can effectively exploit the context information and incorporate it within the matching procedure, producing more robust and accurate results. On both Sintel clean and final passes, our AGFlow achieves the best accuracy with EPE of 1.43 and 2.47 pixels, outperforming state-of-the-art approaches by 11.2% and 13.6%, respectively.
We propose a novel graph-based approach, called adaptive graph reasoning for optical flow (AGFlow), to emphasize the value of scene context in optical flow. Our key idea is to decouple the context reasoning from the matching procedure, and exploit scene information to effectively assist motion estimation by learning to reason over the adaptive graph.
Python 3.6 with following packages
pytorch==1.6.0
torchvision==0.7.0
matplotlib
scipy
opencv-python
tensorboard
(The code has been tested on Cuda 10.0.)
-
The trained weights are available on GoogleDrive. Put
*.pth
files into folder./weights
. -
Download Sintel and KITTI dataset, and set the root path of each class in
./core/datasets.py
. -
Evaluation on Sintel
./eval_sintel.sh
- Evaluation on KITTI
./eval_kitti.sh
If you think this work is helpful, please cite
@InProceedings{luo2022learning,
title={Learning Optical Flow with Adaptive Graph Reasoning},
author={Luo, Ao and Yang, Fan and Luo, Kunming and Li, Xin and Fan, Haoqiang and Liu, Shuaicheng},
booktitle={Proceedings of the AAAI Conference on Artificial Intelligence (AAAI)},
year={2022},
}
If you have any questions, please contact me at (aoluo_uestc@hotmail.com).
The main framework is adapted from RAFT. We thank the authors for the contribution.