Giter Site home page Giter Site logo

lawy623 / svs Goto Github PK

View Code? Open in Web Editor NEW
281.0 13.0 61.0 17.76 MB

Code Repo for "Single View Stereo Matching" (CVPR'18 Spotlight)

CMake 0.37% Makefile 0.59% HTML 0.05% CSS 0.21% C++ 78.69% Cuda 10.48% MATLAB 1.77% Python 7.42% Shell 0.35% Dockerfile 0.06%

svs's Introduction

Single View Stereo Matching

This repo includes the source code of the paper: "Single View Stereo Matching" (CVPR'18 Spotlight) by Yue Luo*, Jimmy Ren*, Mude Lin, Jiahao Pang, Wenxiu Sun, Hongsheng Li, Liang Lin.

Contact: Yue Luo ([email protected])

Prerequisites

The code is tested on 64 bit Linux (Ubuntu 14.04 LTS). You should also install Matlab (We have tested on R2015a). We have tested our code on GTX TitanX with CUDA8.0+cuDNNv5. Please install all these prerequisites before running our code.

Installation

  1. Get the code.

    git clone https://github.com/lawy623/SVS.git
    cd SVS
  2. Build the code. Please follow Caffe instruction to install all necessary packages and build it.

    cd caffe/
    # Modify Makefile.config according to your Caffe installation/. Remember to allow CUDA and CUDNN.
    make -j8
    make matcaffe
  3. Prepare data. We write all data and labels into .mat files.

  • Please go to directory data/, and run get_data.sh to download Kitti Stereo 2015 and Kitti Raw datasets.
  • To create the .mat files, please go to directory data, and run the matlab scripts prepareTrain.m and prepareTest.m respectively. It will take some time to prepare data.
  • If you only want to test our models, you can simply downloads the Eigen test file at [GoogleDrive|BaiduPan]. Put this test .mat file in /data/testing/.

Training

View Synthesis Network

  • As described in our paper, we develop our View Synthesis Network based on the Deep3D method. Directly training the final model indicated in our paper using VGG16 initialization will easily sink into local optimum. We first keep the BatchNorm layers and train the model with VGG16 initialization. Go to training/ to run train_viewSyn.m. You can also run the matlab scripts from terminal at directory training/ by following commands. By default matlab is installed under /usr/local/MATLAB/R2015a. If the location of your matlab is not the same, please modify train_ViewSyn.sh if want to run the scripts from terminal. Download the VGG16 at [GoogleDrive|BaiduPan], and put it under training/prototxt/viewSynthesis_BN/preModel/ before finetuning. We train such a BN model for roughly 30k iterations.
   ## To run the training matlab scripts from terminal
   sh prototxt/viewSynthesis/train_ViewSyn.sh   #To trained the view synthesis network
  • We further remove the Batch Norm layers and obtain a better performance. Rename the trained BN model (in training/prototxt/viewSynthesis_BN/caffemodel) mentioned above as viewSyn_BN.caffemodel. Or you can directly download ours at [GoogleDrive|BaiduPan] and place it in the correct place. Change line 11 of train_viewSyn.m to be ‘model = param.model(2);’, and run train_viewSyn.m again.

Stereo Matching Network

  • We do not provide the training code for training this stereo matching network. We follow CRL and use their trained model. Relevant model settings can be found in training/prototxt/stereo/.

Single View Stereo Matching - End-to-end finetune.

  • To finetune our svs model, please first download the pretrain models for two sub-networks. Download View Synthesis Network at [GoogleDrive|BaiduPan], and put it under training/prototxt/viewSynthesis/caffemodel/. Download Stereo Matching Network. You can download the model trained on FlyingThings synthetic dataset at [GoogleDrive|BaiduPan], and a model further finetuned on Kitti Stereo 2015 at [GoogleDrive|BaiduPan]. Put the downloaded models under training/prototxt/stereo/caffemodel/
  • Go to training/ to run train_svs.m. You can also run the matlab scripts from terminal at directory training/ by following commands.
   ## To run the training matlab scripts from terminal
   sh prototxt/svs/train_svs.sh   #To trained the svs network

Testing

  • Downloads the Eigen test file at [GoogleDrive|BaiduPan]. Put this test .mat file in /data/testing/. Or you can follow the data preparation step mentioned above. Download svs model at [GoogleDrive|BaiduPan], and put it under training/prototxt/svs/caffemodel/.
  • Go to directory testing/. Run test_svs.m to get the result before finetune. Please make sure to have downloaded the trained View Synthesis Network and Stereo Matching Network. Run test_svs_end2end.m to get our state-of-the-art result on monocular depth estimation.
  • If you want to get some visible results, change line 4 of test_svs.m or test_svs_end2end.m to be ‘visual = 1;’.

Results

  • Some of our qualitative results are shown here.

  • We provide the quantitative results on KITTI Eigen Test Set (697 imgs). Download it here.

Citation

Please cite our paper if you find it useful for your work:

@InProceedings{Luo2018SVS,
    title={Single View Stereo Matching},
    author={Yue Luo, Jimmy Ren, Mude Lin, Jiahao Pang, Wenxiu Sun, Hongsheng Li, Liang Lin},
    booktitle ={CVPR},
    year={2018},
}


svs's People

Contributors

lawy623 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

svs's Issues

A question about the article

Why is the algorithm in the article semi-supervised learning? is it because there is no ground truth participation in the View synthesis network? I am a little confused, I hope you can solve this doubt for me.

No rule to make target 'matcaffe'

Hi, I did:
make
make all
make runtest
make pycaffe
But When trying to make matcaffe,it's a message:
zgh@zgh-MS:~/Downloads/caffe$ sudo make matcaffe
make: *** No rule to make target 'matcaffe'. Stop.
On ubuntu 16.04.Thanks a lot.

Python code

Is there python code for just running a test image?

Generated Right Image

Hello,
I did not find anything that shows the generated right image from the view synthesis network. Even the .mat file shows the input image, generated disparity and ground truth disparity only. I think it would be beneficial if the generated right images would also be shared. So can you please share them with us if that is possible.

MATLAB crashes when I run test_svs.m

I open Matlab in both terminal and program and run test_svs.m but neither of them worked. The error lists below:
Configuration:
Crash Decoding : Disabled
Crash Mode : continue (default)
Current Graphics Driver: Unknown software
Current Visual : None
Default Encoding : UTF-8
GNU C Library : 2.19 stable
Host Name : ASUS
MATLAB Architecture : glnxa64
MATLAB Root : /usr/local/MATLAB/R2015a
MATLAB Version : 8.5.0.197613 (R2015a)
OpenGL : software
Operating System : Linux 4.4.0-31-generic #50~14.04.1-Ubuntu SMP Wed Jul 13 01:07:32 UTC 2016 x86_64
Processor ID : x86 Family 6 Model 158 Stepping 10, GenuineIntel
Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : No active display

Fault Count: 1

Abnormal termination:
Segmentation violation

I have the same environment as yours, Ubuntu 14 and CUDA8.
Can anyone help me with this problem. I have tried solutions on the Internet but failed.

Loading Premodel while testing crashes Matlab

test_svs_end2end.txt

Crashes Matlab at line 30 with the error:
~/MATLAB/R2015a/bin$ ./matlab
[libprotobuf ERROR google/protobuf/text_format.cc:245] Error parsing text-format caffe.NetParameter: 2975:21: Message type "caffe.LayerParameter" has no field named "correlation_param".
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0619 10:24:54.848625 9036 upgrade_proto.cpp:90] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse NetParameter file: ../training/prototxt/svs/svs_deploy.prototxt
*** Check failure stack trace: ***
Killed

My Ubuntu, Cuda and Cudnn versions are just as the project specifies them to be, my Protoc version is
libprotoc 2.5.0

Thanks A lot...

protobuf version

when i compile cafe , i got this issue:
./include/caffe/proto/caffe.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
my protoc version is 2.4.1 which is never got this issue when compile other caffe

matlab crashes when openning testKittiEigen.mat

Hi,

I'm trying to test the network but when I run the test_svs.m script the Matlab crashes in line 25 when it tries to load the file testKittiEigen.mat

testSet = load('../data/testing/testKittiEigen.mat');

The crash log is:


   Segmentation violation detected at Tue Jun 26 13:02:29 2018

Configuration:
Crash Decoding : Disabled - No sandbox or build area path
Crash Mode : continue (default)
Current Graphics Driver: Unknown hardware
Current Visual : 0x21 (class 4, depth 24)
Default Encoding : UTF-8
Deployed : false
GNU C Library : 2.23 stable
Host Name : lrvc-workstation
MATLAB Architecture : glnxa64
MATLAB Entitlement ID: 6257193
MATLAB Root : /usr/local/MATLAB/R2017a
MATLAB Version : 9.2.0.538062 (R2017a)
OpenGL : hardware
Operating System : Linux 4.13.0-45-generic #50~16.04.1-Ubuntu SMP Wed May 30 11:18:27 UTC 2018 x86_64
Processor ID : x86 Family 6 Model 158 Stepping 9, GenuineIntel
Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Window System : The X.Org Foundation (11905000), display :0

Fault Count: 1

Abnormal termination:
Segmentation violation

Register State (from fault):
RAX = 0000000000000001 RBX = 00007f699fbb1370
RCX = 00007f699c000000 RDX = 0000000000000000
RSP = 00007f69a9a8ce18 RBP = 0000000000000000
RSI = 00007f699fbb11e0 RDI = 0000000000000000

R8 = 00007f699fbb1640 R9 = 0000000000000000
R10 = 0000000000000001 R11 = 00007f69c93494f0
R12 = 00007f699fbb11e0 R13 = 0000000000000001
R14 = 0000000059e3eaef R15 = 000000000a000008

RIP = 00007f69adffda54 EFL = 0000000000010202

CS = 0033 FS = 0000 GS = 0000

Stack Trace (from fault):
[ 0] 0x00007f69adffda54 /usr/local/MATLAB/R2017a/bin/glnxa64/libhdf5.so.8+01165908 H5O_dec_rc+00000020
[ 1] 0x00007f69ae00c82f /usr/local/MATLAB/R2017a/bin/glnxa64/libhdf5.so.8+01226799
[ 2] 0x00007f69adf4d4ee /usr/local/MATLAB/R2017a/bin/glnxa64/libhdf5.so.8+00443630 H5C_protect+00000126
[ 3] 0x00007f69adf34a2c /usr/local/MATLAB/R2017a/bin/glnxa64/libhdf5.so.8+00342572 H5AC_protect+00000108
[ 4] 0x00007f69adff9c34 /usr/local/MATLAB/R2017a/bin/glnxa64/libhdf5.so.8+01150004 H5O_protect+00000420
[ 5] 0x00007f69adffbaf4 /usr/local/MATLAB/R2017a/bin/glnxa64/libhdf5.so.8+01157876 H5O_get_info+00000084
[ 6] 0x00007f69adfb1986 /usr/local/MATLAB/R2017a/bin/glnxa64/libhdf5.so.8+00854406
[ 7] 0x00007f69adfc5ba3 /usr/local/MATLAB/R2017a/bin/glnxa64/libhdf5.so.8+00936867
[ 8] 0x00007f69adfc5c9a /usr/local/MATLAB/R2017a/bin/glnxa64/libhdf5.so.8+00937114 H5G_traverse+00000138
...
[ 53] 0x00007f69b798656e bin/glnxa64/libmwmcr.so+00554350
[ 54] 0x00007f69b7986901 bin/glnxa64/libmwmcr.so+00555265
[ 55] 0x00007f69b7974206 bin/glnxa64/libmwmcr.so+00479750
[ 56] 0x00007f69c96966ba /lib/x86_64-linux-gnu/libpthread.so.0+00030394
[ 57] 0x00007f69c93cc41d /lib/x86_64-linux-gnu/libc.so.6+01078301 clone+00000109
[ 58] 0x0000000000000000 +00000000

I've tried to open this file with the Matlab 2017a, 2015a, and octave and in all of them the segmentation occurs.

Thanks for the help,
Bests

"make -j8"error

When I run ”make -j8",
.......
CXX src/caffe/layers/generate_augmentation_parameters_layer.cpp
src/caffe/util/util_img.cpp:709:33: error: redeclaration of ‘template cv::Mat caffe::BlobToGrayImage(const caffe::Blob*, int, int, Dtype)’ may not have default arguments [-fpermissive]
const Dtype scale = Dtype(1.0)) {
^
Makefile:596: recipe for target '.build_release/src/caffe/util/util_img.o' failed
make: *** [.build_release/src/caffe/util/util_img.o] Error 1
make: *** Waiting for unfinished jobs....

Thank you very much!

matlab version

Hello!
I used Matlab 2017a. When I run "make mattest ", I faced the problem:

Invalid MEX-file '/home/zgh/caffe/matlab/+caffe/private/caffe_.mexa64':
......
Error in caffe.set_mode_cpu (line 5)
caffe_('set_mode_cpu');
Error in caffe.run_tests (line 6)
caffe.set_mode_cpu();
......
I want to ask how to solve it ? Or which Matlab version you used ? Thanks very very much!

Make caffe error

NVCC src/caffe/layers/resample_layer.cu
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
./include/thirdparty/gpu/gpu.hpp(432): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(438): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1265): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1266): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1267): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1285): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1287): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1288): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1289): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1291): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1295): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1300): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1301): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1301): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1303): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1305): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1835): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1836): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1838): error: vector is not a template

./include/thirdparty/gpu/gpu.hpp(1839): error: vector is not a template

20 errors detected in the compilation of "/tmp/tmpxft_00000d76_00000000-19_resample_layer.compute_61.cpp1.ii".
Makefile:594: recipe for target '.build_release/cuda/src/caffe/layers/resample_layer.o' failed
make: *** [.build_release/cuda/src/caffe/layers/resample_layer.o] Error 1
make: *** 正在等待未完成的任务....
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
./include/caffe/parallel.hpp(99): warning: type qualifier on return type is meaningless

./include/caffe/parallel.hpp(99): warning: type qualifier on return type is meaningless

./include/caffe/parallel.hpp(99): warning: type qualifier on return type is meaningless

./include/caffe/parallel.hpp(99): warning: type qualifier on return type is meaningless

./include/caffe/parallel.hpp(99): warning: type qualifier on return type is meaningless

./include/caffe/parallel.hpp(99): warning: type qualifier on return type is meaningless

./include/caffe/parallel.hpp(99): warning: type qualifier on return type is meaningless

./include/caffe/parallel.hpp(99): warning: type qualifier on return type is meaningless

nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
nvcc warning : The 'compute_20', 'sm_20', and 'sm_21' architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).

it seems that the new added layer have some bug ...
btw: i can make the origin caffe successfully , but when make the caffe you provide , i encounter this error.
[ubuntu16.04 cuda8.0 cudnn5.1]

caffe version

Thanks for your work~, What is the version of caffe used?

opencv error

whien i compile caffe, i got some opencv issue about gpu
can anyone told me something about why i got this problem

already check /usr/include/opencv2 has this file
but /usr/local/opencv2 does't have this file

./include/thirdparty/gpu/gpu.hpp:52:35: fatal error: opencv2/core/gpumat.hpp: No such file or directory

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.