[ICCV'21] UNISURF: Unifying Neural Implicit Surfaces and Radiance Fields for Multi-View Reconstruction

Overview

UNISURF: Unifying Neural Implicit Surfaces and Radiance Fields for Multi-View Reconstruction

Project Page | Paper | Supplementary | Video

This repository contains the implementation of the paper:

UNISURF: Unifying Neural Implicit Surfaces and Radiance Fields for Multi-View Reconstruction
Michael Oechsle, Songyou Peng, and Andreas Geiger
ICCV 2021 (Oral)

Neural implicit 3D representations have emerged as a powerful paradigm for reconstructing surfaces from multi-view images and synthesizing novel views. Unfortunately, existing methods such as DVR or IDR require accurate per-pixel object masks as supervision. At the same time, neural radiance fields have revolutionized novel view synthesis. However, NeRF's estimated volume density does not admit accurate surface reconstruction. Our key insight is that implicit surface models and radiance fields can be formulated in a unified way, enabling both surface and volume rendering using the same model. This unified perspective enables novel, more efficient sampling procedures and the ability to reconstruct accurate surfaces without input masks. We compare our method on the DTU, BlendedMVS, and a synthetic indoor dataset. Our experiments demonstrate that we outperform NeRF in terms of reconstruction quality while performing on par with IDR without requiring masks.

If you find our code or paper useful, please cite as

@inproceedings{Oechsle2021ICCV,
  author    = {Michael Oechsle and Songyou Peng and Andreas Geiger},
  title     = {UNISURF: Unifying Neural Implicit Surfaces and Radiance Fields for Multi-View Reconstruction},
  booktitle = {International Conference on Computer Vision (ICCV)},
  year      = {2021}
} 

Installation

First you have to make sure that you have all dependencies in place. The simplest way to do so, is to use anaconda.

You can create an anaconda environment called unisurf using

conda env create -f environment.yaml
conda activate unisurf

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

python setup.py build_ext --inplace

Dataset

For downloading the preprocessed data, run the following script. The data is adapted from DVR and IDR

source ./download_dataset.sh

Extract mesh from a pretrained model

If you just want to quickly extract a mesh from a pre-trained model, you can run our demo with

python extract.py configs/DTU_pre/scan_0$id.yaml 

You can find predicted meshes in out/scan_0$id/.

Training

For training a model from scratch run

python train.py configs/DTU/scan_0$id.yaml

in the conda environment. You can use tensor board to visualize the training process. The logfiles are saved to the logs folder in the output directory.

tensorboard --logdir ./out --port 6006
Comments
  • numpy/arrayobject.h: No such file or directory

    numpy/arrayobject.h: No such file or directory

    This error occurred while compiling the extension module.


    python setup.py build_ext --inplace running build_ext /data/happily/anaconda3/envs/unisurf/lib/python3.9/site-packages/torch/utils/cpp_extension.py:381: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) building 'utils.libmise.mise' extension gcc -pthread -B /data/happily/anaconda3/envs/unisurf/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /data/happily/anaconda3/envs/unisurf/include -fPIC -O2 -isystem /data/happily/anaconda3/envs/unisurf/include -fPIC -I/data/happily/anaconda3/envs/unisurf/include/python3.9 -c utils/libmise/mise.cpp -o build/temp.linux-x86_64-3.9/utils/libmise/mise.o -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1011" -DTORCH_EXTENSION_NAME=mise -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 utils/libmise/mise.cpp:648:10: fatal error: numpy/arrayobject.h: No such file or directory #include "numpy/arrayobject.h" ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. error: command '/usr/bin/gcc' failed with exit code 1

    How can I fix this?

    opened by bring728 3
  • Why the outputs of the occupancy network need to mutiply -10?

    Why the outputs of the occupancy network need to mutiply -10?

    Hi, authors,

    Thanks for the released codes of this great work. I am a little concerned about why the outputs of the occupancy network need to multiply -10 before the sigmoid function?

    https://github.com/autonomousvision/unisurf/blob/224efc73d50acf422edacaebcaf59a8b8ba6d1ff/model/network.py#L124

    opened by StevenLiuWen 3
  • What is camera_mat in cam to world transform?

    What is camera_mat in cam to world transform?

    https://github.com/autonomousvision/unisurf/blob/224efc73d50acf422edacaebcaf59a8b8ba6d1ff/model/common.py#L240

    Hi, I am trying to run my own dataset on your model. As mentioned in previous issues you have claimed to use the IDR Data Convention but their code/they do not mention any camera_mat in their datasets. They only have world_mat and scale_mat for each sample.

    If K is the camera intrinsics matrix (camera coordinates -> pixels) and [R|t] is the extrinsics matrix (world -> camera coordinates) then according to the IDR data convention, world_mat = K * [R|t] and consecutively, the pixel to world should be: (assume scale_mat = identity and I have a world_mat defined)

    p_world = inv(scale_mat) @ inv(world_mat) @ pixels

    What does the camera_mat mean here and how have you generated it?

    opened by ishikaa25 2
  • RuntimeError: CUDA out of memory

    RuntimeError: CUDA out of memory

    I was trying to train the model of the owl figure data by python train.py /home/mea303/Documents/Python/NeRF_project/unisurf-main/configs/DTU/scan0122.yaml

    but ran into the error message: Traceback (most recent call last): File "/home/mea303/Documents/Python/NeRF_project/unisurf-main/train.py", line 112, in <module> loss_dict = trainer.train_step(batch, it) ... File "/home/mea303/Documents/Python/NeRF_project/unisurf-main/model/network.py", line 112, in gradient gradients = torch.autograd.grad( File "/home/mea303/anaconda3/envs/unisurf/lib/python3.10/site-packages/torch/autograd/__init__.py", line 275, in grad return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass RuntimeError: CUDA out of memory. Tried to allocate 64.00 MiB (GPU 0; 7.79 GiB total capacity; 2.13 GiB already allocated; 23.94 MiB free; 2.20 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

    I'm using RTX 3060 Ti with cuda version 11.3 on Ubuntu 20.04

    Is that graphic card not good enough? How do I fix this problem?

    opened by CozmoxJC 1
  • Coordinate axis convetions

    Coordinate axis convetions

    What are the coordinate conventions used for camera pose matrices in cameras.npz? Are you using the NeRF/OpenCV standard of "+Z down the optical axis, +X to the right and +Y is down"?

    opened by robonrrd 0
  • AttributeError: 'Renderer' object has no attribute 'call_depth_function'

    AttributeError: 'Renderer' object has no attribute 'call_depth_function'

    Thanks for your excellent work! I have a small question about the training mode of "onsurf_render", in the line 323 in model/rendering.py:

    self.model.eval()
    with torch.no_grad():
        d_i = self.call_depth_function(camera_world, ray_vector, self.model, it=8, n_steps=[int(512),int(512)+1], check_unitsphere_intersection=True, rad=rad)
    

    It seems that there is no implementation for "self.call_depth_function" here. Could you please tell me where is the source code of "call_depth_function" or how does this function work? Thanks a lot!

    opened by zParquet 0
  • Quantitative Evaluation Mesh

    Quantitative Evaluation Mesh

    Hi @pengsongyou, this is great work!

    I noticed that the published code doesn't contain scripts for quantitatively evaluating the reconstructed surface against the DTU ground truth. Your packaged DTU dataset doesn't contain ground-truth shapes either.

    Can you share your script for quantitative evaluation of DTU scenarios? If you could also share the ground truth shape (or how to make the ground-truth shapes of the DTU) to use with your script, that would be great!

    Thanks and Regards,

    opened by YinGuoX 0
  • The 'scale_mat' in DTU cameras.npz is different from that generated by idr

    The 'scale_mat' in DTU cameras.npz is different from that generated by idr

    I found that the 'scale_mat' in cameras.npz is different from that generated by this script.

    Take scan24 as example, the 'scale_mat_0' in cameras.npz:

    image

    but the 'scale_mat_0' in scan24 processed by this script:

    image

    Could you please provide some more details about the preprocess? I want to train more scans in DTU besides these 15 scans.

    Thank you very much!

    opened by ZipengFeng 1
Owner
null
Open source repository for the code accompanying the paper 'Non-Rigid Neural Radiance Fields Reconstruction and Novel View Synthesis of a Deforming Scene from Monocular Video'.

Non-Rigid Neural Radiance Fields This is the official repository for the project "Non-Rigid Neural Radiance Fields: Reconstruction and Novel View Synt

Facebook Research 296 Dec 29, 2022
[ICCV 2021 Oral] NerfingMVS: Guided Optimization of Neural Radiance Fields for Indoor Multi-view Stereo

NerfingMVS Project Page | Paper | Video | Data NerfingMVS: Guided Optimization of Neural Radiance Fields for Indoor Multi-view Stereo Yi Wei, Shaohui

Yi Wei 369 Dec 24, 2022
Build upon neural radiance fields to create a scene-specific implicit 3D semantic representation, Semantic-NeRF

Semantic-NeRF: Semantic Neural Radiance Fields Project Page | Video | Paper | Data In-Place Scene Labelling and Understanding with Implicit Scene Repr

Shuaifeng Zhi 243 Jan 7, 2023
A minimal TPU compatible Jax implementation of NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis

NeRF Minimal Jax implementation of NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis. Result of Tiny-NeRF RGB Depth

Soumik Rakshit 11 Jul 24, 2022
Implementation of "Generalizable Neural Performer: Learning Robust Radiance Fields for Human Novel View Synthesis"

Generalizable Neural Performer: Learning Robust Radiance Fields for Human Novel View Synthesis Abstract: This work targets at using a general deep lea

null 163 Dec 14, 2022
(CVPR 2022 - oral) Multi-View Depth Estimation by Fusing Single-View Depth Probability with Multi-View Geometry

Multi-View Depth Estimation by Fusing Single-View Depth Probability with Multi-View Geometry Official implementation of the paper Multi-View Depth Est

Bae, Gwangbin 138 Dec 28, 2022
[ICCV21] Code for RetrievalFuse: Neural 3D Scene Reconstruction with a Database

RetrievalFuse Paper | Project Page | Video RetrievalFuse: Neural 3D Scene Reconstruction with a Database Yawar Siddiqui, Justus Thies, Fangchang Ma, Q

Yawar Nihal Siddiqui 75 Dec 22, 2022
Stereo Radiance Fields (SRF): Learning View Synthesis for Sparse Views of Novel Scenes

Stereo Radiance Fields (SRF): Learning View Synthesis for Sparse Views of Novel Scenes

null 111 Dec 29, 2022
Code for Iso-Points: Optimizing Neural Implicit Surfaces with Hybrid Representations

Implementation for Iso-Points (CVPR 2021) Official code for paper Iso-Points: Optimizing Neural Implicit Surfaces with Hybrid Representations paper |

Yifan Wang 66 Nov 8, 2022
Volsdf - Volume Rendering of Neural Implicit Surfaces

Volume Rendering of Neural Implicit Surfaces Project Page | Paper | Data This re

Lior Yariv 221 Jan 7, 2023
Pytorch implementation for A-NeRF: Articulated Neural Radiance Fields for Learning Human Shape, Appearance, and Pose

A-NeRF: Articulated Neural Radiance Fields for Learning Human Shape, Appearance, and Pose Paper | Website | Data A-NeRF: Articulated Neural Radiance F

Shih-Yang Su 172 Dec 22, 2022
This is the code for Deformable Neural Radiance Fields, a.k.a. Nerfies.

Deformable Neural Radiance Fields This is the code for Deformable Neural Radiance Fields, a.k.a. Nerfies. Project Page Paper Video This codebase conta

Google 1k Jan 9, 2023
(Arxiv 2021) NeRF--: Neural Radiance Fields Without Known Camera Parameters

NeRF--: Neural Radiance Fields Without Known Camera Parameters Project Page | Arxiv | Colab Notebook | Data Zirui Wang¹, Shangzhe Wu², Weidi Xie², Min

Active Vision Laboratory 411 Dec 26, 2022
Unofficial & improved implementation of NeRF--: Neural Radiance Fields Without Known Camera Parameters

[Unofficial code-base] NeRF--: Neural Radiance Fields Without Known Camera Parameters [ Project | Paper | Official code base ] ⬅️ Thanks the original

Jianfei Guo 239 Dec 22, 2022
Mip-NeRF: A Multiscale Representation for Anti-Aliasing Neural Radiance Fields.

This repository contains the code release for Mip-NeRF: A Multiscale Representation for Anti-Aliasing Neural Radiance Fields. This implementation is written in JAX, and is a fork of Google's JaxNeRF implementation. Contact Jon Barron if you encounter any issues.

Google 625 Dec 30, 2022
Code for KiloNeRF: Speeding up Neural Radiance Fields with Thousands of Tiny MLPs

KiloNeRF: Speeding up Neural Radiance Fields with Thousands of Tiny MLPs Check out the paper on arXiv: https://arxiv.org/abs/2103.13744 This repo cont

Christian Reiser 373 Dec 20, 2022
This repository contains a PyTorch implementation of "AD-NeRF: Audio Driven Neural Radiance Fields for Talking Head Synthesis".

AD-NeRF: Audio Driven Neural Radiance Fields for Talking Head Synthesis | Project Page | Paper | PyTorch implementation for the paper "AD-NeRF: Audio

null 551 Dec 29, 2022
Code release for DS-NeRF (Depth-supervised Neural Radiance Fields)

Depth-supervised NeRF: Fewer Views and Faster Training for Free Project | Paper | YouTube Pytorch implementation of our method for learning neural rad

null 524 Jan 8, 2023
PyTorch implementation for MINE: Continuous-Depth MPI with Neural Radiance Fields

MINE: Continuous-Depth MPI with Neural Radiance Fields Project Page | Video PyTorch implementation for our ICCV 2021 paper. MINE: Towards Continuous D

Zijian Feng 325 Dec 29, 2022