lecop 0.1.2

Fast health checks for LeRobot-format robot datasets (unofficial)
Documentation

Find the broken episodes in your LeRobot dataset in milliseconds, before they cost you a training run.

Quick start

Install it with the tool you already use:

uv tool install lecop

Or run it once without installing: uvx lecop path/to/dataset.

pip install lecop      # or: pipx install lecop
cargo binstall lecop   # prebuilt binary, nothing to compile

Or cargo install lecop to compile it yourself. That build needs no extra tools, but decodes AV1 (--decode) about 3 times slower; for the fast build install nasm (x86_64 only: apt install nasm, brew install nasm) and run cargo install lecop --features asm.

Then run it on a dataset:

lecop path/to/dataset

No config, no dataset download, and the wheel is a single Rust binary: no Python dependencies. Exit code 0 means clean, 1 means errors, so it also works as a CI step. The PyPI wheels, cargo binstall and the release binaries are built with the AV1 assembly; everything except --decode runs at the same speed in every build.

From Python

leCop is a command-line tool, not an importable module. Call it and read the JSON:

import json, subprocess

run = subprocess.run(["lecop", "validate", "--format", "json", "path/to/dataset"], capture_output=True, text=True)
report = json.loads(run.stdout)
print(report["errors"], report["warnings"])
for issue in report["issues"]:
    print(issue)

What it catches

  • A video with 591 frames for an episode of 588.
  • Timestamps that drift, or frames that went missing.
  • Totals in info.json that disagree with the data (and --fix repairs them).
  • A robot that sat idle for most of an episode, or whose action froze for seconds.
  • Statistics that do not match the data, constant or clipped signals, NaNs.
  • Missing, truncated or unreadable files.
  • With --decode: a camera that froze or went black.

58 checks in all, listed in docs/checks.md.

Why leCop

  • Fast. 8 to 28 ms per dataset without video decoding, 15x to 54x faster than lerobot-doctor on the same checks. Video is checked from the container, not by decoding frames, unless you ask for --decode.
  • Nothing to set up. One binary. LeRobot v2.x and v3.x.
  • Made for CI. Stable issue codes, --format json and GitHub annotations, a config file to ignore or re-grade findings.

Compared with lerobot-doctor and physlint, check by check, in docs/comparison.md.

More

Unofficial. Not affiliated with Hugging Face or the LeRobot project. Early stage: tested on synthetic fixtures and on 16 real Hub datasets (v2.1 and v3.0), one of them with real faults; no real v2.0 dataset yet.

Contributing

cargo test
cargo bench   # criterion; see .claude/rules/performance.md

scripts/fetch-datasets.sh          # list real test datasets that are missing
scripts/fetch-datasets.sh --yes    # download them into datasets/ (git-ignored)

cargo test also checks the error and warning counts on every downloaded dataset listed in scripts/datasets.tsv and skips the ones you do not have.

See CONTRIBUTING.md and STYLE_GUIDE.md.

License

Licensed under either of Apache License 2.0 or MIT license at your option.