mani_skill.trajectory.convert_to_lerobot ======================================== .. py:module:: mani_skill.trajectory.convert_to_lerobot .. autoapi-nested-parse:: 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: https://github.com/huggingface/lerobot Attributes ---------- .. autoapisummary:: mani_skill.trajectory.convert_to_lerobot.DEFAULT_CHUNKS_SIZE mani_skill.trajectory.convert_to_lerobot.DEFAULT_FPS mani_skill.trajectory.convert_to_lerobot.DEFAULT_IMAGE_SIZE mani_skill.trajectory.convert_to_lerobot.logger mani_skill.trajectory.convert_to_lerobot.parsed_args Classes ------- .. autoapisummary:: mani_skill.trajectory.convert_to_lerobot.Args Functions --------- .. autoapisummary:: mani_skill.trajectory.convert_to_lerobot.calculate_statistics mani_skill.trajectory.convert_to_lerobot.create_directory_structure mani_skill.trajectory.convert_to_lerobot.create_meta_files mani_skill.trajectory.convert_to_lerobot.create_video_from_frames mani_skill.trajectory.convert_to_lerobot.detect_rgb_cameras mani_skill.trajectory.convert_to_lerobot.load_metadata mani_skill.trajectory.convert_to_lerobot.load_trajectory_from_h5 mani_skill.trajectory.convert_to_lerobot.main mani_skill.trajectory.convert_to_lerobot.parse_image_size mani_skill.trajectory.convert_to_lerobot.process_episode mani_skill.trajectory.convert_to_lerobot.resize_image_with_padding Module Contents --------------- .. py:class:: Args .. py:attribute:: chunks_size :type: int :value: 1000 1000) :type: Episodes per chunk (default .. py:attribute:: fps :type: int :value: 30 30) :type: Video FPS (default .. py:attribute:: image_size :type: str :value: '640x480' 640x480) :type: Output image size as WIDTHxHEIGHT or single value for square (default .. py:attribute:: output_dir :type: str Output directory for LeRobot dataset .. py:attribute:: robot_type :type: Optional[str] :value: None auto-detected, e.g., "panda", "ur5") :type: Robot type (default .. py:attribute:: task_name :type: Optional[str] :value: None auto-detected from metadata) :type: Task description (default .. py:attribute:: traj_path :type: str Path to ManiSkill .h5 trajectory file .. py:function:: calculate_statistics(all_dataframes, all_rgb_data_by_camera, has_state) .. py:function:: create_directory_structure(output_dir, rgb_cameras, num_episodes, chunks_size = DEFAULT_CHUNKS_SIZE) .. py:function:: 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) .. py:function:: create_video_from_frames(frames, output_path, fps, image_width, image_height) .. py:function:: detect_rgb_cameras(obs_group) .. py:function:: load_metadata(h5_file) .. py:function:: load_trajectory_from_h5(h5_file) .. py:function:: main(args) .. py:function:: parse_image_size(size_str) .. py:function:: process_episode(episode_data, episode_idx, has_state, fps, task_index = 0, task_name = 'Unknown task') .. py:function:: resize_image_with_padding(image, target_size) .. py:data:: DEFAULT_CHUNKS_SIZE :value: 1000 .. py:data:: DEFAULT_FPS :value: 30 .. py:data:: DEFAULT_IMAGE_SIZE :value: '640x480' .. py:data:: logger .. py:data:: parsed_args :value: None