This implements the full pipeline of our paper Improved Stereo Matching with Constant Highway Networks and Reflective Loss by Amit Shaked and Lior Wolf
The repository contains
nn
, cunn
, and cudnn
.The code is released under the BSD 2-Clause license. Please cite our paper if you use code from this repository in your work.
@article{shaked2016stereo,
title={Improved Stereo Matching with Constant Highway Networks and Reflective Loss},
author={Shaked, Amit and Wolf, Lior},
journal={arXiv preprint arxiv:1701.00165},
year={2016}
}
Create directory for the data to be stored and link it under the name "storage" where the README file is
ln -s [your_dir] storage
Or simply create a storage directory
mkdir storage
Run mkdirs script:
scripts/mkdirs.sh
Compile the shared libraries:
make
The command should produce the files: libadcensus.so
, libcv.so
and libcuresmatch.so
in the lib dir.
storage/data.kitti/unzip
(you should end up with a file storage/data.kitti/unzip/training/image_0/000000_10.png
) and storage/data.kitti2015/unzip
(you should end up with a file storage/data.kitti2015/unzip/training/image_2/000000_10.png
).Run the preprocessing script:
scripts/preprocess_kitti.lua -color rgb -storage storage
It should output:
dataset 2012
1
...
389
dataset 2015
1
...
400
Run download_middlebury.sh
to download the training data
(this can take a long time, depending on your internet connection).
scripts/download_middlebury.sh
The data set is downloaded into the data.mb/unzip
directory.
Compile the MiddEval3-SDK. You
should end up with the computemask
binary in one of the directories listed in
your PATH
enviromential variable.
Install ImageMagick; the
preprocessing steps requires the convert
binary to resize the images.
Run the preprocessing script:
mkdir storage/data.mb.imperfect_gray
scripts/preprocess_mb.py imperfect gray
It should output:
Adirondack
Backpack
...
testH/Staircase
The preprocessing is slow (it takes around 30 minutes) the first time it is run, because the images have to be resized.
Enter the src directory.
The main.lua
file contains different training and testing options:
See opts.lua
for other options.
Try training the hybrid Resmatch matching cost network:
th main.lua -ds kitti -a train_mcn -mc resmatch -m hybrid
And then training the gdn with the reflective loss, using this matching cost network:
th main.lua -ds kitti -a train_gdn -mc resmetch -m hybrid -mcnet ../storage/net/mc/kitti_resmatch_hybrid_LL_rgb.t7 -gdn ref
You can also try training the fast resmatch architecture, on 0.2 of the data, and test it every 3 epochs:
th main.lua -ds kitti -a train_mcn -mc resmatch -m fast -debug -times 3 -subset 0.2