• Stars
    star
    124
  • Rank 288,207 (Top 6 %)
  • Language
    Lua
  • License
    BSD 3-Clause "New...
  • Created about 8 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for the NIPS 2016 paper

Single-Image Depth Perception in the Wild

Code for reproducing the results in the following paper:

Single-Image Depth Perception in the Wild,
Weifeng Chen, Zhao Fu, Dawei Yang, Jia Deng
Neural Information Processing Systems (NIPS), 2016.

Please check out the project site for more details.

Setup

  1. Install the Torch 7 framework as described in http://torch.ch/docs/getting-started.html#_. Please make sure that you have the cudnn, hdf5 and csvigo modules installed.

  2. Clone this repo.

     git clone https://github.com/wfchen-umich/relative_depth.git
    
  3. Download and extract the DIW dataset from the project site. Download and extract DIW_test.tar.gz and DIW_train_val.tar.gz into 2 folders. Run the following command to download and extract DIW_Annotations.tar.gz. Then modify the filepath to images in DIW_test.csv, DIW_train.csv and DIW_val.csv to be the absolute file path where you extracted DIW_test.tar.gz and DIW_train_val.tar.gz.

     cd relative_depth
     mkdir data
     cd data
     wget https://vl-lab.eecs.umich.edu/data/nips2016/DIW_Annotations_splitted.tar.gz
     tar -xzf DIW_Annotations_splitted.tar.gz
     rm DIW_Annotations_splitted.tar.gz
    

Training and evaluating the networks

Testing on pre-trained models

Please first run the following commands to download the test data from our processed NYU dataset and the pre-trained models:

cd relative_depth
wget https://vl-lab.eecs.umich.edu/data/nips2016/data.tar.gz
tar -xzf data.tar.gz
rm data.tar.gz
cd data
python convert_csv_2_h5.py -i 750_train_from_795_NYU_MITpaper_train_imgs_800_points_resize_240_320.csv
python convert_csv_2_h5.py -i 45_validate_from_795_NYU_MITpaper_train_imgs_800_points_resize_240_320.csv

cd ../src
mkdir results
cd results
wget https://vl-lab.eecs.umich.edu/data/nips2016/hourglass3.tar.gz
tar -xzf hourglass3.tar.gz
rm hourglass3.tar.gz

Note: You can also download data.tar.gz and hourglass3.tar.gz from Google Drive.

Then change directory into /relative_depth/src/experiment.

  1. To evaluate the pre-trained model Ours(model trained on the NYU labeled training subset) on the NYU dataset, run the following command:

     th test_model_on_NYU.lua -num_iter 1000 -prev_model_file ../results/hourglass3/NYU_795_800_c9_1e-3/Best_model_period1.t7 -test_set 654_NYU_MITpaper_test_imgs_orig_size_points.csv -mode test -thresh 0.9
    
  2. To evaluate the pre-trained model Ours_Full(model trained on the full NYU training set) on the NYU dataset, run the following command:

     th test_model_on_NYU.lua -num_iter 1000 -prev_model_file ../results/hourglass3/1e-3_Drop_205315_NYU_fs_c9/Best_model_period1.t7 -test_set 654_NYU_MITpaper_test_imgs_orig_size_points.csv -mode test -thresh 0.32
    
  3. To evaluate the pre-trained model Ours_DIW(our network trained from scratch on DIW) on the DIW dataset, run the following script:

     th test_model_on_DIW.lua -num_iter 90000 -prev_model_file ../results/hourglass3/AMT_from_scratch_1e-4_release/Best_model_period1.t7 -test_model our
    
  4. To evaluate the trained model Ours_NYU_DIW(our network pre-trained on NYU and fine-tuned on DIW) on the DIW dataset, run the following script:

     th test_model_on_DIW.lua -num_iter 90000 -prev_model_file ../results/hourglass3/AMT_from_205315_1e-4_release/Best_model_period2.t7 -test_model our
    
  5. To test on a single image, we provide a handy script test_on_one_image.lua:

     th test_on_one_image.lua -prev_model_file Model.t7 -input_image input.jpg -output_image output.jpg
    

Training

Please first change directory into /relative_depth/src/experiment.

To train the model Ours(model trained on the NYU labeled training subset), please run the following command:

th main.lua -lr 0.001 -bs 4 -m hourglass3 -it 100000 -t_depth_file 750_train_from_795_NYU_MITpaper_train_imgs_800_points_resize_240_320.csv -v_depth_file 45_validate_from_795_NYU_MITpaper_train_imgs_800_points_resize_240_320.csv -rundir ../results/hourglass3/Ours

To train the model Ours_DIW(our network trained from scratch on DIW), please run the following command:

th main.lua -diw -lr 0.000100 -bs 4 -m hourglass3 -it 200000 -t_depth_file DIW_train.csv -v_depth_file DIW_val.csv -rundir ../results/hourglass3/Ours_DIW

To train the model Ours_NYU_DIW(our network pre-trained on NYU and fine-tuned on DIW), please run the following command:

cd relative_depth/src/results/hourglass3/
mkdir Ours_NYU_DIW
cp 1e-3_Drop_205315_NYU_fs_c9/Best_model_period1.t7 Ours_NYU_DIW/205315_Best_model_period1.t7
cd ../../experiment/
th main.lua -diw -lr 0.000100 -bs 4 -m hourglass3 -it 200000 -t_depth_file DIW_train.csv -v_depth_file DIW_val.csv -start_from 205315_Best_model_period1.t7 -rundir ../results/hourglass3/Ours_NYU_DIW/

More

This work is also featured in the first release of the Wolfram Neural Net Repository. See this article for more details.

More Repositories

1

infinigen

Infinite Photorealistic Worlds using Procedural Generation
Python
5,286
star
2

RAFT

Python
3,189
star
3

CornerNet

Python
2,355
star
4

CornerNet-Lite

Python
1,780
star
5

DROID-SLAM

Python
1,730
star
6

lietorch

Cuda
670
star
7

RAFT-Stereo

Python
667
star
8

DeepV2D

Python
651
star
9

DPVO

Deep Patch Visual Odometry/SLAM
C++
597
star
10

pose-hg-train

Training and experimentation code used for "Stacked Hourglass Networks for Human Pose Estimation"
Jupyter Notebook
575
star
11

pytorch_stacked_hourglass

Pytorch implementation of the ECCV 2016 paper "Stacked Hourglass Networks for Human Pose Estimation"
Python
469
star
12

CoqGym

A Learning Environment for Theorem Proving with the Coq proof assistant
Coq
380
star
13

pose-ae-train

Training code for "Associative Embedding: End-to-End Learning for Joint Detection and Grouping"
Python
373
star
14

pose-hg-demo

Code to test and use the model from "Stacked Hourglass Networks for Human Pose Estimation"
Lua
316
star
15

SEA-RAFT

[ECCV2024 - Oral, Best Paper Award Candidate] SEA-RAFT: Simple, Efficient, Accurate RAFT for Optical Flow
Python
298
star
16

RAFT-3D

Python
229
star
17

SimpleView

Official Code for ICML 2021 paper "Revisiting Point Cloud Shape Classification with a Simple and Effective Baseline"
Python
154
star
18

px2graph

Training code for "Pixels to Graphs by Associative Embedding"
Python
133
star
19

CER-MVS

Python
122
star
20

YouTube3D

Code for the CVPR 2019 paper "Learning Single-Image Depth from Videos using Quality Assessment Networks"
Python
106
star
21

Coupled-Iterative-Refinement

Python
105
star
22

pose-ae-demo

Python
97
star
23

MultiSlam_DiffPose

Jupyter Notebook
94
star
24

SNP

Official code for View Synthesis with Sculpted Neural Points
Python
83
star
25

DecorrelatedBN

Code for Decorrelated Batch Normalization
Lua
80
star
26

SpatialSense

An Adversarially Crowdsourced Benchmark for Spatial Relation Recognition
Python
70
star
27

oasis

Code for the CVPR 2020 paper "OASIS: A Large-Scale Dataset for Single Image 3D in the Wild"
MATLAB
64
star
28

selfstudy

Code for reproducing experiments in "How Useful is Self-Supervised Pretraining for Visual Tasks?"
Python
60
star
29

PackIt

Code for reproducing results in ICML 2020 paper "PackIt: A Virtual Environment for Geometric Planning"
Jupyter Notebook
52
star
30

d3dhelper

Unofficial sample code for Distilled 3D Networks (D3D) in Tensorflow.
Jupyter Notebook
48
star
31

Oriented1D

Official code for ICCV 2023 paper "Convolutional Networks with Oriented 1D Kernels"
Python
44
star
32

SOLID

Python
41
star
33

OGNI-DC

[ECCV24] official code for "OGNI-DC: Robust Depth Completion with Optimization-Guided Neural Iterations"
Python
38
star
34

OcMesher

C++
35
star
35

attach-juxtapose-parser

Code for the paper "Strongly Incremental Constituency Parsing with Graph Neural Networks"
Python
34
star
36

surface_normals

Code for the ICCV 2017 paper "Surface Normals in the Wild"
Lua
33
star
37

MetaGen

Code for the paper "Learning to Prove Theorems by Learning to Generate Theorems"
Objective-C++
30
star
38

FormulaNet

Code for FormulaNet in NIPS 2017
Python
29
star
39

Rel3D

Official code for NeurRIPS 2020 paper "Rel3D: A Minimally Contrastive Benchmark for Grounding Spatial Relations in 3D"
Python
26
star
40

selfstudy-render

Code to generate datasets used in "How Useful is Self-Supervised Pretraining for Visual Tasks?"
Python
22
star
41

think_visually

Code for ACL 2018 paper 'Think Visually: Question Answering through Virtual Imagery'
Python
14
star
42

structured-matching

codes for ECCV 2016
Lua
9
star
43

DPVO_Docker

Shell
8
star
44

uniloss

Python
8
star
45

MetaQNL

Learning Symbolic Rules for Reasoning in Quasi-Natural Language: https://arxiv.org/abs/2111.12038
Julia
6
star
46

PackIt_Extra

Code for generating data in ICML 2020 paper "PackIt: A Virtual Environment for Geometric Planning"
C#
5
star
47

Rel3D_Render

Code for rendering images for NeurRIPS 2020 paper "Rel3D: A Minimally Contrastive Benchmark for Grounding Spatial Relations in 3D"
Python
3
star
48

HYPE-C

Python
1
star