Need help with differentiable_volumetric_rendering?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

399 Stars 50 Forks MIT License 42 Commits 6 Opened issues


This repository contains the code for the CVPR 2020 paper "Differentiable Volumetric Rendering: Learning Implicit 3D Representations without 3D Supervision"

Services available


Need anything else?

Contributors list

Differentiable Volumetric Rendering

Paper | Supplementary | Spotlight Video | Blog Entry | Presentation | Interactive Slides | Project Page

This repository contains the code for the paper Differentiable Volumetric Rendering: Learning Implicit 3D Representations without 3D Supervision.

You can find detailed usage instructions for training your own models and using pre-trained models below.

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

    title = {Differentiable Volumetric Rendering: Learning Implicit 3D Representations without 3D Supervision},
    author = {Niemeyer, Michael and Mescheder, Lars and Oechsle, Michael and Geiger, Andreas},
    booktitle = {Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR)},
    year = {2020}


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

conda env create -f environment.yaml
conda activate dvr
Next, compile the extension modules. You can do this via
python build_ext --inplace


You can now test our code on the provided input images in the

folder. To this end, start the generation process for one of the config files in the
folder. For example, simply run
python configs/demo/demo_combined.yaml
This script should create a folder
where the output meshes are stored. The script will copy the inputs into the
folder and creates the meshes in the
folder. Moreover, the script creates a
folder where both inputs and outputs are copied together.


Download Datasets

To evaluate a pre-trained model or train a new model from scratch, you have to obtain the respective dataset. We use three different datasets in the DVR project:

  1. ShapeNet for 2.5D supervised models (using the Choy et. al. renderings as input and our renderings as supervision)
  2. ShapeNet for 2D supervised models (using the Kato et. al. renderings)
  3. A subset of the DTU multi-view dataset

You can download our preprocessed data using

bash scripts/
and following the instructions. The sizes of the datasets are 114GB (a), 34GB (b), and 0.5GB (c).

This script should download and unpack the data automatically into the


Data Convention

Please have a look at the FAQ for details regarding the type of camera matrices we use.


When you have installed all binary dependencies and obtained the preprocessed data, you are ready to run our pre-trained models and train new models from scratch.


To generate meshes using a trained model, use

python CONFIG.yaml
where you replace
with the correct config file.

The easiest way is to use a pre-trained model. You can do this by using one of the config files which are indicated with


For example, for our 2.5D supervised single-view reconstruction model run

python configs/single_view_reconstruction/multi_view_supervision/ours_depth_pretrained.yaml
or for our multi-view reconstruction from RGB images and sparse depth maps for the birds object run
python configs/multi_view_reconstruction/birds/ours_depth_mvs_pretrained.yaml
Our script will automatically download the model checkpoints and run the generation. You can find the outputs in the

Please note that the config files

are only for generation, not for training new models: when these configs are used for training, the model will be trained from scratch, but during inference our code will still use the pre-trained model.

Generation From Your Own Single Images

Similar to our demo, you can easily generate 3D meshes from your own single images. To this end, create a folder which contains your own images (e.g.

). Next, you can reuse the config file
and just adjust the data - path and training - out_dir arguments to your needs. For example, you can set the config file to
inherit_from: configs/single_view_reconstruction/multi_view_supervision/ours_combined_pretrained.yaml
  dataset_name: images
  path: media/my_images
  out_dir:  out/my_3d_models
to generate 3D models for the images in
. The models will be saved to
. Similar to before, to start the generation process, run
python configs/demo/demo_combined.yaml 
Note: You can only expect our model to provide reasonable results on data which is similar to what it was trained on (white background, single object, etc.).


For evaluation of the models, we provide the script
. You can run it using
python CONFIG.yaml
The script takes the meshes generated in the previous step and evaluates them using a standardized protocol. The output will be written to
files in the corresponding generation folder which can be processed using pandas.


Finally, to train a new network from scratch, run

python CONFIG.yaml
where you replace
with the name of the configuration file you want to use.

You can monitor on http://localhost:6006 the training process using tensorboard:

tensorboard --logdir ./logs
where you replace
with the respective output directory.

For available training options, please take a look at


Futher Information

More Work on Implicit Representations

If you like the DVR project, please check out other works on implicit representions from our group: - Mescheder et. al. - Occupancy Networks: Learning 3D Reconstruction in Function Space (CVPR 2019) - Oechsle et. al. - Texture Fields: Learning Texture Representations in Function Space (ICCV 2019) - Niemeyer et. al. - Occupancy Flow: 4D Reconstruction by Learning Particle Dynamics (ICCV 2019) - Peng et. al. - Convolutional Occupancy Networks (ArXiv 2020) - Oechsle et. al. - Learning Implicit Surface Light Fields (ArXiv 2020)

Other Relevant Works

Also check out other exciting works on inferring implicit representations without 3D supervision: - Liu et. al. - Learning to Infer Implicit Surfaces without 3D Supervision (NeurIPS 2019) - Sitzmann et. al. - Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Representations (NeurIPS 2019) - Liu. et. al. - DIST: Rendering Deep Implicit Signed Distance Function with Differentiable Sphere Tracing (CVPR 2020) - Mildenhall et. al. - NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis (ArXiv 2020)

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.