Find the broken episodes in your LeRobot dataset in milliseconds, before they cost you a training run.
At the speed of Rust and assembly.
See what leCop reports on common LeRobot datasets, and how fast, on the results site.
Try it without installing anything: type a Hub dataset into the leCop Space. It checks
meta/ and data/ of public datasets up to 2 GB; the video checks need a local run.
Install it with the tool you already use:
uv
uv tool install lecopOr run it once without installing: uvx lecop path/to/dataset.
pip
pip install lecop # or: pipx install lecopcargo
cargo binstall lecop # prebuilt binary, nothing to compileOr cargo install lecop to compile it yourself. That build needs no extra tools and decodes AV1 (--decode) with
rav1d's assembly on ARM (Apple Silicon, Linux aarch64) and on x86_64 Linux, Windows and macOS. On other targets
--decode prints a note on stderr saying the build lacks the assembly.
Then run it on a dataset:
lecop path/to/datasetNo 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 works as a step in a data pipeline (see In a pipeline). Every install (PyPI wheels, cargo binstall, the
release binaries and cargo install) decodes AV1 with hand-written
assembly on ARM and on x86_64 Linux, Windows and macOS.
A GitHub Actions step that checks a dataset in the repository (or one an earlier step downloaded) and shows each finding as an annotation on the pull request:
- uses: michele-xilo/leCop@v0
with:
path: path/to/datasetOptions and a pre-commit hook are in In a pipeline.
The PyPI wheel also installs a small lecop module that runs the bundled binary and returns the report:
import lecop
report = lecop.validate("path/to/dataset")
print(report["errors"], report["warnings"])
for issue in report["issues"]:
print(issue["severity"], issue["code"], issue["episode"], issue["message"])validate accepts a dataset or a directory that holds many, and decode, jobs, ignore and select options that
match the CLI flags. Errors in the dataset are in the report; lecop.LecopError means there was no report (bad path or
option). decode=True uses the AV1 assembly in the wheels. The cargo install build has no Python module: call the
CLI with --format json.
leCop is also a library crate. Add lecop to your Cargo.toml and call it:
use lecop::dataset::Dataset;
use lecop::validate::validate;
let ds = Dataset::open("path/to/dataset")?;
for issue in validate(&ds)? {
println!("{:?} {} {}", issue.severity, issue.code, issue.message);
}The issue codes and the CLI output are a stable contract; the Rust API can change in any 0.x release, so pin the
version. Several datasets, --decode and the other options are in the crate documentation.
- A video with 591 frames for an episode of 588.
- Timestamps that drift, or frames that went missing.
- Totals in
info.jsonthat disagree with the data (and--fixrepairs 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.
- Fast. 5 to 32 ms per dataset without video decoding, 14x to 107x faster than lerobot-doctor on the same datasets.
On RoboTwin (27,500 episodes, 75 GB), leCop takes 0.7 s, lerobot-doctor
50 minutes and physlint 4 h 42 min.
Video is checked from the container, not by decoding frames, unless you ask for
--decode. - Fast when it decodes, too. With
--decodeevery frame is decoded, 7.9x to 178x faster than physlint (comparison). Videos are split at keyframes and decoded on every core, and AV1, the LeRobot default codec, goes through rav1d's hand-written assembly: 3 to 14 times faster than without it (ARM and x86_64 figures in usage), and included in every install on ARM and on x86_64 Linux, Windows and macOS, with no ffmpeg and no assembler to set up. - Nothing to set up. One binary. LeRobot v2.x and v3.x.
- Made for pipelines. Run it after recording or conversion, or as a gate before training. Stable issue codes,
--format jsonand GitHub annotations, a config file to ignore or re-grade findings.
Compared with lerobot-doctor and physlint, check by check, in docs/comparison.md.
- Usage: every flag, output formats,
--fix,--decode,lecop.toml. - Checks: every issue code and what is not supported yet.
- Using leCop from code: the Python module and the Rust crate.
- Hub scan: what leCop reports on 75 public Hub datasets, checked by hand.
- Comparison and speed tables.
- Open work is tracked in the issues, by priority.
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.
Contributions are welcome. CONTRIBUTING.md covers setup, tests, real test datasets and how to open a PR; code style is in STYLE_GUIDE.md.
Licensed under either of Apache License 2.0 or MIT license at your option.

