All Projects → cv-rits → MonoScene

cv-rits / MonoScene

Licence: Apache-2.0 License
MonoScene: Monocular 3D Semantic Scene Completion

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to MonoScene

TorchSSC
Implement some state-of-the-art methods of Semantic Scene Completion (SSC) task in PyTorch. [1] 3D Sketch-aware Semantic Scene Completion via Semi-supervised Structure Prior (CVPR 2020)
Stars: ✭ 35 (-38.6%)
Mutual labels:  semantic-scene-understanding, semantic-scene-completion
lidar transfer
Code for Langer et al. "Domain Transfer for Semantic Segmentation of LiDAR Data using Deep Neural Networks", IROS, 2020.
Stars: ✭ 54 (-5.26%)
Mutual labels:  semantic-kitti
DE resnet unet hyb
Depth estimation from RGB images using fully convolutional neural networks.
Stars: ✭ 40 (-29.82%)
Mutual labels:  nyu-depth-v2
SupervisedDepthPrediction
Pytorch framework for supervised depth prediction
Stars: ✭ 36 (-36.84%)
Mutual labels:  monocular
MonoRUn
[CVPR'21] MonoRUn: Monocular 3D Object Detection by Reconstruction and Uncertainty Propagation
Stars: ✭ 85 (+49.12%)
Mutual labels:  monocular
CMRNet
Code for "CMRNet: Camera to LiDAR-Map Registration" (ITSC 2019) - WIP
Stars: ✭ 70 (+22.81%)
Mutual labels:  monocular
Monocular-Vehicle-Localization
Estimating the orientation and the relative dimensions of vehicles by producing a 3d bounding frame
Stars: ✭ 28 (-50.88%)
Mutual labels:  monocular
nyuv2-python-toolbox
Python toolbox for the NYU Depth Dataset V2
Stars: ✭ 55 (-3.51%)
Mutual labels:  nyu-depth-v2
gokube
gokube is a tool that makes it easy developing day-to-day with Kubernetes on your laptop.
Stars: ✭ 22 (-61.4%)
Mutual labels:  monocular
AutoSweep
The implementation for the AutoSweep (TVCG 2018)
Stars: ✭ 47 (-17.54%)
Mutual labels:  single-image-reconstruction
poseviz
3D Human Pose Visualizer for Python
Stars: ✭ 68 (+19.3%)
Mutual labels:  mayavi
EPCDepth
[ICCV 2021] Excavating the Potential Capacity of Self-Supervised Monocular Depth Estimation
Stars: ✭ 105 (+84.21%)
Mutual labels:  monocular
3ddfa v2
The official PyTorch implementation of Towards Fast, Accurate and Stable 3D Dense Face Alignment, ECCV 2020.
Stars: ✭ 1,961 (+3340.35%)
Mutual labels:  single-image-reconstruction

MonoScene: Monocular 3D Semantic Scene Completion

MonoScene: Monocular 3D Semantic Scene Completion] [arXiv + supp] | [Project page]
Anh-Quan Cao, Raoul de Charette
Inria, Paris, France

If you find this work useful, please cite our paper:

@misc{cao2021monoscene,
      title={MonoScene: Monocular 3D Semantic Scene Completion}, 
      author={Anh-Quan Cao and Raoul de Charette},
      year={2021},
      eprint={2112.00726},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Teaser

SemanticKITTI KITTI-360
(Trained on SemanticKITTI)

NYUv2

Table of Content

Preparing MonoScene

Installation

  1. Create conda environment:
$ conda create -y -n monoscene python=3.7
$ conda activate monoscene
  1. This code was implemented with python 3.7, pytorch 1.7.1 and CUDA 10.2. Please install PyTorch:
$ conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=10.2 -c pytorch
  1. Install the additional dependencies:
$ cd MonoScene/
$ pip install -r requirements.txt
  1. Install tbb:
$ conda install -c bioconda tbb=2020.2
  1. Finally, install MonoScene:
$ pip install -e ./

Datasets

SemanticKITTI

  1. You need to download

    • The Semantic Scene Completion dataset v1.1 (SemanticKITTI voxel data (700 MB)) from SemanticKITTI website
    • The KITTI Odometry Benchmark calibration data (Download odometry data set (calibration files, 1 MB)) and the RGB images (Download odometry data set (color, 65 GB)) from KITTI Odometry website.
  2. Create a folder to store SemanticKITTI preprocess data at /path/to/kitti/preprocess/folder.

  3. Store paths in environment variables for faster access (Note: folder 'dataset' is in /path/to/semantic_kitti):

$ export KITTI_PREPROCESS=/path/to/kitti/preprocess/folder
$ export KITTI_ROOT=/path/to/semantic_kitti 
  1. Preprocess the data to generate labels at a lower scale, which are used to compute the ground truth relation matrices:
$ cd MonoScene/
$ python monoscene/data/semantic_kitti/preprocess.py kitti_root=$KITTI_ROOT kitti_preprocess_root=$KITTI_PREPROCESS

NYUv2

  1. Download the NYUv2 dataset.

  2. Create a folder to store NYUv2 preprocess data at /path/to/NYU/preprocess/folder.

  3. Store paths in environment variables for faster access:

$ export NYU_PREPROCESS=/path/to/NYU/preprocess/folder
$ export NYU_ROOT=/path/to/NYU/depthbin 
  1. Preprocess the data to generate labels at a lower scale, which are used to compute the ground truth relation matrices:
$ cd MonoScene/
$ python monoscene/data/NYU/preprocess.py NYU_root=$NYU_ROOT NYU_preprocess_root=$NYU_PREPROCESS

KITTI-360

  1. We only perform inference on KITTI-360. You can download either the Perspective Images for Train & Val (128G) or the Perspective Images for Test (1.5G) at http://www.cvlibs.net/datasets/kitti-360/download.php.

  2. Create a folder to store KITTI-360 data at /path/to/KITTI-360/folder.

  3. Store paths in environment variables for faster access:

$ export KITTI_360_ROOT=/path/to/KITTI-360

Pretrained models

Download MonoScene pretrained models on SemanticKITTI and on NYUv2, then put them in the folder /path/to/MonoScene/trained_models.

Running MonoScene

Training

To train MonoScene with SemanticKITTI, type:

SemanticKITTI

  1. Create folders to store training logs at /path/to/kitti/logdir.

  2. Store in an environment variable:

$ export KITTI_LOG=/path/to/kitti/logdir
  1. Train MonoScene using 4 GPUs with batch_size of 4 (1 item per GPU) on Semantic KITTI:
$ cd MonoScene/
$ python monoscene/scripts/train_monoscene.py \
    dataset=kitti \
    enable_log=true \
    kitti_root=$KITTI_ROOT \
    kitti_preprocess_root=$KITTI_PREPROCESS\
    kitti_logdir=$KITTI_LOG \
    n_gpus=4 batch_size=4    

NYUv2

  1. Create folders to store training logs at /path/to/NYU/logdir.

  2. Store in an environment variable:

$ export NYU_LOG=/path/to/NYU/logdir
  1. Train MonoScene using 2 GPUs with batch_size of 4 (2 item per GPU) on NYUv2:
$ cd MonoScene/
$ python monoscene/scripts/train_monoscene.py \
    dataset=NYU \
    NYU_root=$NYU_ROOT \
    NYU_preprocess_root=$NYU_PREPROCESS \
    logdir=$NYU_LOG \
    n_gpus=2 batch_size=4

Evaluating

SemanticKITTI

To evaluate MonoScene on SemanticKITTI validation set, type:

$ cd MonoScene/
$ python monoscene/scripts/eval_monoscene.py \
    dataset=kitti \
    kitti_root=$KITTI_ROOT \
    kitti_preprocess_root=$KITTI_PREPROCESS \
    n_gpus=1 batch_size=1

NYUv2

To evaluate MonoScene on NYUv2 test set, type:

$ cd MonoScene/
$ python monoscene/scripts/eval_monoscene.py \
    dataset=NYU \
    NYU_root=$NYU_ROOT\
    NYU_preprocess_root=$NYU_PREPROCESS \
    n_gpus=1 batch_size=1

Inference & Visualization

Inference

Please create folder /path/to/monoscene/output to store the MonoScene outputs and store in environment variable:

export MONOSCENE_OUTPUT=/path/to/monoscene/output

NYUv2

To generate the predictions on the NYUv2 test set, type:

$ cd MonoScene/
$ python monoscene/scripts/generate_output.py \
    +output_path=$MONOSCENE_OUTPUT \
    dataset=NYU \
    NYU_root=$NYU_ROOT \
    NYU_preprocess_root=$NYU_PREPROCESS \
    n_gpus=1 batch_size=1

Semantic KITTI

To generate the predictions on the Semantic KITTI validation set, type:

$ cd MonoScene/
$ python monoscene/scripts/generate_output.py \
    +output_path=$MONOSCENE_OUTPUT \
    dataset=kitti \
    kitti_root=$KITTI_ROOT \
    kitti_preprocess_root=$KITTI_PREPROCESS \
    n_gpus=1 batch_size=1

KITTI-360

Here we use the sequence 2013_05_28_drive_0009_sync, you can use other sequences. To generate the predictions on KITTI-360, type:

$ cd MonoScene/
$ python monoscene/scripts/generate_output.py \
    +output_path=$MONOSCENE_OUTPUT \
    dataset=kitti_360 \
    +kitti_360_root=$KITTI_360_ROOT \
    +kitti_360_sequence=2013_05_28_drive_0009_sync  \
    n_gpus=1 batch_size=1

Visualization

We use mayavi to visualize the predictions. Please install mayavi following the official installation instruction. Then, use the following commands to visualize the outputs on respective datasets.

If you have trouble installing mayavi, the following comments might help:

NYUv2

$ cd MonoScene/
$ python monoscene/scripts/visualization/NYU_vis_pred.py +file=/path/to/output/file.pkl

Semantic KITTI

$ cd MonoScene/
$ python monoscene/scripts/visualization/kitti_vis_pred.py +file=/path/to/output/file.pkl +dataset=kitt

KITTI-360

$ cd MonoScene/ 
$ python monoscene/scripts/visualization/kitti_vis_pred.py +file=/path/to/output/file.pkl +dataset=kitti_360

License

MonoScene is released under the Apache 2.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].