mani_skill.trajectory.convert_to_lerobot#
Converts ManiSkill HDF5 trajectory files to LeRobot v3.0 format.
- Usage:
python convert_maniskill_to_lerobot.py input.h5 output_dir –task-name “Pick cube”
For more information: huggingface/lerobot
Attributes#
Classes#
Functions#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Module Contents#
- class mani_skill.trajectory.convert_to_lerobot.Args[source]#
-
- image_size: str = '640x480'[source]#
640x480)
- Type:
Output image size as WIDTHxHEIGHT or single value for square (default
- mani_skill.trajectory.convert_to_lerobot.calculate_statistics(all_dataframes, all_rgb_data_by_camera, has_state)[source]#
- Parameters:
all_dataframes (List[pandas.DataFrame]) –
all_rgb_data_by_camera (Dict[str, List[numpy.ndarray]]) –
has_state (bool) –
- Return type:
Dict[str, Any]
- mani_skill.trajectory.convert_to_lerobot.create_directory_structure(output_dir, rgb_cameras, num_episodes, chunks_size=DEFAULT_CHUNKS_SIZE)[source]#
- Parameters:
output_dir (str) –
rgb_cameras (List[str]) –
num_episodes (int) –
chunks_size (int) –
- Return type:
pathlib.Path
- mani_skill.trajectory.convert_to_lerobot.create_meta_files(base_path, episode_lengths, total_frames, action_dim, state_dim, rgb_cameras, metadata, task_name, chunks_size, fps, image_width, image_height, all_dataframes, all_rgb_data_by_camera, robot_type_override=None)[source]#
- Parameters:
base_path (pathlib.Path) –
episode_lengths (List[int]) –
total_frames (int) –
action_dim (int) –
state_dim (Optional[int]) –
rgb_cameras (List[str]) –
metadata (Dict[str, Any]) –
task_name (str) –
chunks_size (int) –
fps (int) –
image_width (int) –
image_height (int) –
all_dataframes (List[pandas.DataFrame]) –
all_rgb_data_by_camera (Dict[str, List[numpy.ndarray]]) –
robot_type_override (Optional[str]) –
- Return type:
None
- mani_skill.trajectory.convert_to_lerobot.create_video_from_frames(frames, output_path, fps, image_width, image_height)[source]#
- Parameters:
frames (numpy.ndarray) –
output_path (pathlib.Path) –
fps (int) –
image_width (int) –
image_height (int) –
- Return type:
None
- mani_skill.trajectory.convert_to_lerobot.detect_rgb_cameras(obs_group)[source]#
- Parameters:
obs_group (h5py.Group) –
- Return type:
List[str]
- mani_skill.trajectory.convert_to_lerobot.load_metadata(h5_file)[source]#
- Parameters:
h5_file (pathlib.Path) –
- Return type:
Dict[str, Any]
- mani_skill.trajectory.convert_to_lerobot.load_trajectory_from_h5(h5_file)[source]#
- Parameters:
h5_file (pathlib.Path) –
- Return type:
Tuple[List[Dict[str, numpy.ndarray]], Dict[str, Any]]
- mani_skill.trajectory.convert_to_lerobot.parse_image_size(size_str)[source]#
- Parameters:
size_str (str) –
- Return type:
Tuple[int, int]
- mani_skill.trajectory.convert_to_lerobot.process_episode(episode_data, episode_idx, has_state, fps, task_index=0, task_name='Unknown task')[source]#
- Parameters:
episode_data (Dict[str, numpy.ndarray]) –
episode_idx (int) –
has_state (bool) –
fps (int) –
task_index (int) –
task_name (str) –
- Return type:
pandas.DataFrame