All Projects → cheind → Pytorch Blender

cheind / Pytorch Blender

Licence: mit
Seamless, distributed, real-time integration of Blender into PyTorch data pipelines

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytorch Blender

Stable Baselines
Mirror of Stable-Baselines: a fork of OpenAI Baselines, implementations of reinforcement learning algorithms
Stars: ✭ 115 (-57.72%)
Mutual labels:  reinforcement-learning, openai-gym
Ravens
Train robotic agents to learn pick and place with deep learning for vision-based manipulation in PyBullet. Transporter Nets, CoRL 2020.
Stars: ✭ 133 (-51.1%)
Mutual labels:  reinforcement-learning, openai-gym
Hierarchical Actor Critic Hac Pytorch
PyTorch implementation of Hierarchical Actor Critic (HAC) for OpenAI gym environments
Stars: ✭ 116 (-57.35%)
Mutual labels:  reinforcement-learning, openai-gym
Gym Ignition
Framework for developing OpenAI Gym robotics environments simulated with Ignition Gazebo
Stars: ✭ 97 (-64.34%)
Mutual labels:  reinforcement-learning, openai-gym
Tensorflow Rl
Implementations of deep RL papers and random experimentation
Stars: ✭ 176 (-35.29%)
Mutual labels:  reinforcement-learning, openai-gym
Cartpole
OpenAI's cartpole env solver.
Stars: ✭ 107 (-60.66%)
Mutual labels:  reinforcement-learning, openai-gym
Reinforcement learning
Implementation of selected reinforcement learning algorithms in Tensorflow. A3C, DDPG, REINFORCE, DQN, etc.
Stars: ✭ 132 (-51.47%)
Mutual labels:  reinforcement-learning, openai-gym
Treeqn
Stars: ✭ 77 (-71.69%)
Mutual labels:  reinforcement-learning, openai-gym
Coach
Reinforcement Learning Coach by Intel AI Lab enables easy experimentation with state of the art Reinforcement Learning algorithms
Stars: ✭ 2,085 (+666.54%)
Mutual labels:  reinforcement-learning, openai-gym
Gym Fx
Forex trading simulator environment for OpenAI Gym, observations contain the order status, performance and timeseries loaded from a CSV file containing rates and indicators. Work In Progress
Stars: ✭ 151 (-44.49%)
Mutual labels:  reinforcement-learning, openai-gym
Openaigym
Solving OpenAI Gym problems.
Stars: ✭ 98 (-63.97%)
Mutual labels:  reinforcement-learning, openai-gym
Ns3 Gym
ns3-gym - The Playground for Reinforcement Learning in Networking Research
Stars: ✭ 221 (-18.75%)
Mutual labels:  reinforcement-learning, openai-gym
Gym Electric Motor
Gym Electric Motor (GEM): An OpenAI Gym Environment for Electric Motors
Stars: ✭ 95 (-65.07%)
Mutual labels:  reinforcement-learning, openai-gym
Ctc Executioner
Master Thesis: Limit order placement with Reinforcement Learning
Stars: ✭ 112 (-58.82%)
Mutual labels:  reinforcement-learning, openai-gym
Cs234 Reinforcement Learning Winter 2019
My Solutions of Assignments of CS234: Reinforcement Learning Winter 2019
Stars: ✭ 93 (-65.81%)
Mutual labels:  reinforcement-learning, openai-gym
Reinforcementlearning Atarigame
Pytorch LSTM RNN for reinforcement learning to play Atari games from OpenAI Universe. We also use Google Deep Mind's Asynchronous Advantage Actor-Critic (A3C) Algorithm. This is much superior and efficient than DQN and obsoletes it. Can play on many games
Stars: ✭ 118 (-56.62%)
Mutual labels:  reinforcement-learning, openai-gym
Gym Minigrid
Minimalistic gridworld package for OpenAI Gym
Stars: ✭ 1,047 (+284.93%)
Mutual labels:  reinforcement-learning, openai-gym
Dmc2gym
OpenAI Gym wrapper for the DeepMind Control Suite
Stars: ✭ 75 (-72.43%)
Mutual labels:  reinforcement-learning, openai-gym
Holdem
🃏 OpenAI Gym No Limit Texas Hold 'em Environment for Reinforcement Learning
Stars: ✭ 135 (-50.37%)
Mutual labels:  reinforcement-learning, openai-gym
Gymfc
A universal flight control tuning framework
Stars: ✭ 210 (-22.79%)
Mutual labels:  reinforcement-learning, openai-gym

blendtorch

blendtorch is a Python framework to seamlessly integrate Blender into PyTorch datasets for deep learning from artificial visual data. We utilize Eevee, a new physically based real-time renderer, to synthesize images and annotations in real-time and thus avoid stalling model training in many cases.

Feature summary

  • Data Streaming: Stream distributed Blender renderings directly into PyTorch data pipelines in real-time for supervised learning and domain randomization applications. Supports arbitrary pickle-able objects to be send alongside images/videos. Built-in recording capability to replay data without Blender. Bi-directional communication channels allow Blender simulations to adapt during network training. More info [examples/datagen], [examples/compositor_normals_depth], [examples/densityopt]
  • OpenAI Gym Support: Create and run remotely controlled Blender gyms to train reinforcement agents. Blender serves as simulation, visualization, and interactive live manipulation environment. More info [examples/control]

The figure below visualizes the basic concept of blendtorch used in the context of generating artificial training data for a real-world detection task.

Getting started

  1. Read the installation instructions below
  2. To get started with blendtorch for training data training read [examples/datagen].
  3. To learn about using blendtorch for creating reinforcement training environments read [examples/control].

Cite

The code accompanies our academic work [1],[2] in the field of machine learning from artificial images. Please consider the following publications when citing blendtorch

@inproceedings{robotpose_etfa2019_cheind,
    author={Christoph Heindl, Sebastian Zambal, Josef Scharinger},
    title={Learning to Predict Robot Keypoints Using Artificially Generated Images},
    booktitle={
        24th IEEE International Conference on 
        Emerging Technologies and Factory Automation (ETFA)
    },    
    year={2019}
}

@inproceedings{blendtorch_icpr2020_cheind,
    author = {Christoph Heindl, Lukas Brunner, Sebastian Zambal and Josef Scharinger},
    title = {BlendTorch: A Real-Time, Adaptive Domain Randomization Library},
    booktitle = {
        1st Workshop on Industrial Machine Learning 
        at International Conference on Pattern Recognition (ICPR2020)
    },
    year = {2020},
}

Installation

blendtorch is composed of two distinct sub-packages: bendtorch.btt (in pkg_pytorch) and blendtorch.btb (in pkg_blender), providing the PyTorch and Blender views on blendtorch.

Prerequisites

This package has been tested with

  • Blender >= 2.83/2.91 (Python 3.7)
  • PyTorch >= 1.50 (Python 3.7/3.8) running Windows 10 and Linux.

Other versions might work as well, but have not been tested.

Clone this repository

git clone https://github.com/cheind/pytorch-blender.git <DST>

Extend PATH

Ensure Blender executable is in your environments lookup PATH. On Windows this can be accomplished by

set PATH=c:\Program Files\Blender Foundation\Blender 2.91;%PATH%

Complete Blender settings

Open Blender at least once, and complete the initial settings. If this step is missed, some of the tests (especially the tests relating RL) will fail (Blender 2.91).

Install blendtorch Blender part

blender --background --python <DST>/scripts/install_btb.py

installs blendtorch-btb into the Python environment bundled with Blender.

Install blendtorch PyTorch part

pip install -e <DST>/pkg_pytorch

installs blendtorch-btt into the Python environment that you intend to run PyTorch from. While not required, it is advised to install OpenAI gym if you intend to use blendtorch for reinforcement learning

pip install gym

Developer instructions

This step is optional. If you plan to run the unit tests

pip install -r requirements_dev.txt
pytest tests/

Troubleshooting

Run

blender --version

and check if the correct Blender version (>=2.83) is written to console. Next, ensure that blendtorch-btb installed correctly

blender --background --python-use-system-env --python-expr "import blendtorch.btb as btb; print(btb.__version__)"

which should print blendtorch version number on success. Next, ensure that blendtorch-btt installed correctly

python -c "import blendtorch.btt as btt; print(btt.__version__)"

which should print blendtorch version number on success.

Architecture

Please see [examples/datagen] and [examples/control] for an in-depth architectural discussion. Bi-directional communication is explained in [examples/densityopt].

Runtimes

The following tables show the mean runtimes per batch (8) and per image for a simple Cube scene (640x480xRGBA). See benchmarks/benchmark.py for details. The timings include rendering, transfer, decoding and batch collating. Reported timings are for Blender 2.8. Blender 2.9 performs equally well on this scene, but is usually faster for more complex renderings.

Blender Instances Runtime sec/batch Runtime sec/image Arguments
1 0.236 0.030 UI refresh
2 0.14 0.018 UI refresh
4 0.099 0.012 UI refresh
5 0.085 0.011 no UI refresh

Note: If no image transfer is needed, i.e in reinforcement learning of physical simulations, 2000Hz are easily achieved.

Caveats

  • Despite offscreen rendering is supported in Blender 2.8x it requires a UI frontend and thus cannot run in --background mode. If your application does not require offscreen renderings you may enable background usage (see tests/ for examples).
  • The renderings produced by Blender are by default in linear color space and thus will appear darker than expected when displayed.
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].