code: def create_dataset(dataset_root, output_path):
      maybe_download(dataset_root)
  
      dataset_root = os.path.join(dataset_root, "AgentHuman")
      train_set_root = os.path.join(dataset_root, "SeqTrain")
      validation_set_root = os.path.join(dataset_root, "SeqVal")
  
      # training set extraction
      memory = ExperienceReplay(
          max_size=(MemoryGranularity.Transitions, sys.maxsize)
      )
      train_set_files = sorted(os.listdir(train_set_root))
      print("found {} files".format(len(train_set_files)))
      progress_bar = ProgressBar(len(train_set_files))
      for file_idx, file in enumerate(train_set_files[:3000]):
          progress_bar.update(
              file_idx, "extracting file {}".format(file)
          )
          train_set = h5py.File(os.path.join(train_set_root, file), "r")
          observations = train_set["rgb"][:]  # forward camera
          measurements = np.expand_dims(
              train_set["targets"][:, 10], -1
          )  # forward speed
          actions = train_set["targets"][:, :3]  # steer, gas, brake
  
          high_level_commands = (
              train_set["targets"][:, 24].astype("int") - 2
          )  # follow lane, left, right, straight
  
          file_length = train_set["rgb"].len()
          assert train_set["rgb"].len() == train_set["targets"].len()
  
          for transition_idx in range(file_length):
              transition = Transition(
                  state={
                      "CameraRGB": observations[transition_idx],
                      "measurements": measurements[transition_idx],
                      "high_level_command": high_level_commands[
                          transition_idx
                      ],
                  },
                  action=actions[transition_idx],
                  reward=0,
              )
              memory.store(transition)
      progress_bar.close()
      print("Saving pickle file to {}".format(output_path))
      memory.save(output_path)
  
file_path: coach/rl_coach/utilities/carla_dataset_to_replay_buffer.py
imports: import argparse
  import os
  import sys
  import h5py
  import numpy
  from rl_coach.core_types import Transition
  from rl_coach.memories.memory import MemoryGranularity
  from rl_coach.memories.non_episodic.experience_replay import ExperienceReplay
  from rl_coach.utils import ProgressBar, start_shell_command_and_wait
  from rl_coach.logger import screen
label_desc: Use image node_id 2 for calling a global function with example usage: create_dataset(dataset_root, output_path) without return types