Skip to content

dolphin-in-a-coma/pybatchrender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyBatchRender

Open In Colab

Fast batch 3D rendering for TorchRL environments using Panda3D. Try the CartPole demo in Colab to get started.

Installation

pip install git+https://github.com/dolphin-in-a-coma/pybatchrender.git

From source:

pip install -e .

Optional extras:

pip install "pybatchrender[images]"  # For saving frames
pip install "pybatchrender[cuda]"    # For CUDA interop (Linux/Windows with NVIDIA)

Quickstart

With pre-made environments:

import pybatchrender as pbr

env = pbr.envs.make("CartPole-v0", num_scenes=256)
td = env.reset()

for step in range(100):
    td["action"] = env.action_spec.rand()
    td = env.step(td)
    td = td["next"]

Render simple scene:

from pybatchrender import PBRConfig, PBRRenderer

cfg = PBRConfig(num_scenes=4, tile_resolution=(64, 64), offscreen=True)
renderer = PBRRenderer(cfg)

renderer.add_camera()
renderer.add_light()
renderer.add_node('models/box', instances_per_scene=1, shared_across_scenes=True)
renderer.setup_environment()

img_batch = renderer.step(return_pixels=True)
print(img_batch.shape)  # torch.Size([4, 3, 64, 64])

License

MIT

About

PyBatchRender: 1M+ FPS batched 3D rendering in Python. Designed for RL from pixels.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors