http://www.computationalimaging.org/publications/single_spad/
- Setup and Installation
- Getting and Preprocessing the Data
- Running on NYU Depth v2
- Running on Scanned Data
- Diffuse SPAD Example
- Two Planes Example
- Citation and Contact Info
We recommend using anaconda and creating an environment via the following command.
conda env create -f environment.yml
This will create an environment called single-spad-depth which can be activated via
the command
conda activate single-spad-depth
Download the labeled dataset and the official train/test splits by running the following commands from the root directory
curl http://horatio.cs.nyu.edu/mit/silberman/nyu_depth_v2/nyu_depth_v2_labeled.mat -o ./data/nyu_depth_v2/raw/nyu_depth_v2_labeled.mat
curl http://horatio.cs.nyu.edu/mit/silberman/indoor_seg_sup/splits.mat -o ./data/nyu_depth_v2/raw/splits.mat
Then, run the split script to generate .npz files containing the dataset
parts:
python split_nyuv2.py
To simulate the SPAD on the test set run the command
python simulate_single_spad.py test
-
Scanned
Data for the scanned scenes can be downloaded here. After downloading and extracting the file to the
data/captured/rawdirectory, runpython preprocess_scans.pyto generate
.npyand.ymlfiles with the data and configs necessary to run the model, respectively. -
Scanned + Diffuse
Data available here, download and extract to the
data/captured/rawdirectory. -
Two Planes Image
Data available here, download and extract to the
data/captured/rawdirectory.
DORN, DenseDepth, and MiDaS weights can be downloaded at the following links:
Each should be placed in the relevant *_backend folder in the models directory.
The basic pattern is to run the command
python eval_nyuv2.py \
-c configs/<MDE>/<method.yml>
[--sbr SBR]
[--gpu GPU]
MDE can be dorn, densedepth, or midas.
method.yml can take on the following values:
mde.ymlto run the MDE alone (default) - DORN and DenseDepth only.median.ymlfor median matching - DORN and DenseDepth only.gt_hist.ymlfor ground truth histogram matchingtransient.ymlfor transient matching, note that the--sbroption will need to be set if this is used.
For running on GPU, use the --gpu argument with number indicating which one to
use.
Also provided are three shell scripts, run_all_<method>.sh which will run all
the MDEs on the given method.
Results are automatically saved to
results/<method>/<mde>/[<sbr>]/[summary.npy|preds_cropped.npy] files.
summary.npy is a dictionary of aggregate metrics and can be loaded using
import numpy as np
d = np.load('summary.npy', allow_pickle=True)[()]
preds_cropped.npy contains an N by 440 by 592 numpy array containing the final depth
estimates on the official NYUv2 center crop of each image.
The basic pattern is to run the command:
python eval_captured.py \
--mde-config configs/captured/<mde>.yml \
--scene-config data/captured/processed/<scene>.yml\
--method METHOD \
[--gpu GPU]
mde can be dorn, densedepth, or midas.
scene is one of the above scenes.
METHOD is either mde or transient.
GPU is the number of the gpu to run on.
Also provided are shell scripts of the form run_<scene>.sh which can be run to
run all of the MDEs on that scene. --method still must be specified.
Results are saved in the results_captured folder. A jupyter notebook is
provided for inspecting the results.
A jupyter notebook is provided for running the method on the diffuse spad scene. It also provides a good reference for how to use the API if one wishes to isolate particular parts, such as the MDEs, the transient preprocessing, or the histogram matching.
A jupyter notebook is provided for comparing the transients produced by the scanned and diffuse methods on the two planes image.
M. Nishimura, D. B. Lindell, C. Metzler, G. Wetzstein, “Disambiguating Monocular Depth Estimation with a Single Transient”, European Conference on Computer Vision (ECCV), 2020.
@article{Nishimura:2020,
author={M. Nishimura and D. B. Lindell and C. Metzler and G. Wetzstein},
journal={European Conference on Computer Vision (ECCV)},
title={{Disambiguating Monocular Depth Estimation
with a Single Transient}},
year={2020},
}
For more questions please email Mark Nishimura: markn1 at stanford dot edu