LeRobot Configuration
SUMMARY
Configure dataset reading with LeRobotDatasetConfig, recording with LeRobotDatasetWriterConfig, and video output with dedicated RGB and depth encoder configurations.
Choose a Configuration
| Configuration | Use |
|---|---|
LeRobotDatasetConfig | Loading, episode selection, temporal sampling, transforms, and decoding. |
LeRobotDatasetWriterConfig | Recording, buffering, streaming encoding, and shard sizes. |
RGBEncoderConfig | RGB video codec, quality, pixel format, and performance. |
DepthEncoderConfig | Depth video codec, quality, pixel format, range, and logarithmic encoding. |
Dataset Read Configuration
Use LeRobotDatasetConfig when loading an existing dataset.
Parameter Configuration
| Key | Type | Default | Description |
|---|---|---|---|
root | str | Path | None | None | Local dataset root. |
revision | str | None | None | Hub branch, tag, or commit. |
tolerance_s | float | 1e-4 | Timestamp synchronization tolerance. |
video_backend | str | None | None | Video decoder backend. |
depth_output_unit | str | "mm" | Decoded depth unit, "m" or "mm". |
episode_indices | list[int] | None | None | Episodes to load. |
episode_filter | Callable | None | None | Metadata predicate applied to candidate episodes. |
image_transforms | Callable | None | None | Transform applied after image decoding. |
delta_timestamps | dict[str, list[float]] | None | None | Temporal offsets requested per feature. |
force_cache_sync | bool | False | Refresh cached Hub data. |
return_uint8 | bool | False | Return visual values as uint8 rather than normalized tensors. |
download_videos | bool | True | Download video assets when fetching from the Hub. |
token | str | bool | None | None | Hugging Face authentication token behavior. |
Example
from telekinesis.dataengine import datasets
config = datasets.LeRobotDatasetConfig(
episode_indices=[0, 1],
delta_timestamps={"action": [0.0, 0.1, 0.2]},
depth_output_unit="m",
)
dataset = datasets.LeRobotDataset(
repo_id="lerobot/pusht",
local_path="results/lerobot/pusht",
config=config,
)Dataset Writer Configuration
Pass LeRobotDatasetWriterConfig to LeRobotDatasetLogger when recording episodes.
Parameter Configuration
| Key | Type | Default | Description |
|---|---|---|---|
tolerance_s | float | 1e-4 | Timestamp tolerance. |
image_writer_processes | int | 0 | Async image-writer processes. |
image_writer_threads | int | 0 | Async image-writer threads. |
video_backend | str | None | None | Video backend. |
batch_encoding_size | int | 1 | Episodes accumulated before video encoding. |
rgb_encoder | RGBEncoderConfig | None | None | RGB codec configuration. |
depth_encoder | DepthEncoderConfig | None | None | Depth codec and range configuration. |
streaming_encoding | bool | False | Encode camera frames during capture. |
encoder_queue_maxsize | int | 30 | Buffered frames per streaming camera. |
encoder_threads | int | None | None | Global encoding thread count. |
metadata_buffer_size | int | 10 | Episode metadata records buffered before flush. |
max_video_files_size_in_mb | int | None | None | Maximum video shard size. |
max_data_files_size_in_mb | int | None | None | Maximum Parquet shard size. |
Example
from telekinesis.dataengine import data_loggers, datasets
write_config = datasets.LeRobotDatasetWriterConfig(
tolerance_s=1e-4,
streaming_encoding=True,
encoder_queue_maxsize=60,
)
logger = data_loggers.LeRobotDatasetLogger(
repo_id="user/my_dataset",
local_path="results/user/my_dataset",
mode="create",
fps=30,
features=features,
config=write_config,
)RGB Encoder Configuration
Use RGBEncoderConfig to control RGB video encoding.
INFO
Please note this in in active development. And the parameter will be updated freqeuntly.
Parameter Configuration
| Key | Type | Default | Description |
|---|---|---|---|
vcodec | str | "libsvtav1" | Video codec, or "auto" for automatic selection. |
pix_fmt | str | "yuv420p" | Encoded pixel format. |
g | int | None | 2 | Group-of-pictures size. |
crf | int | float | None | 30 | Quality level; lower values generally increase quality and file size. |
preset | int | str | None | Codec-specific | Encoding speed and quality preset. |
fast_decode | int | 0 | Codec-specific fast-decoding tuning. |
video_backend | str | "pyav" | Encoding backend. |
extra_options | dict[str, Any] | {} | Additional codec options. |
Example
from telekinesis.dataengine import datasets
from telekinesis.dataengine.datasets.lerobot.configs import RGBEncoderConfig
rgb_encoder = RGBEncoderConfig(
vcodec="libsvtav1",
pix_fmt="yuv420p",
crf=24,
)
write_config = datasets.LeRobotDatasetWriterConfig(
rgb_encoder=rgb_encoder,
)Depth Encoder Configuration
Use DepthEncoderConfig to control depth video encoding and represented depth range.
INFO
Please note this in in active development. And the parameter will be updated freqeuntly.
Parameter Configuration
| Key | Type | Default | Description |
|---|---|---|---|
vcodec | str | "hevc" | Video codec, or "auto" for automatic selection. |
pix_fmt | str | "gray12le" | Encoded pixel format. |
g | int | None | 2 | Group-of-pictures size. |
crf | int | float | None | 30 | Quality level; lower values generally increase quality and file size. |
preset | int | str | None | Codec-specific | Encoding speed and quality preset. |
fast_decode | int | 0 | Codec-specific fast-decoding tuning. |
video_backend | str | "pyav" | Encoding backend. |
extra_options | dict[str, Any] | {} | Additional codec options. |
depth_min | float | 0.01 | Minimum represented depth. |
depth_max | float | 10.0 | Maximum represented depth. |
shift | float | 3.5 | Shift used by depth encoding. |
use_log | bool | True | Encode depth values logarithmically. |
Example
from telekinesis.dataengine import datasets
from telekinesis.dataengine.datasets.lerobot.configs import DepthEncoderConfig
depth_encoder = DepthEncoderConfig(
vcodec="hevc",
pix_fmt="gray12le",
crf=24,
depth_min=0.01,
depth_max=10.0,
use_log=True,
)
write_config = datasets.LeRobotDatasetWriterConfig(
depth_encoder=depth_encoder,
)Next Steps
Load with a Configuration
Select episodes, temporal windows, transforms, and decoding behavior.
Load dataset →Create a Dataset
Define a frame rate and feature schema for a new writable dataset.
Create dataset →Record Demonstrations
Apply writer and encoder settings during live episode recording.
Start recording →