rfx.collection module provides a simple, LeRobot-native interface for collecting demonstration data from robots and pushing it directly to HuggingFace Hub.
collect
Collect episodes from a robot into a LeRobot dataset.Robot type identifier (e.g., “so101”)
HuggingFace Hub repository ID (e.g., “my-org/demos”)
Local directory to store the dataset
Number of episodes to collect
Duration of each episode in seconds. If None, episodes run until keyboard interrupt.
Task label for the episodes
Frames per second for dataset recording
Dimensionality of the robot state vector
Names of cameras to record
Whether to automatically push the dataset to HuggingFace Hub after collection
Whether to also write MCAP sidecar files
The collected dataset
Example
open_dataset
Open an existing local LeRobot dataset.Repository ID of the dataset
Root directory containing datasets
The opened dataset
Example
Dataset
A LeRobot dataset wrapper with rfx helpers.create
Create a new empty dataset.Repository ID for the dataset
Root directory to store the dataset
Frames per second
Robot type identifier
Feature specification. If None, auto-built from state_dim and camera_names.
Dimensionality of the state vector
Names of cameras in the dataset
Shape of camera images (height, width, channels)
Whether to encode images as videos
open
Open an existing local dataset.from_hub
Pull a dataset from HuggingFace Hub.push
Push dataset to HuggingFace Hub.Optional repository ID. If None, uses the dataset’s existing repo_id.
Properties
Repository ID of the dataset
Number of episodes in the dataset
Total number of frames in the dataset
Frames per second of the dataset
summary
Return aggregate statistics about the dataset.Dictionary containing repo_id, num_episodes, num_frames, fps, and features
validate
Run quality checks on the dataset.Quality check thresholds
Validation results including passed status and statistics
Recorder
Real-time frame recorder that writes directly to a LeRobot Dataset. Thread-safe, designed to be called from a teleop control loop.create
Create a recorder with a new dataset.Repository ID for the dataset
Root directory to store the dataset
Frames per second
Robot type identifier
Dimensionality of the state vector
Names of cameras to record
Shape of camera images
Whether to encode images as videos
Whether to also write MCAP sidecar files
start_episode
Begin a new episode.Task label for the episode
add_frame
Add a single frame to the active episode. Thread-safe, called from the teleop control loop.Robot state vector
Action vector. If None, copies the state vector.
Dictionary mapping camera names to image arrays
save_episode
Finalize the current episode.Number of frames in the saved episode
push
Push the dataset to HuggingFace Hub.Properties
The underlying dataset being recorded to
Whether an episode is currently being recorded
