项目作者: syinari0123

项目描述 :
TriDepth: Triangular Patch-based Deep Depth Prediction [Kaneko+, ICCVW2019(oral)]
高级语言: Python
项目地址: git://github.com/syinari0123/tridepth.git
创建时间: 2019-10-25T12:48:39Z
项目社区:https://github.com/syinari0123/tridepth

开源协议:MIT License

下载


TriDepth: Triangular Patch-based Deep Depth Prediction

This is an official implementation of “TriDepth: Triangular Patch-based Deep Depth Prediction” presented in ICCV Deep Learning for Visual SLAM Workshop 2019 (oral).
See the project webpage and demo video for more details.



Environments

This code was developed and tested with Python 3.6.8 and PyTorch 1.1.0 on Ubuntu 16.04 LTS machine (CUDA 10.1).

  • Triangle (for 2D mesh extraction)
  • Autotrace (for edge vectorization)
  • python3-tk
  • Some pip libraries (in requirements.txt)
  1. # Clone this repository with submodule
  2. git clone --recursive git@github.com:syinari0123/tridepth.git # This repository
  3. # Install Triangle (version==20190115.3)
  4. cd thirdparty/triangle
  5. python setup.py install
  6. # Install Autotrace
  7. sudo apt-get install autotrace
  8. # Some libraries
  9. sudo apt-get install python3-tk
  10. pip install -r requirements.txt
  1. python -c "import torch; print(torch.__version__)"
  2. >>> 1.1.0
  3. echo $PATH
  4. >>> /usr/local/cuda/bin:...
  5. echo $CPATH
  6. >>> /usr/local/cuda/include:...
  7. # Then run:
  8. pip install torch-scatter==1.3.1

Installation

Some parts of this code use the CUDA implementation from Neural Mesh Renderer (PyTorch version by Nikos Kolotouros).
So you need to build it with following commands.

  1. cd tridepth/renderer/cuda/
  2. python setup.py install

Dataset

Download the preprocessed NYU Depth v2 dataset in HDF5 formats (from Sparse-to-Dense by Fangchang et al.).
The NYU dataset requires 32G of storage space.

  1. mkdir data && cd data
  2. wget http://datasets.lids.mit.edu/sparse-to-dense/data/nyudepthv2.tar.gz
  3. tar -xvf nyudepthv2.tar.gz && rm -f nyudepthv2.tar.gz

Training & evaluation

  1. CUDA_VISIBLE_DEVICES=$EMPTY_GPU python train.py \
  2. --theme "train" \
  3. --log-path "log" \
  4. --data-path $DATA_DIR \
  5. --model-type "upconv" \
  6. --lr 1e-3 \
  7. --momentum 0.9 \
  8. --weight-decay 1e-4 \
  9. --batchsize 8 \
  10. --workers 4 \
  11. --nepoch 30 \
  12. --print-freq 100 \
  13. --img-print-freq 1000 \
  14. --print-progress "true"

DATA_DIR is a dataset path (Default: data/nyudepthv2).

Inference

  1. CUDA_VISIBLE_DEVICES=$EMPTY_GPU python inference_nyu.py \
  2. --data-path $DATA_DIR \
  3. --model-type "upconv" \
  4. --pretrained-path $MODEL_PATH \
  5. --print-progress "true" \
  6. --rep-type "patch_cloud" \ # Choose representation type from ["patch_cloud", "mesh"]
  7. --result-path "result"

MODEL_PATH is a file path to the pretrained model (Default: pretrained/weight_upconv.pth).

Comparison with other representations

See comparison directory.

Pretrained model

You can download our pretrained model(‘weight_upconv.pth’) with the following command.

  1. cd pretrained
  2. ./download.sh

FAQ

What is the difference between meshdepth and tridepth?

Same. We rename our representation from “disconnected mesh” (in meshdepth paper) to “triangular-patch-cloud” (in tridepth paper).

Why does your result & score looks better than the result in your ICCVW paper?

We update our implementation and re-evaluate our method after the paper submission.
We’ll submit an improved version of our paper to arXiv in near future.

Citation

If you use our code or method in your work, please cite our paper!

  1. @misc{kaneko19tridepth,
  2. Author = {Masaya Kaneko and Ken Sakurada and Kiyoharu Aizawa},
  3. Title = {TriDepth: Triangular Patch-based Deep Depth Prediction},
  4. Booktitle = {ICCV Deep Learning for Visual SLAM Workshop},
  5. Year = {2019},
  6. }