GithubHelp home page GithubHelp logo

eltociear / sparsedc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whu-usi3dv/sparsedc

0.0 1.0 0.0 1.18 MB

[ArXiv 2023] SparseDC: Depth Completion from sparse and non-uniform inputs

Home Page: https://arxiv.org/pdf/2312.00097

Shell 0.62% C++ 6.18% Python 70.35% Cuda 22.85%

sparsedc's Introduction

This is the official PyTorch implementation of the following publication:

SparseDC: Depth Completion from sparse and non-uniform inputs
Chen Long, Wenxiao Zhang, Zhe Chen, Haiping Wang, Yuan Liu, Zhen Cao, Zhen Dong, Bisheng Yang
ArXiv 2023
Paper | Project-page | Video

πŸ”­ Introduction

SparseDC: Depth Completion from sparse and non-uniform inputs

Network

Abstract: We propose SparseDC, a model for Depth Completion of Sparse and non-uniform depth inputs. Unlike previous methods focusing on completing fixed distributions on benchmark datasets (e.g., NYU with 500 points, KITTI with 64 lines), SparseDC is specifically designed to handle depth maps with poor quality in real usage. The key contributions of SparseDC are two-fold. First, we design a simple strategy, called SFFM, to improve the robustness under sparse input by explicitly filling the unstable depth features with stable image features. Second, we propose a two-branch feature embedder to predict both the precise local geometry of regions with available depth values and accurate structures in regions with no depth. The key of the embedder is an uncertainty-based fusion module called UFFM to balance the local and long-term information extracted by CNNs and ViTs. Extensive indoor and outdoor experiments demonstrate the robustness of our framework when facing sparse and non-uniform input depths.

πŸ†• News

πŸ’» Requirements

The code has been trained on:

  • Ubuntu 20.04
  • CUDA 11.3
  • Python 3.9.18
  • Pytorch 1.12.1
  • GeForce RTX 4090 $\times$ 2.

πŸ”§ Installation

  • First, create the conda environment:
    conda env create -f environment.yaml
    conda activate sparsedc
    
  • Second, Install the MMCV
    mim install mmcv-full
    
  • Finally, Build and Install the DCN Module for refiner.
    cd src/plugins/deformconv
    python setup.py build install
    

πŸ’Ύ Datasets

We used two datasets for training and three datasets for evaluation.

NYU Depth V2 (NYUv2)

We used preprocessed NYUv2 HDF5 dataset provided by Fangchang Ma.

$ cd PATH_TO_DOWNLOAD
$ wget http://datasets.lids.mit.edu/sparse-to-dense/data/nyudepthv2.tar.gz
$ tar -xvf nyudepthv2.tar.gz

Note that the original full NYUv2 dataset is available at the official website.

Then, you should generate a json file containing paths to individual images. We use the data lists for NYUv2 borrowed from the NLSPN repository. You can put this json into your data dir.

After that, you will get a data structure as follows:

nyudepthv2
β”œβ”€β”€ nyu.json
β”œβ”€β”€ train
β”‚    β”œβ”€β”€ basement_0001a
β”‚    β”‚    β”œβ”€β”€ 00001.h5
β”‚    β”‚    └── ...
β”‚    β”œβ”€β”€ basement_0001b
β”‚    β”‚    β”œβ”€β”€ 00001.h5
β”‚    β”‚    └── ...
β”‚    └── ...
└── val
    └── official
        β”œβ”€β”€ 00001.h5
        └── ...

KITTI Depth Completion (KITTI DC)

KITTI DC dataset is available at the KITTI DC Website.

For color images, KITTI Raw dataset is also needed, which is available at the KITTI Raw Website. You can refer to this script for data preparation.

The overall data directory is structured as follows:

β”œβ”€β”€ kitti_depth
|   β”œβ”€β”€data_depth_annotated
|   |  β”œβ”€β”€ train
|   |  β”œβ”€β”€ val
|   β”œβ”€β”€ data_depth_velodyne
|   |  β”œβ”€β”€ train
|   |  β”œβ”€β”€ val
|   β”œβ”€β”€ data_depth_selection
|   |  β”œβ”€β”€ test_depth_completion_anonymous
|   |  |── test_depth_prediction_anonymous
|   |  β”œβ”€β”€ val_selection_cropped
β”œβ”€β”€ kitti_raw
|   β”œβ”€β”€ 2011_09_26
|   β”œβ”€β”€ 2011_09_28
|   β”œβ”€β”€ 2011_09_29
|   β”œβ”€β”€ 2011_09_30
|   β”œβ”€β”€ 2011_10_03

SUN RGB-D

SUN RGB-D dataset is available at the SUN RGB-D Website.

We used processed dataset provided by ankurhanda. The refined depth images are contained in the depth_bfx folder in the SUN RGB-D dataset. Also, you can directly download our organized data from GoogleDrive.

πŸš… Pretrained model

You can download the pretrained model from GoogleDrive, and put it in folder pretrain/.

⏳ Train

To train SparseDC, you should prepare the dataset, and replace the "data_dir" to your data path. Then, you use the follow command:

$ python train.py experiment=final_version         # for NYUDepth
$ python train.py experiment=final_version_kitti   # for KITTIDC

✏️ Test

To eval SparseDC on three benchmarks, you can use the following commands:

$ ./eval_nyu.sh final_version final_version pretrain/nyu.ckpt
$ ./eval_kitti.sh final_version_kitti final_version_kitti_test pretrain/kitti.ckpt
$ ./eval_sunrgbd.sh final_version final_version pretrain/nyu.ckpt

πŸ’‘ Citation

If you find this repo helpful, please give us a 😍 star 😍. Please consider citing SparseDC if this program benefits your project

@misc{long2023sparsedc,
  title={SparseDC: Depth Completion from sparse and non-uniform inputs},
  author={Chen Long and Wenxiao Zhang and Zhe Chen and Haiping Wang and Yuan Liu and Zhen Cao and Zhen Dong and Bisheng Yang},
  year={2023},
  eprint={2312.00097},
  archivePrefix={arXiv},
  primaryClass={cs.CV}
}

πŸ”— Related Projects

We sincerely thank the excellent projects:

sparsedc's People

Contributors

chenlongwhu avatar

Watchers

 avatar

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.