==================================================== This is an initial commit implementing InterpoNet, A brain inspired neural network for optical flow dense interpolation by Shay Zweig and Lior Wolf from Tel Aviv University (link)
InterpoNet achieved state-of-the-art results in November 2016 on the MPI-Sintel and KITTI2012 Optical Flow benchmarks.
The code was developed on Ubuntu 14.04, using Tensorflow. You can see the performance it achieved on the KITTI2012 and MPI-Sintel optical flow scoreboards.
For now only the code for inference is uploaded, we will upload the training code soon.
virtualenv --no-site-packages env
source env/bin/activate
git clone https://github.com/shayzweig/InterpoNet
pip install
) : numpy (tested version: 1.11.2), scikit-image (tested version: 0.12.3). (other dependencies such as cython might be required)cd SrcVariational
make
- the comilation should run without errors.Test your installation by running the following command from the root folder of InterpoNet:
python InterpoNet.py example/frame_0001.png example/frame_0002.png example/frame_0001.dat example/frame_0001.txt example/frame_0001.flo --ba_matches_filename=example/frame_0001_BA.txt --sintel
No errors should be displayed
The program was only tested under a 64-bit Linux distribution with tensorflow version 0.10 . We do not give any support for compilation issues or other OS.
The input to the algorithm is divided into three components:
The two images in the image pair they must have the same shape and they are only used for the variational energy minimization.
A matching file produced by a matching algorithm. The format of the matching file should be as follows: A text file, each match should be preseted in a different row which should include the source and target coordinates seperated with spaces: x1 y1 x2 y2
Any additional information in the row (such as match score) is discarded.
To compute the matches - you can use any matching algorithm. The best results we obtained were on [FlowFields] (https://www.dfki.de/web/research/publications?pubid=7987)
To run the InterpoNet pipeline, use the following syntax:
python interponet.py <img1_filename> <img2_filename> <edges_filename> <matches_filename> <out_filename> [optional --model_filename model_filename] [optional --ba_matches_filename ba_matches_filename] [optional --img_width img_width] [optional --img_height img_height] [optional --downscale downscale] [optional --sintel]
Example use:
python InterpoNet.py example/frame_0001.png example/frame_0002.png example/frame_0001.dat example/frame_0001.txt example/frame_0001.flo --ba_matches_filename=example/frame_0001_BA.txt --sintel
Mandatory:
optional:
The output flow file is in the same format as the flow maps in the MPI-Sintel dataset. The provided function: load_flow_file in io_utils.py loads the file into an h x w x 2 matrix.
InterpoNet was built with the help of the following great software pieces: