Rerun Python SDK

0.31.2 · active · verified Sat Apr 11

The Rerun Python SDK is an open-source library for logging, storing, querying, and visualizing multimodal and multi-rate data. It provides Python APIs to stream data like images, tensors, point clouds, and text to the Rerun Viewer for live visualization or to a file for later use. It is currently in active development, with frequent releases, and is particularly useful in areas like robotics, simulation, and computer vision, aiming to help users understand and improve complex processes involving rich, time-aware multimodal data.

Warnings

Install

Imports

Quickstart

This quickstart logs a grid of colored 3D points to the Rerun Viewer. It initializes the SDK, generates synthetic data using NumPy, and then uses `rr.log` to send the `Points3D` archetype to the viewer. The `spawn=True` argument automatically launches the Rerun Viewer application.

import rerun as rr
import numpy as np

# Initialize Rerun with an application ID and spawn the viewer.
# The 'spawn=True' argument will automatically open the Rerun Viewer application.
rr.init("my_first_rerun_app", spawn=True)

# Generate some example 3D data (a grid of points with colors).
SIZE = 10
pos_grid = np.meshgrid(*[np.linspace(-5, 5, SIZE)] * 3)
positions = np.vstack([d.ravel() for d in pos_grid]).T

col_grid = np.meshgrid(*[np.linspace(0, 255, SIZE)] * 3)
colors = np.vstack([c.ravel() for c in col_grid]).astype(np.uint8).T

# Log the 3D points with colors to an entity named 'my_points'.
rr.log(
    "my_points",
    rr.Points3D(positions, colors=colors, radii=0.5)
)

print("Logged 3D points. Check the Rerun Viewer!")

view raw JSON →