Real-time Neural Representation Fusion for Robust Volumetric Mapping

Overview

NeuralBlox: Real-Time Neural Representation Fusion for Robust Volumetric Mapping

Paper | Supplementary

teaser

This repository contains the implementation of the paper:

NeuralBlox: Real-Time Neural Representation Fusion for Robust Volumetric Mapping
Stefan Lionar*, Lukas Schmid*, Cesar Cadena, Roland Siegwart, and Andrei Cramariuc
International Conference on 3D Vision (3DV) 2021
(*equal contribution)

If you find our code or paper useful, please consider citing us:

@inproceedings{lionar2021neuralblox,
 title = {NeuralBlox: Real-Time Neural Representation Fusion for Robust Volumetric Mapping},
 author={Stefan Lionar, Lukas Schmid, Cesar Cadena, Roland Siegwart, Andrei Cramariuc},
 booktitle = {International Conference on 3D Vision (3DV)},
 year = {2021}}

Installation

conda env create -f environment.yaml
conda activate neuralblox
pip install torch-scatter==2.0.4 -f https://pytorch-geometric.com/whl/torch-1.4.0+cu101.html

Note: Make sure torch-scatter and PyTorch have the same cuda toolkit version. If PyTorch has a different cuda toolkit version, run:

conda install pytorch==1.4.0 cudatoolkit=10.1 -c pytorch

Next, compile the extension modules. You can do this via

python setup.py build_ext --inplace

Optional: For a noticeably faster inference on CPU-only settings, upgrade PyTorch and PyTorch Scatter to a newer version:

pip install torch==1.7.1+cu101 torchvision==0.8.2+cu101 -f https://download.pytorch.org/whl/torch_stable.html
pip install --upgrade --no-deps --force-reinstall torch-scatter==2.0.5 -f https://pytorch-geometric.com/whl/torch-1.7.1+cu101.html

Demo

To generate meshes using our pretrained models and evaluation dataset, you can select several configurations below and run it.

python generate_sequential.py configs/fusion/pretrained/redwood_0.5voxel_demo.yaml
python generate_sequential.py configs/fusion/pretrained/redwood_1voxel_demo.yaml
python generate_sequential.py configs/fusion/pretrained/redwood_1voxel_demo_cpu.yaml --no_cuda
  • The mesh will be generated to out_mesh/mesh folder.
  • To add noise, change the values under test.scene.noise in the config files.

Training backbone encoder and decoder

The backbone encoder and decoder mainly follow Convolutional Occupancy Networks (https://github.com/autonomousvision/convolutional_occupancy_networks) with some modifications adapted for our use case. Our pretrained model is provided in this repository.

Dataset

ShapeNet

The proprocessed ShapeNet dataset is from Occupancy Networks (https://github.com/autonomousvision/occupancy_networks). You can download it (73.4 GB) by running:

bash scripts/download_shapenet_pc.sh

After that, you should have the dataset in data/ShapeNet folder.

Training

To train the backbone network from scratch, run

python train_backbone.py configs/pointcloud/shapenet_grid24_pe.yaml

Latent code fusion

The pretrained fusion network is also provided in this repository.

Training dataset

To train from scratch, you can download our preprocessed Redwood Indoor RGBD Scan dataset by running:

bash scripts/download_redwood_preprocessed.sh

We align the gravity direction to be the same as ShapeNet ([0,1,0]) and convert the RGBD scans following ShapeNet format.

More information about the dataset is provided here: http://redwood-data.org/indoor_lidar_rgbd/.

Training

To train the fusion network from scratch, run

python train_fusion.py configs/fusion/train_fusion_redwood.yaml

Adjust the path to the encoder-decoder model in training.backbone_file of the .yaml file if necessary.

Generation

python generate_sequential.py CONFIG.yaml

If you are interested in generating the meshes from other dataset, e.g., ScanNet:

  • Structure the dataset following the format in demo/redwood_apartment_13k.
  • Adjust path, data_preprocessed_interval and intrinsics in the config file.
  • If necessary, align the dataset to have the same gravity direction as ShapeNet by adjusting align in the config file.

For example,

# ScanNet scene ID 0
python generate_sequential.py configs/fusion/pretrained/scannet_000.yaml

# ScanNet scene ID 24
python generate_sequential.py configs/fusion/pretrained/scannet_024.yaml

To use your own models, replace test.model_file (encoder-decoder) and test.merging_model_file (fusion network) in the config file to the path of your models.

Evaluation

You can evaluate the predicted meshes with respect to a ground truth mesh by following the steps below:

  1. Install CloudCompare
sudo apt install cloudcompare
  1. Copy a ground truth mesh (no RGB information expected) to evaluation/mesh_gt
  2. Copy prediction meshes to evaluation/mesh_pred
  3. If the prediction mesh does not contain RGB information, such as the output from our method, run:
python evaluate.py

Else, if it contains RGB information, such as the output from Voxblox, run:

python evaluate.py --color_mesh

We provide the trimmed mesh used for the ground truth of our quantitative evaluation. It can be downloaded here: https://polybox.ethz.ch/index.php/s/gedC9YpQPMPiucU/download

Lastly, to evaluate prediction meshes with respect to the trimmed mesh as ground truth, run:

python evaluate.py --demo

Or for colored mesh (e.g. from Voxblox):

python evaluate.py --demo --color_mesh

evaluation.csv will be generated to evaluation directory.

Acknowledgement

Some parts of the code are inherited from the official repository of Convolutional Occupancy Networks (https://github.com/autonomousvision/convolutional_occupancy_networks).

Owner
ETHZ ASL
ETHZ ASL
The Unsupervised Reinforcement Learning Benchmark (URLB)

The Unsupervised Reinforcement Learning Benchmark (URLB) URLB provides a set of leading algorithms for unsupervised reinforcement learning where agent

259 Dec 26, 2022
CVPR 2022 "Online Convolutional Re-parameterization"

OREPA: Online Convolutional Re-parameterization This repo is the PyTorch implementation of our paper to appear in CVPR2022 on "Online Convolutional Re

Mu Hu 121 Dec 21, 2022
Python TFLite scripts for detecting objects of any class in an image without knowing their label.

Python TFLite scripts for detecting objects of any class in an image without knowing their label.

Ibai Gorordo 42 Oct 07, 2022
Pip-package for trajectory benchmarking from "Be your own Benchmark: No-Reference Trajectory Metric on Registered Point Clouds", ECMR'21

Map Metrics for Trajectory Quality Map metrics toolkit provides a set of metrics to quantitatively evaluate trajectory quality via estimating consiste

Mobile Robotics Lab. at Skoltech 31 Oct 28, 2022
A diff tool for language models

LMdiff Qualitative comparison of large language models. Demo & Paper: http://lmdiff.net LMdiff is a MIT-IBM Watson AI Lab collaboration between: Hendr

Hendrik Strobelt 27 Dec 29, 2022
[CVPR2021] De-rendering the World's Revolutionary Artefacts

De-rendering the World's Revolutionary Artefacts Project Page | Video | Paper In CVPR 2021 Shangzhe Wu1,4, Ameesh Makadia4, Jiajun Wu2, Noah Snavely4,

49 Nov 06, 2022
Official code for "Towards An End-to-End Framework for Flow-Guided Video Inpainting" (CVPR2022)

E2FGVI (CVPR 2022) English | 简体中文 This repository contains the official implementation of the following paper: Towards An End-to-End Framework for Flo

Media Computing Group @ Nankai University 537 Jan 07, 2023
The Python code for the paper A Hybrid Quantum-Classical Algorithm for Robust Fitting

About The Python code for the paper A Hybrid Quantum-Classical Algorithm for Robust Fitting The demo program was only tested under Conda in a standard

Anh-Dzung Doan 5 Nov 28, 2022
JAX-based neural network library

Haiku: Sonnet for JAX Overview | Why Haiku? | Quickstart | Installation | Examples | User manual | Documentation | Citing Haiku What is Haiku? Haiku i

DeepMind 2.3k Jan 04, 2023
STEM: An approach to Multi-source Domain Adaptation with Guarantees

STEM: An approach to Multi-source Domain Adaptation with Guarantees Introduction This is the official implementation of ``STEM: An approach to Multi-s

5 Dec 19, 2022
Implementation of ETSformer, state of the art time-series Transformer, in Pytorch

ETSformer - Pytorch Implementation of ETSformer, state of the art time-series Transformer, in Pytorch Install $ pip install etsformer-pytorch Usage im

Phil Wang 121 Dec 30, 2022
EMNLP'2021: Simple Entity-centric Questions Challenge Dense Retrievers

EntityQuestions This repository contains the EntityQuestions dataset as well as code to evaluate retrieval results from the the paper Simple Entity-ce

Princeton Natural Language Processing 119 Sep 28, 2022
PyTorch Implementation of ECCV 2020 Spotlight TuiGAN: Learning Versatile Image-to-Image Translation with Two Unpaired Images

TuiGAN-PyTorch Official PyTorch Implementation of "TuiGAN: Learning Versatile Image-to-Image Translation with Two Unpaired Images" (ECCV 2020 Spotligh

181 Dec 09, 2022
Implementing DeepMind's Fast Reinforcement Learning paper

Fast Reinforcement Learning This is a repo where I implement the algorithms in the paper, Fast reinforcement learning with generalized policy updates.

Marcus Chiam 6 Nov 28, 2022
Causal-BALD: Deep Bayesian Active Learning of Outcomes to Infer Treatment-Effects from Observational Data.

causal-bald | Abstract | Installation | Example | Citation | Reproducing Results DUE An implementation of the methods presented in Causal-BALD: Deep B

OATML 13 Oct 07, 2022
Unified learning approach for egocentric hand gesture recognition and fingertip detection

Unified Gesture Recognition and Fingertip Detection A unified convolutional neural network (CNN) algorithm for both hand gesture recognition and finge

Mohammad 227 Dec 25, 2022
Benchmarks for semi-supervised domain generalization.

Semi-Supervised Domain Generalization This code is the official implementation of the following paper: Semi-Supervised Domain Generalization with Stoc

Kaiyang 49 Dec 10, 2022
Pytorch implementation of Depth-conditioned Dynamic Message Propagation forMonocular 3D Object Detection

DDMP-3D Pytorch implementation of Depth-conditioned Dynamic Message Propagation forMonocular 3D Object Detection, a paper on CVPR2021. Instroduction T

Li Wang 32 Nov 09, 2022
Lightweight Face Image Quality Assessment

LightQNet This is a demo code of training and testing [LightQNet] using Tensorflow. Uncertainty Losses: IDQ loss PCNet loss Uncertainty Networks: Mobi

Kaen 5 Nov 18, 2022
Python script for performing depth completion from sparse depth and rgb images using the msg_chn_wacv20. model in ONNX

ONNX msg_chn_wacv20 depth completion Python script for performing depth completion from sparse depth and rgb images using the msg_chn_wacv20 model in

Ibai Gorordo 19 Oct 22, 2022