mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-20 11:09:59 +00:00
7ab4936b1b
* Add extensive language support * Address review: split persistent/event schemas, drop event timestamps - recipe.py: derive _VALID_ROLES/_VALID_STREAMS from MessageRole/MessageStream Literals - dataset_metadata.py: keep CODEBASE_VERSION at v3.0 - language.py: remove RESERVED_STYLES; split arrow/feature schemas into persistent (with timestamp) and event (without timestamp); add docstrings - language_render.py: events use frame-row timestamp implicitly; no per-event timestamp filtering or sorting - converters.py: drop unused subtask_key passthrough - add docstrings to new public APIs (recipe, render_messages_processor, collate) - update tests for split schemas; revert uv.lock Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Add docstrings to all new helpers; revert uv.lock Covers private helpers in recipe.py, language.py, language_render.py, and render_messages_processor.py. Also reverts uv.lock to main (it was re-generated by `uv run` during local checks). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(language): add motion (persistent) and trace (event-only) styles Promote the previously-reserved motion/trace styles to first-class core styles. motion routes to language_persistent (it tracks robot state over time); trace routes to language_events (single-moment annotations). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(language): per-camera tagging on view-dependent styles Adds a nullable `camera` field to the language row struct (both persistent and event variants) so view-dependent styles like `vqa` can carry which `observation.images.*` view they were grounded against. Without this, multi-camera datasets ended up with multiple `(vqa, role)` rows at the same timestamp that the resolver could not disambiguate. - `language.py`: add `camera` to PERSISTENT_ROW_FIELDS / EVENT_ROW_FIELDS, to both Arrow struct types and the HF datasets feature mappings; introduce VIEW_DEPENDENT_STYLES = {vqa, motion, trace} plus `is_view_dependent_style` and `validate_camera_field` helpers (camera required iff style is view-dependent). - `language_render.py`: thread an optional `camera=` kwarg through every resolver (`active_at`, `emitted_at`, `nth_prev`, `nth_next`) and through `_matching_rows` / `_select_*`, so recipes can disambiguate per-camera VQA with `emitted_at(t, style=vqa, role=assistant, camera=...)`. Without a `camera` filter, multi-row matches keep raising the existing ambiguity error — which is the desired behaviour on multi-camera data. - `recipes/pi05_hirobot.yaml`: replace the single `ask_vqa` branch with `ask_vqa_top` and `ask_vqa_wrist` per-camera sub-recipes (each carrying the matching image block), keeping the original 0.20 budget and documenting the customization point for datasets with different cameras. - Tests: schema test asserts the new field order; new tests cover `is_view_dependent_style`, `validate_camera_field` (both required and forbidden directions), per-camera `emitted_at` filtering, and the ambiguity error when two cameras emit `(vqa, assistant)` at the same timestamp without a `camera=` filter. RenderMessagesStep + dataset passthrough fixtures updated to include the new field. - `docs/source/language_and_recipes.mdx`: document the `camera` field, the per-camera resolver pattern, and the canonical recipe convention. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(language): drop motion from VIEW_DEPENDENT_STYLES Motion primitives are described in robot-frame (joint / Cartesian) terms, not pixel space, so they are camera-agnostic. Only `vqa` (event) and `trace` (event, pixel-trajectory) are view-dependent. The `camera` field stays on PERSISTENT_ROW_FIELDS for schema symmetry — the validator, resolver, and HF feature mapping behave identically across the two columns regardless of which styles populate `camera` today — but persistent rows now always have `camera=None` in practice. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(language): task_aug style + automatic ${task} rephrasing rotation Adds task-prompt diversity (Xiao 2022 / CAST) without touching ``meta/tasks.parquet`` or forcing recipes to opt in. The plan reserved ``task_aug`` as a future style; this lands it now. - ``language.py``: add ``task_aug`` to ``CORE_STYLES`` and ``PERSISTENT_STYLES``. ``column_for_style("task_aug")`` returns ``language_persistent`` so PR 2 writers route it correctly. - ``language_render.py``: ``_resolve_task`` now consults the persistent slice for rows of ``style="task_aug", role="user"``. When any exist it picks one deterministically by ``sample_idx`` (blake2b-keyed, not Python's randomized hash) so an epoch sees every rephrasing of every episode while the same sample still resolves identically across reruns. Falls back to the canonical ``meta/tasks.parquet`` task when no rephrasings are present, so existing datasets and unannotated runs keep their behaviour. Explicit ``task=`` overrides still win. - Tests: rephrasing coverage across samples, determinism on repeat ``sample_idx``, fallback when persistent has no ``task_aug`` rows, and explicit override priority. Recipes get this for free: any ``${task}`` placeholder rotates through the available rephrasings. Recipes that want the literal canonical task can override the binding. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(language): tool catalog in meta/info.json + LeRobotDatasetMetadata.tools Stores OpenAI-style function schemas at ``meta/info.json["tools"]`` so datasets can declare which tools are available (today: just ``say``; tomorrow: per-dataset extensions). The ``DEFAULT_TOOLS`` constant fills in for unannotated datasets so chat-template consumers don't have to special-case anything. Three pieces: - ``language.py``: ``SAY_TOOL_SCHEMA`` and ``DEFAULT_TOOLS`` constants. Single source of truth — PR 2's writer and PR 3's runtime tool registry will both import from here instead of duplicating the dict. - ``dataset_metadata.py``: ``LeRobotDatasetMetadata.tools`` property reads ``info.json["tools"]`` and falls back to ``DEFAULT_TOOLS``. Returns deep-copied dicts so callers can mutate the result safely. - ``docs/source/tools.mdx``: spec page covering the catalog, per-row invocations, and the three-step "how to add a new tool" workflow (declare schema, implement, register). Linked from the docs toctree under the Datasets section. This lays the groundwork for PR 2's pipeline writing the catalog out during annotation, and PR 3's ``src/lerobot/tools/`` package shipping runnable implementations (one file per tool — first up: ``say.py`` wrapping Kyutai's pocket-tts). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Apply ruff and prettier formatting after merge Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(language): unify resolver dispatch and prune redundant test scaffolding * Drop the unused `events` kwarg from `active_at`/`nth_prev`/`nth_next`; only `emitted_at` actually consults events. The dispatcher in `_resolve_spec` now passes events conditionally. * Replace the dual `_persistent_sort_key`/`_event_sort_key` pair with a single `_row_sort_key` and drop the `sort_key` parameter from `_select_one`. Event rows lack `timestamp` (it is implicit in the frame) and now default to `0.0` for sort purposes — the `(style, role)` tiebreaker is unchanged. * Inline `_select_latest` into `active_at` (its only caller). * Collapse `emitted_at`'s dual-branch into one `_select_one` call. * Tighten `_validate_persistent_resolver` to a single `column_for_style(style) != LANGUAGE_PERSISTENT` check. * Parameterize `test_per_camera_blend_renders_both_views` over the two cameras and factor the sub-recipe builder into `_vqa_subrecipe` so the test no longer hand-rolls two near-identical recipe blocks. Net -98 LOC; behavior, public resolver names, and test expectations unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(language): always raise on ambiguous resolver matches `_select_one` previously skipped its ambiguity check whenever any of `role`/`tool_name`/`camera` was set, on the assumption that the caller had already pinned down a unique row. That left a real ambiguity hole for VQA: with two cameras emitting `(vqa, assistant)` at the same frame, `emitted_at(..., role="assistant")` silently picked the first sorted row instead of telling the recipe to add `camera=...`. The existing `test_emitted_at_raises_on_ambiguous_per_camera_vqa` test already encoded the desired behavior. Tighten the check: any time `len(rows) > 1` we now raise with the selectors echoed back, so users see exactly which fields they passed and that more is needed to disambiguate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: fix CI — collapse short ValueError to one line, refresh uv.lock * `ruff format` on CI (newer version) wants the short `camera=None` ValueError on a single line. * `uv.lock` was stale relative to `pyproject.toml`'s `datasets>=4.7.0` pin (and picked up upstream `s390x` marker fixes for cuda packages). CI runs `uv sync --locked` which rejected the divergence. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(language): keep base install green — drop processor re-export, gate dataset-extra tests `lerobot.processor` re-exported `RenderMessagesStep` at the package level, so importing anything from `lerobot.processor` pulled in `lerobot.datasets.language` → `lerobot.datasets/__init__.py` → `require_package("datasets")`, which fails in the Tier 1 base install that intentionally omits the `[dataset]` extra. The chain bricked collection for unrelated suites (`tests/policies/pi0_pi05/...`, `tests/envs/...`, etc.). * Stop re-exporting `RenderMessagesStep` from `lerobot.processor`. The only consumer (the test) already imports from the submodule. Document the deliberate omission in the module docstring. * Add `pytest.importorskip("datasets", ...)` (and `pandas` where needed) at the top of the four PR-added tests that exercise the language stack: - tests/datasets/test_language.py - tests/datasets/test_language_render.py - tests/processor/test_render_messages_processor.py - tests/utils/test_collate.py Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(language): address review — tools accessor, motion docs, conditional collate * **`meta.tools` actually reads `info.json["tools"]`.** `DatasetInfo` had no `tools` field, so `from_dict` silently dropped the key (it warned about unknown fields then discarded them) and the property always returned `DEFAULT_TOOLS`. Added `tools: list[dict] | None` to the dataclass; `to_dict()` drops it when unset so existing datasets keep a clean `info.json`. Fixed the accessor to read `self.info.tools` (the previous `.get(...)` would have raised AttributeError on the dataclass anyway). Added regression tests: fallback when absent, round-trip from disk, and round-trip through `DatasetInfo.from_dict` / `to_dict`. * **`motion` is not view-dependent — fix the docs.** The mdx claimed rows of style `motion` must carry `camera`, but `VIEW_DEPENDENT_STYLES = {"vqa", "trace"}` and the validator agrees: motion primitives are joint/Cartesian-frame, not pixel-space. Updated both call-out paragraphs in `language_and_recipes.mdx`. * **Conditional `collate_fn` swap.** Added `meta.has_language_columns` and gate the `lerobot_collate_fn` swap in `lerobot_train.py` on it, so non-language datasets keep PyTorch's `default_collate`. Also added a pass-through test in `test_collate.py` that asserts on a plain tensor batch the custom collate matches `default_collate` key-for-key, plus a test for the `None`-sample drop path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * review: dedupe regex, centralize column names, harden collate, more tests * **#2 — dedupe `_PLACEHOLDER_RE`.** The same regex was compiled in `recipe.py` and `language_render.py`. Promote to module-level `PLACEHOLDER_RE` in `recipe.py` (its primary owner — declares template syntax) and import from `language_render.py`. * **#3 — centralize language column names.** `io_utils.py` had hardcoded `{"language_persistent", "language_events"}` literals at two sites. Replace with `LANGUAGE_COLUMNS` import so a future column rename can't silently desync. * **#4 — defensive collate preserved-keys.** `lerobot_collate_fn` silently filtered language fields from samples that didn't have them, which would hand downstream consumers a preserved list shorter than the tensor batch. Now: if any sample carries a key, every sample in the batch must carry it; otherwise raise a `ValueError` so the upstream rendering bug surfaces at the boundary. * **#5 — `_scalar` rejects non-singleton lists.** Previously a zero- or multi-element list fell through and triggered confusing `float([])` errors downstream. Now raises `ValueError` with the actual length. * **#6 — refactor `_extract_complementary_data`.** Replace 11 lines of `key = {... if ... else {}}` plus an 11-line splat dict with a single `_COMPLEMENTARY_KEYS` tuple iterated once. * **#7 — document `EXTENDED_STYLES`.** Was an empty `set()` with no comment. Add a docstring explaining it's an intentional extension point: downstream modules append project-local styles before `column_for_style` is called. * **#9 — `tools.mdx` notes the runtime layer is future work.** The page referenced `src/lerobot/tools/`, `registry.py`, and `get_tools(meta)` — none exist in this PR. Added a callout at the start of "How to add your own tool" plus a note on the implementations paragraph. * **#10 — tests for YAML round-trip, malformed rows, blend validation.** `test_recipe.py` grew from 1 case to 12 covering: blend-or-messages exclusivity, target-turn requirement, blend emptiness, weight presence/positivity, nested-blend rejection, `from_dict` with nested blends, `from_yaml` / `load_recipe` agreement, top-level non-mapping rejection. Added a malformed-row test for `_normalize_rows` that asserts non-dict entries raise `TypeError`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * review: emitted_at uses 0.1s tolerance; MessageTurn requires stream at construction * **Float tolerance in `emitted_at` for persistent styles.** The ``_timestamp(row) == t`` exact-equality check silently missed any caller that derived ``t`` arithmetically (e.g. ``frame_idx / fps``) even though the parquet timestamp would only differ by ULPs. Added ``EMITTED_AT_TOLERANCE_S = 0.1`` and check ``abs(...) <= tolerance`` instead, with a docstring explaining why exact equality wasn't enough and why 0.1 s is safe at typical 30–100 Hz control rates. Test asserts the new behavior at half-window (matches) and double-window (no match) using the constant so it stays in sync. * **`MessageTurn.stream` is required at construction.** It was typed ``MessageStream | None = None`` so YAML could omit ``stream:`` and pass the dataclass invariant — but ``_validate_rendered`` rejected ``None`` streams later, surfacing the error at the first sample instead of at recipe load. Now ``__post_init__`` raises ``ValueError`` if ``stream`` is ``None``, with the list of valid streams in the message. The redundant late-stage check in ``_validate_rendered`` is replaced with a one-line comment that cites the upstream invariant. Test pins the new construction-time rejection. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs(tools): drop follow-up-PR references Reword the two callouts in `tools.mdx` to describe the runtime layer in present tense ("not part of the catalog layer shipped today", "those modules don't yet exist in the tree") instead of pointing at a specific follow-up PR. Keeps the doc honest about what works now without coupling it to a particular release order. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * review: address CarolinePascal feedback - language timestamps: float64 -> float32 to match LeRobotDataset frame timestamps (Arrow struct + HF feature) - dataset_metadata: hoist `.language` imports to module top — language.py has no lerobot imports, so there is no circular-import risk - dataset_metadata: add a `meta.tools` setter that persists the catalog to info.json and reloads `meta.info` - feature_utils: validate the `language` dtype instead of returning "" — warn (non-fatal) when a non-empty value is written at record time - centralize the scalar-unwrap helper as `lerobot.utils.utils.unwrap_scalar`, shared by render_messages_processor and language_render - docs: move `## Layer 2 — recipe anatomy` ahead of the resolver sections, which describe recipe bindings rather than dataset layout - language_render: note in EMITTED_AT_TOLERANCE_S that persistent rows change on a human-action timescale, not the camera frame rate Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
512 lines
19 KiB
TOML
512 lines
19 KiB
TOML
# Copyright 2024 The HuggingFace Inc. team. All rights reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
[build-system]
|
|
requires = ["setuptools"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project.urls]
|
|
homepage = "https://huggingface.co/lerobot"
|
|
documentation = "https://huggingface.co/docs/lerobot/index"
|
|
source = "https://github.com/huggingface/lerobot"
|
|
issues = "https://github.com/huggingface/lerobot/issues"
|
|
discord = "https://discord.gg/s3KuuzsPFb"
|
|
|
|
[project]
|
|
name = "lerobot"
|
|
version = "0.5.2"
|
|
description = "🤗 LeRobot: State-of-the-art Machine Learning for Real-World Robotics in Pytorch"
|
|
dynamic = ["readme"]
|
|
license = { text = "Apache-2.0" }
|
|
requires-python = ">=3.12"
|
|
authors = [
|
|
{ name = "Rémi Cadène", email = "re.cadene@gmail.com" },
|
|
{ name = "Simon Alibert", email = "alibert.sim@gmail.com" },
|
|
{ name = "Alexander Soare", email = "alexander.soare159@gmail.com" },
|
|
{ name = "Quentin Gallouédec", email = "quentin.gallouedec@ec-lyon.fr" },
|
|
{ name = "Steven Palma", email = "imstevenpmwork@ieee.org" },
|
|
{ name = "Pepijn Kooijmans", email = "pepijnkooijmans@outlook.com"},
|
|
{ name = "Michel Aractingi", email = "michel.aractingi@gmail.com"},
|
|
{ name = "Adil Zouitine", email = "adilzouitinegm@gmail.com" },
|
|
{ name = "Dana Aubakirova", email = "danaaubakirova17@gmail.com"},
|
|
{ name = "Caroline Pascal", email = "caroline8.pascal@gmail.com"},
|
|
{ name = "Martino Russi", email = "nopyeps@gmail.com"},
|
|
{ name = "Thomas Wolf", email = "thomaswolfcontact@gmail.com" },
|
|
]
|
|
classifiers = [
|
|
"Development Status :: 3 - Alpha",
|
|
"Intended Audience :: Developers",
|
|
"Intended Audience :: Education",
|
|
"Intended Audience :: Science/Research",
|
|
"License :: OSI Approved :: Apache Software License",
|
|
"Programming Language :: Python :: 3.12",
|
|
"Programming Language :: Python :: 3.13",
|
|
"Topic :: Software Development :: Build Tools",
|
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
]
|
|
keywords = ["lerobot", "huggingface", "robotics", "machine learning", "artificial intelligence"]
|
|
|
|
dependencies = [
|
|
# Core ML
|
|
"torch>=2.7,<2.12.0",
|
|
"torchvision>=0.22.0,<0.27.0",
|
|
"numpy>=2.0.0,<2.3.0", # NOTE: Explicitly listing numpy helps the resolver converge faster. Upper bound imposed by opencv-python-headless.
|
|
"opencv-python-headless>=4.9.0,<4.14.0",
|
|
"Pillow>=10.0.0,<13.0.0",
|
|
"einops>=0.8.0,<0.9.0",
|
|
|
|
# Config & Hub
|
|
"draccus==0.10.0", # TODO: Relax version constraint
|
|
"huggingface-hub>=1.0.0,<2.0.0",
|
|
"requests>=2.32.0,<3.0.0",
|
|
|
|
# Environments
|
|
# NOTE: gymnasium is used in lerobot.envs (lerobot-train, lerobot-eval), policies/factory,
|
|
# and robots/unitree. Moving it to an optional extra would require import guards across many
|
|
# tightly-coupled modules. Candidate for a future refactor to decouple envs from the core.
|
|
"gymnasium>=1.1.1,<2.0.0",
|
|
|
|
# Serialization & checkpointing
|
|
"safetensors>=0.4.3,<1.0.0",
|
|
|
|
# Lightweight utilities
|
|
"packaging>=24.2,<26.0",
|
|
"termcolor>=2.4.0,<4.0.0",
|
|
"tqdm>=4.66.0,<5.0.0",
|
|
|
|
# Build tools (required by opencv-python-headless on some platforms)
|
|
"cmake>=3.29.0.1,<4.2.0",
|
|
"setuptools>=71.0.0,<81.0.0",
|
|
]
|
|
|
|
# Optional dependencies
|
|
[project.optional-dependencies]
|
|
|
|
# ── Feature-scoped extras ──────────────────────────────────
|
|
dataset = [
|
|
"datasets>=4.7.0,<5.0.0",
|
|
"pandas>=2.0.0,<3.0.0", # NOTE: Transitive dependency of datasets
|
|
"pyarrow>=21.0.0,<30.0.0", # NOTE: Transitive dependency of datasets
|
|
"lerobot[av-dep]",
|
|
|
|
# NOTE: torchcodec wheel availability matrix (PyPI):
|
|
# - linux x86_64/amd64 + macOS arm64 : wheels since 0.3.0 (the historic supported set).
|
|
# - win32 x86_64 : wheels since 0.7.0 (needs torch>=2.8).
|
|
# - linux aarch64/arm64 : wheels since 0.11.0 (needs torch>=2.11).
|
|
# - macOS x86_64 (Intel) and linux armv7l: no wheels in any released version -> fall through to the PyAV decoder.
|
|
# Each platform gets its own line so the resolver picks the minimum version that has a wheel for it.
|
|
|
|
# Other torch/torchcodec pairings (informational): 0.8.1 = ffmpeg>=8 support, 0.10 = system-wide ffmpeg support, 0.12 needs torch==2.12.
|
|
"torchcodec>=0.3.0,<0.12.0; (sys_platform == 'linux' and (platform_machine == 'x86_64' or platform_machine == 'AMD64')) or (sys_platform == 'darwin' and platform_machine == 'arm64')",
|
|
"torchcodec>=0.7.0,<0.12.0; sys_platform == 'win32'",
|
|
"torchcodec>=0.11.0,<0.12.0; sys_platform == 'linux' and (platform_machine == 'aarch64' or platform_machine == 'arm64')",
|
|
"jsonlines>=4.0.0,<5.0.0",
|
|
]
|
|
training = [
|
|
"lerobot[dataset]",
|
|
"accelerate>=1.10.0,<2.0.0",
|
|
"wandb>=0.24.0,<0.25.0",
|
|
]
|
|
hardware = [
|
|
"lerobot[pynput-dep]",
|
|
"lerobot[pyserial-dep]",
|
|
"lerobot[deepdiff-dep]",
|
|
]
|
|
viz = [
|
|
"rerun-sdk>=0.24.0,<0.27.0",
|
|
]
|
|
# ── User-facing composite extras (map to CLI scripts) ─────
|
|
# lerobot-record, lerobot-replay, lerobot-calibrate, lerobot-teleoperate, etc.
|
|
core_scripts = ["lerobot[dataset]", "lerobot[hardware]", "lerobot[viz]"]
|
|
# lerobot-eval -- base evaluation framework. You also need the policy's extra (e.g., lerobot[pi])
|
|
# and the environment's extra (e.g., lerobot[pusht]) if evaluating in simulation.
|
|
evaluation = ["lerobot[av-dep]"]
|
|
# lerobot-dataset-viz, lerobot-imgtransform-viz
|
|
dataset_viz = ["lerobot[dataset]", "lerobot[viz]"]
|
|
|
|
# Common
|
|
av-dep = ["av>=15.0.0,<16.0.0"]
|
|
pygame-dep = ["pygame>=2.5.1,<2.7.0"]
|
|
placo-dep = ["placo>=0.9.6,<0.9.17"]
|
|
transformers-dep = ["transformers>=5.4.0,<5.6.0"]
|
|
grpcio-dep = ["grpcio==1.73.1", "protobuf>=6.31.1,<6.32.0"]
|
|
can-dep = ["python-can>=4.2.0,<5.0.0"]
|
|
peft-dep = ["peft>=0.18.0,<1.0.0"]
|
|
scipy-dep = ["scipy>=1.14.0,<2.0.0"]
|
|
diffusers-dep = ["diffusers>=0.27.2,<0.36.0"]
|
|
qwen-vl-utils-dep = ["qwen-vl-utils>=0.0.11,<0.1.0"]
|
|
matplotlib-dep = ["matplotlib>=3.10.3,<4.0.0", "contourpy>=1.3.0,<2.0.0"] # NOTE: Explicitly listing contourpy helps the resolver converge faster.
|
|
pyserial-dep = ["pyserial>=3.5,<4.0"]
|
|
deepdiff-dep = ["deepdiff>=7.0.1,<9.0.0"]
|
|
pynput-dep = ["pynput>=1.7.8,<1.9.0"]
|
|
pyzmq-dep = ["pyzmq>=26.2.1,<28.0.0"]
|
|
motorbridge-dep = ["motorbridge>=0.3.2,<0.4.0"]
|
|
motorbridge-smart-servo-dep = ["motorbridge-smart-servo>=0.0.4,<0.1.0"]
|
|
|
|
# Motors
|
|
feetech = ["feetech-servo-sdk>=1.0.0,<2.0.0", "lerobot[pyserial-dep]", "lerobot[deepdiff-dep]"]
|
|
dynamixel = ["dynamixel-sdk>=3.7.31,<3.9.0", "lerobot[pyserial-dep]", "lerobot[deepdiff-dep]"]
|
|
damiao = ["lerobot[can-dep]"]
|
|
robstride = ["lerobot[can-dep]"]
|
|
|
|
# Robots
|
|
openarms = ["lerobot[damiao]"]
|
|
gamepad = ["lerobot[pygame-dep]", "hidapi>=0.14.0,<0.15.0"]
|
|
hopejr = ["lerobot[feetech]", "lerobot[pygame-dep]"]
|
|
lekiwi = ["lerobot[feetech]", "lerobot[pyzmq-dep]"]
|
|
unitree_g1 = [
|
|
# "unitree-sdk2==1.0.1",
|
|
"lerobot[pyzmq-dep]",
|
|
"lerobot[pyserial-dep]",
|
|
"onnxruntime>=1.16.0,<2.0.0",
|
|
"onnx>=1.16.0,<2.0.0",
|
|
"meshcat>=0.3.0,<0.4.0",
|
|
"lerobot[matplotlib-dep]",
|
|
"lerobot[pygame-dep]",
|
|
]
|
|
reachy2 = ["reachy2_sdk>=1.0.15,<1.1.0"]
|
|
# Seeed Studio reBot B601-DM follower (motorbridge / CAN) + StarArm102 / reBot Arm 102
|
|
# leader (motorbridge-smart-servo / FashionStar UART servos).
|
|
rebot = ["lerobot[motorbridge-dep]", "lerobot[motorbridge-smart-servo-dep]"]
|
|
kinematics = ["lerobot[placo-dep]"]
|
|
intelrealsense = [
|
|
"pyrealsense2>=2.55.1.6486,<2.57.0 ; sys_platform != 'darwin'",
|
|
"pyrealsense2-macosx>=2.54,<2.57.0 ; sys_platform == 'darwin'",
|
|
]
|
|
phone = ["hebi-py>=2.8.0,<2.12.0", "teleop>=0.1.0,<0.2.0", "fastapi<1.0", "lerobot[scipy-dep]"]
|
|
|
|
# Policies
|
|
diffusion = ["lerobot[diffusers-dep]"]
|
|
wallx = [
|
|
"lerobot[transformers-dep]",
|
|
"lerobot[peft-dep]",
|
|
"lerobot[scipy-dep]",
|
|
"torchdiffeq>=0.2.4,<0.3.0",
|
|
"lerobot[qwen-vl-utils-dep]",
|
|
]
|
|
pi = ["lerobot[transformers-dep]", "lerobot[scipy-dep]"]
|
|
smolvla = ["lerobot[transformers-dep]", "num2words>=0.5.14,<0.6.0", "accelerate>=1.7.0,<2.0.0"]
|
|
multi_task_dit = ["lerobot[transformers-dep]", "lerobot[diffusers-dep]"]
|
|
groot = [
|
|
"lerobot[transformers-dep]",
|
|
"lerobot[peft-dep]",
|
|
"lerobot[diffusers-dep]",
|
|
"dm-tree>=0.1.8,<1.0.0",
|
|
"timm>=1.0.0,<1.1.0",
|
|
"decord>=0.6.0,<1.0.0; (platform_machine == 'AMD64' or platform_machine == 'x86_64')",
|
|
"ninja>=1.11.1,<2.0.0",
|
|
"flash-attn>=2.5.9,<3.0.0 ; sys_platform != 'darwin'"
|
|
]
|
|
sarm = ["lerobot[transformers-dep]", "pydantic>=2.0.0,<3.0.0", "faker>=33.0.0,<35.0.0", "lerobot[matplotlib-dep]", "lerobot[qwen-vl-utils-dep]"]
|
|
xvla = ["lerobot[transformers-dep]"]
|
|
eo1 = ["lerobot[transformers-dep]", "lerobot[qwen-vl-utils-dep]"]
|
|
hilserl = ["lerobot[transformers-dep]", "lerobot[dataset]", "gym-hil>=0.1.13,<0.2.0", "lerobot[grpcio-dep]", "lerobot[placo-dep]"]
|
|
|
|
# Features
|
|
async = ["lerobot[grpcio-dep]", "lerobot[matplotlib-dep]"]
|
|
peft = ["lerobot[transformers-dep]", "lerobot[peft-dep]"]
|
|
|
|
# Development
|
|
dev = ["pre-commit>=3.7.0,<5.0.0", "debugpy>=1.8.1,<1.9.0", "lerobot[grpcio-dep]", "grpcio-tools==1.73.1", "mypy>=1.19.1", "ruff>=0.14.1", "lerobot[notebook]"]
|
|
notebook = ["jupyter>=1.0.0,<2.0.0", "ipykernel>=6.0.0,<7.0.0"]
|
|
test = ["pytest>=8.1.0,<9.0.0", "pytest-timeout>=2.4.0,<3.0.0", "pytest-cov>=5.0.0,<8.0.0", "mock-serial>=0.0.1,<0.1.0 ; sys_platform != 'win32'"]
|
|
video_benchmark = ["scikit-image>=0.23.2,<0.26.0", "pandas>=2.2.2,<2.4.0"]
|
|
|
|
# Simulation
|
|
# NOTE: Explicitly listing scipy helps flatten the dependecy tree.
|
|
aloha = ["lerobot[dataset]", "gym-aloha>=0.1.2,<0.2.0", "lerobot[scipy-dep]"]
|
|
pusht = ["lerobot[dataset]", "gym-pusht>=0.1.5,<0.2.0", "pymunk>=6.6.0,<7.0.0"] # TODO: Fix pymunk version in gym-pusht instead
|
|
libero = ["lerobot[dataset]", "lerobot[transformers-dep]", "hf-libero>=0.1.3,<0.2.0; sys_platform == 'linux'", "lerobot[scipy-dep]"]
|
|
metaworld = ["lerobot[dataset]", "metaworld==3.0.0", "lerobot[scipy-dep]"]
|
|
# NOTE: vlabench is NOT exposed as a `lerobot` extra. Its only distribution
|
|
# is the OpenMOSS/VLABench GitHub repo (package name `VLABench`, no PyPI
|
|
# release), so any `vlabench>=X` pip spec is unresolvable. Install it
|
|
# manually alongside MuJoCo / dm-control — see docs/source/vlabench.mdx
|
|
# for the recipe.
|
|
# NOTE: robomme is NOT a pyproject extra — mani-skill hard-pins numpy<2
|
|
# which conflicts with lerobot's numpy>=2 base pin, so the two trees can't
|
|
# resolve into a single env. Install it only in the RoboMME Docker image
|
|
# via `uv pip install --override` (see docker/Dockerfile.benchmark.robomme).
|
|
# NOTE: robocasa is NOT exposed as a `lerobot` extra. Its setup.py pins
|
|
# `lerobot==0.3.3` in install_requires, which cyclically shadows our own
|
|
# workspace `lerobot` and makes the graph unsolvable under any resolver
|
|
# (uv, pip). Install it manually alongside robosuite — see
|
|
# docs/source/robocasa.mdx for the recipe.
|
|
|
|
# All
|
|
all = [
|
|
# Feature-scoped extras
|
|
"lerobot[dataset]",
|
|
"lerobot[training]",
|
|
"lerobot[hardware]",
|
|
"lerobot[viz]",
|
|
# NOTE(resolver hint): scipy is pulled in transitively via lerobot[scipy-dep] through
|
|
# multiple extras (aloha, metaworld, pi, wallx, phone). Listing it explicitly
|
|
# helps pip's resolver converge by constraining scipy early, before it encounters
|
|
# the loose scipy requirements from transitive deps like dm-control and metaworld.
|
|
"scipy>=1.14.0,<2.0.0",
|
|
"lerobot[dynamixel]",
|
|
"lerobot[feetech]",
|
|
"lerobot[damiao]",
|
|
"lerobot[robstride]",
|
|
"lerobot[gamepad]",
|
|
"lerobot[hopejr]",
|
|
"lerobot[lekiwi]",
|
|
"lerobot[openarms]",
|
|
"lerobot[reachy2]",
|
|
"lerobot[rebot]",
|
|
"lerobot[kinematics]",
|
|
"lerobot[intelrealsense]",
|
|
"lerobot[diffusion]",
|
|
"lerobot[multi_task_dit]",
|
|
"lerobot[wallx]",
|
|
"lerobot[pi]",
|
|
"lerobot[smolvla]",
|
|
# "lerobot[groot]", TODO(Steven): Gr00t requires specific installation instructions for flash-attn
|
|
"lerobot[xvla]",
|
|
"lerobot[hilserl]",
|
|
"lerobot[async]",
|
|
"lerobot[dev]",
|
|
"lerobot[test]",
|
|
"lerobot[video_benchmark]",
|
|
"lerobot[aloha]",
|
|
"lerobot[pusht]",
|
|
"lerobot[phone]",
|
|
"lerobot[libero]; sys_platform == 'linux'",
|
|
"lerobot[metaworld]",
|
|
"lerobot[sarm]",
|
|
"lerobot[peft]",
|
|
# "lerobot[unitree_g1]", TODO: Unitree requires specific installation instructions for unitree_sdk2
|
|
]
|
|
|
|
[project.scripts]
|
|
lerobot-calibrate="lerobot.scripts.lerobot_calibrate:main"
|
|
lerobot-find-cameras="lerobot.scripts.lerobot_find_cameras:main"
|
|
lerobot-find-port="lerobot.scripts.lerobot_find_port:main"
|
|
lerobot-record="lerobot.scripts.lerobot_record:main"
|
|
lerobot-replay="lerobot.scripts.lerobot_replay:main"
|
|
lerobot-setup-motors="lerobot.scripts.lerobot_setup_motors:main"
|
|
lerobot-teleoperate="lerobot.scripts.lerobot_teleoperate:main"
|
|
lerobot-eval="lerobot.scripts.lerobot_eval:main"
|
|
lerobot-train="lerobot.scripts.lerobot_train:main"
|
|
lerobot-train-tokenizer="lerobot.scripts.lerobot_train_tokenizer:main"
|
|
lerobot-dataset-viz="lerobot.scripts.lerobot_dataset_viz:main"
|
|
lerobot-info="lerobot.scripts.lerobot_info:main"
|
|
lerobot-find-joint-limits="lerobot.scripts.lerobot_find_joint_limits:main"
|
|
lerobot-imgtransform-viz="lerobot.scripts.lerobot_imgtransform_viz:main"
|
|
lerobot-edit-dataset="lerobot.scripts.lerobot_edit_dataset:main"
|
|
lerobot-setup-can="lerobot.scripts.lerobot_setup_can:main"
|
|
lerobot-rollout="lerobot.scripts.lerobot_rollout:main"
|
|
|
|
# ---------------- Tool Configurations ----------------
|
|
|
|
# cu128 wheels keep broad hardware reach; the driver floor is 570.86.
|
|
# To use a different CUDA variant, reinstall torch with an explicit index, e.g.:
|
|
# uv pip install --force-reinstall torch torchvision \
|
|
# --index-url https://download.pytorch.org/whl/cu130
|
|
[[tool.uv.index]]
|
|
name = "pytorch-cu128"
|
|
url = "https://download.pytorch.org/whl/cu128"
|
|
explicit = true
|
|
|
|
[tool.uv.sources]
|
|
torch = [{ index = "pytorch-cu128", marker = "sys_platform == 'linux'" }]
|
|
torchvision = [{ index = "pytorch-cu128", marker = "sys_platform == 'linux'" }]
|
|
|
|
[tool.setuptools.package-data]
|
|
lerobot = ["envs/*.json"]
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
|
|
[tool.ruff]
|
|
target-version = "py312"
|
|
line-length = 110
|
|
exclude = ["tests/artifacts/**/*.safetensors", "*_pb2.py", "*_pb2_grpc.py"]
|
|
|
|
[tool.ruff.lint]
|
|
# E, W: pycodestyle errors and warnings
|
|
# F: PyFlakes
|
|
# I: isort
|
|
# UP: pyupgrade
|
|
# B: flake8-bugbear (good practices, potential bugs)
|
|
# C4: flake8-comprehensions (more concise comprehensions)
|
|
# A: flake8-builtins (shadowing builtins)
|
|
# SIM: flake8-simplify
|
|
# RUF: Ruff-specific rules
|
|
# D: pydocstyle (for docstring style/formatting)
|
|
# S: flake8-bandit (some security checks, complements Bandit)
|
|
# T20: flake8-print (discourage print statements in production code)
|
|
# N: pep8-naming
|
|
# TODO: Uncomment rules when ready to use
|
|
select = [
|
|
"E", "W", "F", "I", "B", "C4", "T20", "N", "UP", "SIM" #, "A", "S", "D", "RUF"
|
|
]
|
|
ignore = [
|
|
"E501", # Line too long
|
|
"T201", # Print statement found
|
|
"T203", # Pprint statement found
|
|
"B008", # Perform function call in argument defaults
|
|
]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"__init__.py" = ["F401", "F403", "E402"]
|
|
# E402: conditional-import guards (TYPE_CHECKING / is_package_available) must precede the imports they protect
|
|
"src/lerobot/scripts/convert_dataset_v21_to_v30.py" = ["E402"]
|
|
"src/lerobot/policies/wall_x/**" = ["N801", "N812", "SIM102", "SIM108", "SIM210", "SIM211", "B006", "B007", "SIM118"] # Supprese these as they are coming from original Qwen2_5_vl code TODO(pepijn): refactor original
|
|
|
|
[tool.ruff.lint.isort]
|
|
combine-as-imports = true
|
|
known-first-party = ["lerobot"]
|
|
|
|
[tool.ruff.lint.pydocstyle]
|
|
convention = "google"
|
|
|
|
[tool.ruff.format]
|
|
quote-style = "double"
|
|
indent-style = "space"
|
|
skip-magic-trailing-comma = false
|
|
line-ending = "auto"
|
|
docstring-code-format = true
|
|
|
|
[tool.bandit]
|
|
exclude_dirs = [
|
|
"tests",
|
|
"benchmarks",
|
|
"src/lerobot/datasets/push_dataset_to_hub",
|
|
]
|
|
skips = ["B101", "B311", "B404", "B603", "B615"]
|
|
|
|
[tool.typos]
|
|
default.extend-ignore-re = [
|
|
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$", # spellchecker:disable-line
|
|
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on", # spellchecker:<on|off>
|
|
]
|
|
default.extend-ignore-identifiers-re = [
|
|
# Add individual words here to ignore them
|
|
"2nd",
|
|
"pn",
|
|
"ser",
|
|
"ein",
|
|
"thw",
|
|
"inpt",
|
|
"ROBOTIS",
|
|
"OT_VALUE"
|
|
]
|
|
|
|
# TODO: Uncomment when ready to use
|
|
# [tool.interrogate]
|
|
# ignore-init-module = true
|
|
# ignore-init-method = true
|
|
# ignore-nested-functions = false
|
|
# ignore-magic = false
|
|
# ignore-semiprivate = false
|
|
# ignore-private = false
|
|
# ignore-property-decorators = false
|
|
# ignore-module = false
|
|
# ignore-setters = false
|
|
# fail-under = 80
|
|
# output-format = "term-missing"
|
|
# color = true
|
|
# paths = ["src/lerobot"]
|
|
|
|
# TODO: Enable mypy gradually module by module across multiple PRs
|
|
# Uncomment [tool.mypy] first, then uncomment individual module overrides as they get proper type annotations
|
|
|
|
[tool.mypy]
|
|
python_version = "3.12"
|
|
ignore_missing_imports = true
|
|
follow_imports = "skip"
|
|
# warn_return_any = true
|
|
# warn_unused_configs = true
|
|
# strict = true
|
|
# disallow_untyped_defs = true
|
|
# disallow_incomplete_defs = true
|
|
# check_untyped_defs = true
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "lerobot.*"
|
|
ignore_errors = true
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "lerobot.envs.*"
|
|
ignore_errors = false
|
|
|
|
|
|
# [[tool.mypy.overrides]]
|
|
# module = "lerobot.utils.*"
|
|
# ignore_errors = false
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "lerobot.configs.*"
|
|
ignore_errors = false
|
|
|
|
# extra strictness for configs
|
|
disallow_untyped_defs = true
|
|
disallow_incomplete_defs = true
|
|
check_untyped_defs = true
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "lerobot.optim.*"
|
|
ignore_errors = false
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "lerobot.model.*"
|
|
ignore_errors = false
|
|
|
|
# [[tool.mypy.overrides]]
|
|
# module = "lerobot.processor.*"
|
|
# ignore_errors = false
|
|
|
|
# [[tool.mypy.overrides]]
|
|
# module = "lerobot.datasets.*"
|
|
# ignore_errors = false
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "lerobot.cameras.*"
|
|
ignore_errors = false
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "lerobot.motors.*"
|
|
ignore_errors = false
|
|
|
|
# [[tool.mypy.overrides]]
|
|
# module = "lerobot.robots.*"
|
|
# ignore_errors = false
|
|
|
|
# [[tool.mypy.overrides]]
|
|
# module = "lerobot.teleoperators.*"
|
|
# ignore_errors = false
|
|
|
|
# [[tool.mypy.overrides]]
|
|
# module = "lerobot.policies.*"
|
|
# ignore_errors = false
|
|
|
|
# [[tool.mypy.overrides]]
|
|
# module = "lerobot.rl.*"
|
|
# ignore_errors = false
|
|
|
|
|
|
# [[tool.mypy.overrides]]
|
|
# module = "lerobot.async_inference.*"
|
|
# ignore_errors = false
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = "lerobot.transport.*"
|
|
ignore_errors = false
|
|
|
|
# [[tool.mypy.overrides]]
|
|
# module = "lerobot.scripts.*"
|
|
# ignore_errors = false
|