Commit Graph

1510 Commits

Author SHA1 Message Date
CarolinePascal 6b2d5cec4c test(depth encoding): updating and cleaning video/depth encoding tests 2026-06-12 19:17:59 +02:00
CarolinePascal 291d2e982c test(depth): cleaning up depth tests 2026-06-12 19:00:17 +02:00
CarolinePascal 979f7b1187 feat(output unit): adding support for output unit specification at dataset reading/training time
Co-authored-by: Wensi (Vince) Ai <59036629+wensi-ai@users.noreply.github.com>
2026-06-12 18:34:46 +02:00
CarolinePascal 1a5fbb216f fix(depth units): fixing depth units output for the realsense cameras 2026-06-12 18:28:31 +02:00
CarolinePascal 65d4da7c1b fix(is_depth): adding missing doctrings and is_depth arguments in video decoding functions
Co-authored-by: Wensi (Vince) Ai <59036629+wensi-ai@users.noreply.github.com>
2026-06-12 18:04:45 +02:00
CarolinePascal 6610819c4a fix(typo): fixing typo 2026-05-26 18:06:52 +02:00
CarolinePascal 6ab5e667c0 fix(from_video_info): fixing early validation issue in from_video_info 2026-05-26 18:06:22 +02:00
CarolinePascal 55ff277af9 test(cleaning): cleaning up tests 2026-05-26 18:05:31 +02:00
CarolinePascal 71546887c5 test(aggregate): extending aggregation tests to depth frames 2026-05-26 17:03:30 +02:00
CarolinePascal 1cc9fe0139 feat(tools): adding depth support in LeRobotDataset edition tools 2026-05-26 17:00:12 +02:00
CarolinePascal f1859d8c65 feat(batched dequantization): optimizing dequantize_depth for torch based batched dequantization 2026-05-26 16:58:44 +02:00
CarolinePascal 3d67784f8c fix(TIFF): add missing quantization and cleanup for TIFF files 2026-05-26 15:27:09 +02:00
CarolinePascal 621f4191be fix(typo): fixing typo 2026-05-26 15:27:04 +02:00
CarolinePascal de44bc9711 fix(normalization): restricting 255 normalization to non depth/uint8 images only 2026-05-26 14:17:03 +02:00
CarolinePascal bb47f5c463 fix(realsense): fixing typo in realsense serial number 2026-05-26 14:05:17 +02:00
CarolinePascal e06d83fbfd tests(typos): fixing typos in tests 2026-05-24 23:50:30 +02:00
CarolinePascal 6179b5fd7e fix(info): fixing info metadata update when is_depth_map was set 2026-05-24 23:37:08 +02:00
CarolinePascal 72ce8b099c fix(pre-commit): fixing mutable defautl value 2026-05-24 23:37:08 +02:00
CarolinePascal 2efa8e5540 feat(refactor): refactor DepthEncoderConfig quantization pipeline, so that the methods do not live in the config class. Add pixel format - channels validation.Move the default pixel format for depth in the config file. 2026-05-24 23:37:08 +02:00
CarolinePascal aff1252b90 feat(pix_fmt channels): use PyAv to check get pixel formats number of channels 2026-05-24 23:37:08 +02:00
CarolinePascal bf78fb11d3 tests(depth): adding new tests for depth integration validation 2026-05-24 23:37:08 +02:00
CarolinePascal d8eea83a89 test(fix): fixing exisiting tests to still work with latest features 2026-05-24 23:37:08 +02:00
CarolinePascal b183571586 chore(typos): fixing typos 2026-05-24 23:37:08 +02:00
CarolinePascal 6bf4ffaabc fix(plumbing): fixing missing parts in the depth maps pipeline 2026-05-24 23:37:07 +02:00
CarolinePascal 45683aeccc fix(stop_event): fixing stop_event race condition in camera classes 2026-05-24 23:37:07 +02:00
CarolinePascal 5b91fe5d1a feat(is_depth): simplifying is_depth nested name + legacy support 2026-05-24 23:37:07 +02:00
CarolinePascal ca9fad1f12 feat(depth shape): ensuring depth maps shape is always including the channel 2026-05-24 23:37:07 +02:00
CarolinePascal efdec0ed3a chore(format): format code 2026-05-24 23:37:07 +02:00
CarolinePascal 1ba832e6e2 feat(depth maps writer): adding support for raw depth maps recording with image writer 2026-05-24 23:37:07 +02:00
CarolinePascal 44280c4c56 feat(viz): render depth observations as rr.DepthImage in Viridis 2026-05-24 23:37:07 +02:00
CarolinePascal 8825bb77e4 feat(record): plumb DepthEncoderConfig through lerobot-record 2026-05-24 23:37:07 +02:00
CarolinePascal ab6911b781 feat(robots/so_follower): emit + populate depth keys when use_depth 2026-05-24 23:37:07 +02:00
CarolinePascal 929113c0d7 feat(features): route 2D camera shapes to observation.depth.<key> 2026-05-24 23:37:06 +02:00
CarolinePascal b4e7d4c63a feat(cameras/realsense): expose async depth in metric meters 2026-05-24 23:37:06 +02:00
CarolinePascal 3f1b6f1ce1 feat(depth): wire DatasetReader to decode_depth_frames 2026-05-24 23:37:06 +02:00
CarolinePascal 226efd51f2 feat(depth): wire StreamingVideoEncoder + writer to depth encoder 2026-05-24 23:37:06 +02:00
CarolinePascal c49c7536f2 feat(depth): plumb DepthEncoderConfig through LeRobotDataset and DatasetWriter 2026-05-24 23:37:06 +02:00
CarolinePascal 93d1fac4d1 feat(depth): extend quantization tools to better fit the encoding/decoding pipeline 2026-05-24 23:37:06 +02:00
CarolinePascal 01081d2156 feat(depth): persist depth metadata 2026-05-24 23:37:06 +02:00
CarolinePascal 119169e417 feat(video): add ffv1 to supported codecs 2026-05-24 23:37:06 +02:00
CarolinePascal 7402980d7d feat(depth): add depth quantization helpers and tests 2026-05-24 23:37:05 +02:00
Pepijn 8194897994 fix(deps): cap placo below 0.9.16 and harden kinematics import (#3647)
* fix(deps): cap placo below 0.9.16 and harden kinematics import

placo 0.9.16 links against liburdfdom_sensor.so.4, which is unavailable
on Ubuntu 24.04 (noble ships urdfdom 3.x). Importing placo on that base
crashes with:

  ImportError: liburdfdom_sensor.so.4.0: cannot open shared object file

This broke nightly Latest Deps tests (CPU and GPU) when the lockfile
upgrade picked placo 0.9.16, since lerobot.model.kinematics
unconditionally imports placo when _placo_available is true, and that
check (importlib.util.find_spec) cannot detect dlopen failures of
transitive shared libraries — so unrelated subsystems (RL actor,
gym_manipulator) became unimportable.

Two changes:

1. Pin placo to <0.9.16 in pyproject.toml + regenerate uv.lock
   (0.9.16 → 0.9.15). Short-term unblock for nightly CI until system
   urdfdom 4.x is broadly available.

2. Harden the import guard in src/lerobot/model/kinematics.py:
   wrap 'import placo' in try/except ImportError so a missing
   transitive .so no longer crashes module import. RobotKinematics
   instantiation now raises an informative ImportError citing the
   underlying dlopen failure via _raise_if_placo_unusable().

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(kinematics): hoist _placo_runtime_error to module scope for mypy

Mypy walks the TYPE_CHECKING branch in which the runtime else-block is
not executed, so _placo_runtime_error was only defined at runtime and
mypy reported 'Name "_placo_runtime_error" is not defined' on the
three references inside _raise_if_placo_unusable. Declare the symbol
unconditionally at module scope with a default of None; the runtime
import-failure branch still assigns to it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* style(kinematics): drop verbose comments around placo import guard

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 12:03:07 +02:00
Haoming Song 9f437d86b6 fix(groot): align GR00TN15Config with transformers config dataclasses (#3606)
* fix(gr00t): fix gr00t config dataclass init TypeError

* fix(groot): guard strict config decorator without transformers for passing CI

---------

Co-authored-by: Pepijn <138571049+pkooij@users.noreply.github.com>
2026-05-22 10:31:04 +02:00
Haoming Song b74a551d38 fix(pi0, pi05): stabilize torch.compile and expand test coverage (#3610)
* chore(gr00t): sync with #3606 for fixing gr00t config crash

* fix(pi0&pi05): fix graph break caused by deepcopy of past_key_values in sample_actions

* fix(pi0&pi05): fix frequent recompile caused by compute_layer_complete

* feat(test): add compile test and benchamrk for pi0 and pi05

* feat(test): add comprehensive testing for pi0 and pi05. Including processor, forward, sample action, etc.
2026-05-22 10:29:34 +02:00
Nikodem Bartnik c0a2e9814d fix examples (#3623)
- Fixed broken API examples in Lerobot Imitation Learning Documentation
- Teleoperation with cameras improved by adding a fixed frequency in the loop (without it the cameras feed gets very slow)
- Wrapped record example script in main() to avoid problems on Mac
- Previously teleoperation example was using SO-ARM and teleoperation with cameras was using Koch. I changed it to use SO-ARM in all of the examples.
- Added section on how to train with HF Jobs - CLI and Python examples
- Replaced lerobot-record with lerobot-rollout in policies examples
2026-05-21 22:14:07 +02:00
Khalil Meftah bac4f61eae refactor: support custom progress parquet overlays (#3640) 2026-05-21 14:32:10 +02:00
Virgileboat f4b834844e Feat/clean can bus (#3526)
* change timeout  for handshake

* enforce last state read when querry

* change import order

* fix(motors): flush stale robstride RX and harden feedback drain

* robstride: remove redundant timeout and max_messages casts

* bugfix + %-style

* update exception catch
2026-05-21 11:44:04 +02:00
Roham Z. Nobari dfdc48a7f1 fix(datasets): bound VideoDecoderCache to prevent OOM on large datasets (#3614)
VideoDecoderCache used an unbounded dict keyed on absolute path, with no
eviction in the standard LeRobotDataset path. With shuffled iteration over
datasets that have many distinct mp4 files, every DataLoader worker
accumulated one cached (VideoDecoder, fsspec file handle) pair per distinct
path it had ever touched. Per-entry cost is ~3-5 MB of host RAM plus one
open FD; at ~8 k entries this is roughly 30 GB per worker.

This was hit in the wild during a SmolVLA training run on a 4,195-episode
SO-101 dataset (8,390 mp4s, two cameras per episode). dmesg showed
anon-rss climbing to 34.9 GB on a single pt_data_worker before the OOM
killer fired ~30 min into training; with --num_workers=8 the per-worker
peak halved to 17.9 GB, which is the expected inverse-scaling signature
when the leak is per-decode and the workload is split across workers. The
working workaround on the affected platform was --dataset.video_backend=pyav,
because the pyav path opens/closes per call and never touches this cache.

Switch the backing store to an OrderedDict and evict LRU entries when the
cap is reached, closing the evicted file handle inside the lock so we do
not leak FDs either. Default cap is DEFAULT_DECODER_CACHE_SIZE = 100,
overridable via LEROBOT_VIDEO_DECODER_CACHE_SIZE or by passing max_size=
to the constructor; max_size=None restores the legacy unbounded behaviour
for callers that need it.

Validation on the original failing workload (decode_video_frames_torchcodec
called over real mp4s from the affected SO-101 dataset):

  unbounded:    300 files  ->  +1087 MB host RSS,  cache=300, still climbing
  cap=50:       500 files  ->   +266 MB host RSS,  cache=50,  stable
  cap=50:      2000 calls  ->   +312 MB host RSS,  cache=50,  stable
  cap=100:     1000 calls  ->   +470 MB host RSS,  cache=100, stable

Three independent seeded runs at cap=50 agreed to within 1% (263 / 266 /
265 MB delta), and the 2000-call multi-pass run shows RSS plateaus after
the cap is reached instead of drifting.

Tests in tests/datasets/test_video_decoder_cache.py cover:
default-is-bounded, size cap, LRU ordering, FD close on eviction, FD close
on clear(), cache-hit invariance, max_size=None fallback, and env-var
override. No regressions in test_video_encoding.py, test_streaming.py, or
test_dataset_reader.py (73 prior tests still pass alongside the 8 new ones).
2026-05-19 16:54:25 +02:00
四七 6a8878a639 fix(datasets): normalize shape=(1,) numeric values before HF encoding (#3344)
* fix(datasets): normalize shape=(1,) numeric values before save

* test(datasets): cover shape=(1,) int/bool and finalize

Co-authored-by: Copilot <copilot@github.com>
2026-05-19 16:53:19 +02:00
Caroline Pascal d38eb89f71 feat(video re-encoding): Adding utility and dataset edition tool for video re-encoding (#3611)
* feat(utility): adding video re-encode utility

* feat(edit): adding a new lerobot-edit-dataset tool to re-encode all the videos of a dataset

* chore(format): formatting code

* chore(review): fix Claude reviews

* test(reencode dataset): adding missing test for reencode dataset
2026-05-19 14:46:14 +02:00