Emil Ernerfeldt commited on
Commit
2959351
1 Parent(s): b8bd752

Log more parts of the dataframe

Browse files
Files changed (1) hide show
  1. main.py +18 -6
main.py CHANGED
@@ -6,16 +6,28 @@ import rerun as rr
6
  from datasets import load_dataset
7
 
8
  # download/load dataset in pyarrow format
 
9
  dataset = load_dataset("lerobot/pusht", split="train")
10
 
11
  # select the frames belonging to episode number 5
 
12
  ds_subset = dataset.filter(lambda frame: frame["episode_id"] == 5)
13
 
14
- # load all frames in RAM in PIL format
15
- frames = ds_subset["observation.image"]
16
-
17
  rr.init("rerun_example_lerobot", spawn=True)
18
 
19
- for i, frame in enumerate(frames):
20
- rr.set_time_sequence("frame", i)
21
- rr.log("observation/image", rr.Image(frame))
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  from datasets import load_dataset
7
 
8
  # download/load dataset in pyarrow format
9
+ print("Loading dataset…")
10
  dataset = load_dataset("lerobot/pusht", split="train")
11
 
12
  # select the frames belonging to episode number 5
13
+ print("Select specific episode…")
14
  ds_subset = dataset.filter(lambda frame: frame["episode_id"] == 5)
15
 
16
+ print("Starting Rerun…")
 
 
17
  rr.init("rerun_example_lerobot", spawn=True)
18
 
19
+ print("Logging to Rerun…")
20
+ for frame_id, timestamp, image, state, action, next_reward in zip(
21
+ ds_subset["frame_id"],
22
+ ds_subset["timestamp"],
23
+ ds_subset["observation.image"],
24
+ ds_subset["observation.state"],
25
+ ds_subset["action"],
26
+ ds_subset["next.reward"],
27
+ ):
28
+ rr.set_time_sequence("frame_id", frame_id)
29
+ rr.set_time_seconds("timestamp", timestamp)
30
+ rr.log("observation/image", rr.Image(image))
31
+ rr.log("observation/state", rr.BarChart(state))
32
+ rr.log("observation/action", rr.BarChart(action))
33
+ rr.log("next/reward", rr.Scalar(next_reward))