File size: 1,048 Bytes
1602469
 
 
 
 
 
 
 
2959351
1602469
 
 
2959351
1602469
 
2959351
1602469
 
2959351
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3

from __future__ import annotations

import rerun as rr
from datasets import load_dataset

# download/load dataset in pyarrow format
print("Loading dataset…")
dataset = load_dataset("lerobot/pusht", split="train")

# select the frames belonging to episode number 5
print("Select specific episode…")
ds_subset = dataset.filter(lambda frame: frame["episode_id"] == 5)

print("Starting Rerun…")
rr.init("rerun_example_lerobot", spawn=True)

print("Logging to Rerun…")
for frame_id, timestamp, image, state, action, next_reward in zip(
    ds_subset["frame_id"],
    ds_subset["timestamp"],
    ds_subset["observation.image"],
    ds_subset["observation.state"],
    ds_subset["action"],
    ds_subset["next.reward"],
):
    rr.set_time_sequence("frame_id", frame_id)
    rr.set_time_seconds("timestamp", timestamp)
    rr.log("observation/image", rr.Image(image))
    rr.log("observation/state", rr.BarChart(state))
    rr.log("observation/action", rr.BarChart(action))
    rr.log("next/reward", rr.Scalar(next_reward))