Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions python/rcs/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ def lerobot_convert(
success: Annotated[bool, typer.Option(help="Only include successful episodes. Example: --success")] = True,
n: Annotated[int, typer.Option(help="Maximum number of episodes to convert. -1 means all. Example: --n 50")] = -1,
video_encoding: Annotated[bool, typer.Option(help="Should the image data be video encoded")] = False,
video_backend: Annotated[
str | None, typer.Option(help="Video backend to use if image data is video encoded e.g. torchcodec")
] = None,
):
cameras = camera_specs_to_configs(camera_specs) if camera_specs is not None else list(DEFAULT_CAMERAS)
run_conversion(
Expand All @@ -164,6 +167,7 @@ def lerobot_convert(
success=success,
n=n,
video_encoding=video_encoding,
video_backend=video_backend,
)


Expand Down
4 changes: 4 additions & 0 deletions python/rcs/lerobot_joint_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def __init__(
image_batch_size: int = DEFAULT_IMAGE_BATCH_SIZE,
per_robot_arm_dim: int = DEFAULT_PER_ROBOT_ARM_DIM,
video_encoding: bool = False,
video_backend: str | None = None,
):
self.root = Path(root)
self.conn = duckdb.connect()
Expand Down Expand Up @@ -133,6 +134,7 @@ def __init__(
features=self._build_features(),
image_writer_threads=10,
image_writer_processes=5,
video_backend=video_backend,
)

def _build_features(self) -> dict[str, dict[str, Any]]:
Expand Down Expand Up @@ -416,6 +418,7 @@ def run_conversion(
success: bool = True,
n: int = -1,
video_encoding: bool = False,
video_backend: str | None = None,
) -> None:
robot_type_converted = RobotType(robot_type)
gripper_type_converted = GripperType(gripper_type)
Expand All @@ -432,6 +435,7 @@ def run_conversion(
image_batch_size=image_batch_size,
per_robot_arm_dim=per_robot_arm_dim,
video_encoding=video_encoding,
video_backend=video_backend,
)
converter.generate_examples(success=success, n=n)

Expand Down
Loading