11from __future__ import annotations
22
3- import os
43from argparse import Namespace
4+ from pathlib import Path
55
66import rerun as rr
77from huggingface_hub import snapshot_download
@@ -21,18 +21,18 @@ def run(args: Namespace) -> None:
2121 # That means the `recording_id` needs to be set to "episode_0", otherwise the LeRobot dataloader
2222 # will create a new recording for episode 0, instead of merging it into the existing recording.
2323 # If you don't set it, you'll end up with 4 recordings, an empty one and the 3 episodes.
24- rec = rr .script_setup (args , f"{ os . path . basename (__file__ )} " , recording_id = "episode_0" )
24+ rec = rr .script_setup (args , f"{ Path (__file__ ). name } " , recording_id = "episode_0" )
2525
2626 # load dataset from huggingface
27- dataset_path = os . path . dirname (__file__ ) + "/ .datasets/ v21_apple_storage"
27+ dataset_path = Path (__file__ ). parent / " .datasets" / " v21_apple_storage"
2828 snapshot_download (repo_id = "rerun/v21_apple_storage" , local_dir = dataset_path , repo_type = "dataset" )
2929
3030 rec .log_file_from_path (dataset_path )
3131
3232 # NOTE: This dataloader works by creating a new recording for each episode.
3333 # So that means we need to log the README to each recording.
3434 for i in range (3 ):
35- rec = rr .script_setup (args , f"{ os . path . basename (__file__ )} " , recording_id = f"episode_{ i } " )
35+ rec = rr .script_setup (args , f"{ Path (__file__ ). name } " , recording_id = f"episode_{ i } " )
3636 rec .set_time ("frame_index" , sequence = 0 )
3737 rec .log ("/readme" , rr .TextDocument (README ), static = True )
3838
0 commit comments