BlenderProc2

BlenderProc2: A Procedural Pipeline for Photorealistic Rendering - Published in JOSS (2023)

https://github.com/dlr-rm/blenderproc

Science Score: 100.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: arxiv.org, joss.theoj.org
  • Committers with academic emails
    23 of 67 committers (34.3%) from academic institutions
  • Institutional organization owner
    Organization dlr-rm has institutional domain (rm.dlr.de)
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

3d-engines 3d-front-dataset 3d-graphics 3d-reconstruction blender blender-installation blender-pipeline camera-positions camera-sampling computer-graphics depth-images pose-estimation python rendering segmentation suncg-scene synthetic synthetic-data
Last synced: 4 months ago · JSON representation ·

Repository

A procedural Blender pipeline for photorealistic training image generation

Basic Info
  • Host: GitHub
  • Owner: DLR-RM
  • License: gpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 91.6 MB
Statistics
  • Stars: 3,200
  • Watchers: 43
  • Forks: 482
  • Open Issues: 105
  • Releases: 8
Topics
3d-engines 3d-front-dataset 3d-graphics 3d-reconstruction blender blender-installation blender-pipeline camera-positions camera-sampling computer-graphics depth-images pose-estimation python rendering segmentation suncg-scene synthetic synthetic-data
Created about 6 years ago · Last pushed 4 months ago
Metadata Files
Readme Changelog Contributing License Citation

README.md

BlenderProc2

Documentation Open In Collab License: GPL v3

Front readme image

A procedural Blender pipeline for photorealistic rendering.

Documentation | Tutorials | Examples | ArXiv paper | Workshop paper | JOSS article

Features

  • Loading: *.obj, *.ply, *.blend, *.fbx, BOP, ShapeNet, Haven, 3D-FRONT, etc.
  • Objects: Set or sample object poses, apply physics and collision checking.
  • Materials: Set or sample physically-based materials and textures
  • Lighting: Set or sample lights, automatic lighting of 3D-FRONT scenes.
  • Cameras: Set, sample or load camera poses from file.
  • Rendering: RGB, stereo, depth, normal and segmentation images/sequences.
  • Writing: .hdf5 containers, COCO & BOP annotations.

Installation

Via pip

The simplest way to install blenderproc is via pip:

bash pip install blenderproc

Via git

Alternatively, if you need to make changes to blenderproc or you want to make use of the most recent version on the main-branch, clone the repository:

bash git clone https://github.com/DLR-RM/BlenderProc

To still make use of the blenderproc command and therefore use blenderproc anywhere on your system, make a local pip installation:

bash cd BlenderProc pip install -e .

Usage

BlenderProc has to be run inside the blender python environment, as only there we can access the blender API. Therefore, instead of running your script with the usual python interpreter, the command line interface of BlenderProc has to be used.

bash blenderproc run <your_python_script>

In general, one run of your script first loads or constructs a 3D scene, then sets some camera poses inside this scene and renders different types of images (RGB, distance, semantic segmentation, etc.) for each of those camera poses. Usually, you will run your script multiple times, each time producing a new scene and rendering e.g. 5-20 images from it. With a little more experience, it is also possible to change scenes during a single script call, read here how this is done.

Quickstart

You can test your BlenderProc pip installation by running

bash blenderproc quickstart

This is an alias to blenderproc run quickstart.py where quickstart.py is:

```python import blenderproc as bproc import numpy as np

bproc.init()

Create a simple object:

obj = bproc.object.create_primitive("MONKEY")

Create a point light next to it

light = bproc.types.Light() light.setlocation([2, -2, 0]) light.setenergy(300)

Set the camera to be in front of the object

campose = bproc.math.buildtransformationmat([0, -5, 0], [np.pi / 2, 0, 0]) bproc.camera.addcamerapose(campose)

Render the scene

data = bproc.renderer.render()

Write the rendering into an hdf5 file

bproc.writer.write_hdf5("output/", data) ```

BlenderProc creates the specified scene and renders the image into output/0.hdf5. To visualize that image, simply call:

bash blenderproc vis hdf5 output/0.hdf5

Thats it! You rendered your first image with BlenderProc!

Debugging in the Blender GUI

To understand what is actually going on, BlenderProc has the great feature of visualizing everything inside the blender UI. To do so, simply call your script with the debug instead of run subcommand: bash blenderproc debug quickstart.py Make sure that quickstart.py actually exists in your working directory.

Now the Blender UI opens up, the scripting tab is selected and the correct script is loaded. To start the BlenderProc pipeline, one now just has to press Run BlenderProc (see red circle in image). As in the normal mode, print statements are still printed to the terminal.

Front readme image

The pipeline can be run multiple times, as in the beginning of each run the scene is cleared.

Breakpoint-Debugging in IDEs

As blenderproc runs in blenders separate python environment, debugging your blenderproc script cannot be done in the same way as with any other python script. Therefore, remote debugging is necessary, which is explained for vscode and PyCharm in the following:

Debugging with vscode

First, install the debugpy package in blenders python environment.

blenderproc pip install debugpy

Now add the following configuration to your vscode launch.json.

json { "name": "Attach", "type": "python", "request": "attach", "connect": { "host": "localhost", "port": 5678 } }

Finally, add the following lines to the top (after the imports) of your blenderproc script which you want to debug.

python import debugpy debugpy.listen(5678) debugpy.wait_for_client()

Now run your blenderproc script as usual via the CLI and then start the added "Attach" configuration in vscode. You are now able to add breakpoints and go through the execution step by step.

Debugging with PyCharm Professional

In Pycharm, go to Edit configurations... and create a new configuration based on Python Debug Server. The configuration will show you, specifically for your version, which pip package to install and which code to add into the script. The following assumes Pycharm 2021.3:

First, install the pydevd-pycharm package in blenders python environment.

blenderproc pip install pydevd-pycharm~=212.5457.59

Now, add the following code to the top (after the imports) of your blenderproc script which you want to debug.

python import pydevd_pycharm pydevd_pycharm.settrace('localhost', port=12345, stdoutToServer=True, stderrToServer=True)

Then, first run your Python Debug Server configuration in PyCharm and then run your blenderproc script as usual via the CLI. PyCharm should then go in debug mode, blocking the next code line. You are now able to add breakpoints and go through the execution step by step.

What to do next?

As you now ran your first BlenderProc script, your ready to learn the basics:

Tutorials

Read through the tutorials, to get to know with the basic principles of how BlenderProc is used:

  1. Loading and manipulating objects
  2. Configuring the camera
  3. Rendering the scene
  4. Writing the results to file
  5. How key frames work
  6. Positioning objects via the physics simulator

Examples

We provide a lot of examples which explain all features in detail and should help you understand how BlenderProc works. Exploring our examples is the best way to learn about what you can do with BlenderProc. We also provide support for some datasets.

and much more, see our examples for more details.

Contributions

Found a bug? help us by reporting it. Want a new feature in the next BlenderProc release? Create an issue. Made something useful or fixed a bug? Start a PR. Check the contributions guidelines.

Change log

See our change log.

Citation

If you use BlenderProc in a research project, please cite as follows:

@article{Denninger2023, doi = {10.21105/joss.04901}, url = {https://doi.org/10.21105/joss.04901}, year = {2023}, publisher = {The Open Journal}, volume = {8}, number = {82}, pages = {4901}, author = {Maximilian Denninger and Dominik Winkelbauer and Martin Sundermeyer and Wout Boerdijk and Markus Knauer and Klaus H. Strobl and Matthias Humt and Rudolph Triebel}, title = {BlenderProc2: A Procedural Pipeline for Photorealistic Rendering}, journal = {Journal of Open Source Software} }


Owner

  • Name: DLR-RM
  • Login: DLR-RM
  • Kind: organization
  • Location: 48.08329, 11.27507

German Aerospace Center (DLR) - Institute of Robotics and Mechatronics (RM) - open source projects

JOSS Publication

BlenderProc2: A Procedural Pipeline for Photorealistic Rendering
Published
February 20, 2023
Volume 8, Issue 82, Page 4901
Authors
Maximilian Denninger ORCID
German Aerospace Center (DLR), Technical University of Munich (TUM)
Dominik Winkelbauer ORCID
German Aerospace Center (DLR), Technical University of Munich (TUM)
Martin Sundermeyer ORCID
German Aerospace Center (DLR), Technical University of Munich (TUM)
Wout Boerdijk ORCID
German Aerospace Center (DLR), Technical University of Munich (TUM)
Markus Knauer ORCID
German Aerospace Center (DLR)
Klaus H. Strobl ORCID
German Aerospace Center (DLR)
Matthias Humt ORCID
German Aerospace Center (DLR), Technical University of Munich (TUM)
Rudolph Triebel ORCID
German Aerospace Center (DLR), Technical University of Munich (TUM)
Editor
Kevin M. Moerman ORCID
Tags
Blender Photorealistic rendering Simulation Pipeline Dataset creation Neural networks Indoor Scene

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
title: "BlenderProc2"
version: 2.0.0
date-released: 2021-10-12
licence: GNU General Public License v3.0
authors:
  - family-names: Denninger
    given-names: Maximilian
    affiliation: "German Aerospace Center (DLR)"
    email: "maximilian.denninger@dlr.de"
    orcid: "https://orcid.org/0000-0002-1557-2234"
  - family-names: Sundermeyer
    given-names: Martin
    affiliation: "German Aerospace Center (DLR)"
    email: "martin.sundermeyer@dlr.de"
    orcid: "https://orcid.org/0000-0003-0587-9643"
  - family-names: Winkelbauer
    given-names: Dominik
    affiliation: "German Aerospace Center (DLR)"
    email: "dominik.winkelbauer@dlr.de"
    orcid: "https://orcid.org/0000-0001-7443-1071"
  - family-names: Olefir
    given-names: Dmitry
    affiliation: "German Aerospace Center (DLR)"
    orcid: "https://orcid.org/0000-0001-5244-9676"
  - family-names: Hodan
    given-names: Tomas
    affiliation: "Visual Recognition Group, Czech Technical University in Prague"
    email: "hodantom@cmp.felk.cvut.cz"
  - family-names: Zidan
    given-names: Youssef
    affiliation: "German Aerospace Center (DLR)"
  - family-names: Elbadrawy
    given-names: Mohamad
    affiliation: "German Aerospace Center (DLR)"
  - family-names: Knauer
    given-names: Markus
    affiliation: "German Aerospace Center (DLR)"
    email: "markus.knauer@dlr.de"
    orcid: "https://orcid.org/0000-0001-8229-9410"
  - family-names: Katam
    given-names: Harinandan
    affiliation: "German Aerospace Center (DLR)"
  - family-names: Lodhi
    given-names: Ahsan
    affiliation: "German Aerospace Center (DLR)"
  - family-names: Penzkofer
    given-names: Anna
    affiliation: "German Aerospace Center (DLR)"
repository-code: "https://github.com/DLR-RM/BlenderProc/"
url: "https://dlr-rm.github.io/BlenderProc/"
abstract: "BlenderProc is a modular procedural pipeline, which helps in generating real looking images for the training of convolutional neural networks. These can be used in a variety of use cases including segmentation, depth, normal and pose estimation and many others. A key feature of our extension of blender is the simple to use modular pipeline, which was designed to be easily extendable. By offering standard modules, which cover a variety of scenarios, we provide a starting point on which new modules can be created."
keywords:
  - "machine learning"
  - "deep learning"
  - "artificial intelligence"
  - "computer vision"
  - "simulation"
  - "photo realistic rendering"
  - "blender"
  - "robot framework"
  - "dataset generation"
references:
  - type: article
    title: "BlenderProc"
    authors:
      - family-names: Denninger
        given-names: Maximilian
        affiliation: "German Aerospace Center (DLR)"
        email: "maximilian.denninger@dlr.de"
        orcid: "https://orcid.org/0000-0002-1557-2234"
      - family-names: Sundermeyer
        given-names: Martin
        affiliation: "German Aerospace Center (DLR)"
        email: "martin.sundermeyer@dlr.de"
        orcid: "https://orcid.org/0000-0003-0587-9643"
      - family-names: Winkelbauer
        given-names: Dominik
        affiliation: "German Aerospace Center (DLR)"
        email: "dominik.winkelbauer@dlr.de"
        orcid: "https://orcid.org/0000-0001-7443-1071"
      - family-names: Zidan
        given-names: Youssef
        affiliation: "German Aerospace Center (DLR)"
      - family-names: Olefir
        given-names: Dmitry
        affiliation: "German Aerospace Center (DLR)"
        orcid: "https://orcid.org/0000-0001-5244-9676"
      - family-names: Elbadrawy
        given-names: Mohamad
        affiliation: "German Aerospace Center (DLR)"
      - family-names: Lodhi
        given-names: Ahsan
        affiliation: "German Aerospace Center (DLR)"
      - family-names: Katam
        given-names: Harinandan
        affiliation: "German Aerospace Center (DLR)"
    year: 2019
    url: https://arxiv.org/abs/1911.01911
  - type: article
    title: "BlenderProc: Reducing the Reality Gap with Photorealistic Rendering"
    authors:
      - family-names: Denninger
        given-names: Maximilian
        affiliation: "German Aerospace Center (DLR)"
        email: "maximilian.denninger@dlr.de"
        orcid: "https://orcid.org/0000-0002-1557-2234"
      - family-names: Sundermeyer
        given-names: Martin
        affiliation: "German Aerospace Center (DLR)"
        email: "martin.sundermeyer@dlr.de"
        orcid: "https://orcid.org/0000-0003-0587-9643"
      - family-names: Winkelbauer
        given-names: Dominik
        affiliation: "German Aerospace Center (DLR)"
        email: "dominik.winkelbauer@dlr.de"
        orcid: "https://orcid.org/0000-0001-7443-1071"
      - family-names: Olefir
        given-names: Dmitry
        affiliation: "German Aerospace Center (DLR)"
        orcid: "https://orcid.org/0000-0001-5244-9676"
      - family-names: Hodan
        given-names: Tomas
        affiliation: "Visual Recognition Group, Czech Technical University in Prague"
        email: "hodantom@cmp.felk.cvut.cz"
      - family-names: Zidan
        given-names: Youssef
        affiliation: "German Aerospace Center (DLR)"
      - family-names: Elbadrawy
        given-names: Mohamad
        affiliation: "German Aerospace Center (DLR)"
      - family-names: Knauer
        given-names: Markus
        affiliation: "German Aerospace Center (DLR)"
        email: "markus.knauer@dlr.de"
        orcid: "https://orcid.org/0000-0001-8229-9410"
      - family-names: Katam
        given-names: Harinandan
        affiliation: "German Aerospace Center (DLR)"
      - family-names: Lodhi
        given-names: Ahsan
        affiliation: "German Aerospace Center (DLR)"
    year: 2020
    conference: "International Conference on Robotics: Sciene and Systems, RSS 2020"
    url: "https://sim2real.github.io/assets/papers/2020/denninger.pdf"




GitHub Events

Total
  • Create event: 5
  • Release event: 2
  • Issues event: 60
  • Watch event: 412
  • Delete event: 2
  • Issue comment event: 120
  • Push event: 15
  • Pull request review comment event: 23
  • Pull request review event: 29
  • Pull request event: 25
  • Fork event: 36
Last Year
  • Create event: 5
  • Release event: 2
  • Issues event: 60
  • Watch event: 414
  • Delete event: 2
  • Issue comment event: 121
  • Push event: 15
  • Pull request review comment event: 23
  • Pull request review event: 29
  • Pull request event: 25
  • Fork event: 36

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 3,868
  • Total Committers: 67
  • Avg Commits per committer: 57.731
  • Development Distribution Score (DDS): 0.683
Past Year
  • Commits: 74
  • Committers: 7
  • Avg Commits per committer: 10.571
  • Development Distribution Score (DDS): 0.581
Top Committers
Name Email Commits
Maximilian Denninger M****r@d****e 1,228
Dominik Winkelbauer d****r@d****e 836
Martin Sundermeyer m****r@d****e 507
Dmitry Olefir d****r@d****e 380
Mohamad Elbadrawy m****y@d****e 138
wboerdijk w****k@t****e 130
Youssef Zidan y****n@d****e 120
Markus Knauer m****r@d****e 119
Moiz Sajid M****d@d****e 53
Zdenek Dolezal z****o@p****m 39
Klaus Strobl K****l@d****e 29
Sebastian Jung s****g@d****e 28
Wout Boerdijk w****k@d****e 25
Ahsan Lodhi a****i@d****e 24
Tomas Hodan t****n@g****m 17
mansoorcheema m****1@g****m 15
David Risch d****h@d****e 14
apenzko 3****o 14
Matthias Humt m****t@d****e 13
Maximilian Mühlbauer m****r@t****e 12
Ahmed Bahnasy b****v@g****m 11
Matthias Humt g****0@p****t 9
Hohn, Marcel m****n@d****e 8
victorlouisdg v****g@g****m 7
Gu Wang w****2 6
Moiz Sajid m****9@g****m 6
hansaskov h****9@g****m 6
marwin w****s@g****e 5
Anna Penzkofer A****r@d****e 5
Harinandan Katam h****m@d****e 4
and 37 more...

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 306
  • Total pull requests: 111
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 15 days
  • Total issue authors: 199
  • Total pull request authors: 31
  • Average comments per issue: 2.66
  • Average comments per pull request: 2.3
  • Merged pull requests: 76
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 42
  • Pull requests: 27
  • Average time to close issues: 5 days
  • Average time to close pull requests: 10 days
  • Issue authors: 35
  • Pull request authors: 8
  • Average comments per issue: 0.57
  • Average comments per pull request: 1.67
  • Merged pull requests: 16
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • monajalal (8)
  • soans1994 (8)
  • MartinSmeyer (7)
  • Sebastian-Jung (6)
  • Varatharajan-Raja (5)
  • xdobetter (5)
  • prrw (5)
  • AndreyYashkin (4)
  • saprrow (4)
  • WHHHHY (4)
  • eugenelyj (4)
  • wang-shuaikang (4)
  • freLorbeer (4)
  • TheIOne (3)
  • Uio96 (3)
Pull Request Authors
  • cornerfarmer (28)
  • hummat (12)
  • Sebastian-Jung (7)
  • Griperis (7)
  • MartinSmeyer (5)
  • tomole444 (5)
  • saprrow (5)
  • AndreyYashkin (4)
  • burcam (4)
  • matteomastrogiuseppe (4)
  • hiroaki-santo (3)
  • wboerdijk (3)
  • hansaskov (3)
  • johan-apes (2)
  • rasmushaugaard (2)
Top Labels
Issue Labels
question (200) first answer provided (109) enhancement (57) bug (33) bug_on_windows (2) feature request (2) third party bug (1) documentation (1) bug? (1) Apple M1 Problem (1)
Pull Request Labels
cla-signed (64)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 55,377 last-month
  • Total docker downloads: 1,021
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 3
    (may contain duplicates)
  • Total versions: 79
  • Total maintainers: 3
pypi.org: blenderproc
  • Versions: 19
  • Dependent Packages: 0
  • Dependent Repositories: 3
  • Downloads: 55,377 Last month
  • Docker Downloads: 1,021
Rankings
Stargazers count: 1.5%
Forks count: 2.6%
Docker downloads count: 3.2%
Downloads: 3.7%
Average: 5.0%
Dependent repos count: 8.9%
Dependent packages count: 10.1%
Last synced: 4 months ago
proxy.golang.org: github.com/DLR-RM/BlenderProc
  • Versions: 30
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 4 months ago
proxy.golang.org: github.com/dlr-rm/blenderproc
  • Versions: 30
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 7.0%
Average: 8.2%
Dependent repos count: 9.3%
Last synced: 4 months ago

Dependencies

setup.py pypi
  • setuptools *
.github/workflows/blenderprochelper.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v3 composite
.github/workflows/draft-pdf.yml actions
  • actions/checkout v2 composite
  • actions/upload-artifact v1 composite
  • openjournals/openjournals-draft-action master composite