Skip to main content

leCop: a robot cop with sunglasses

leCop

CI codecov license: MIT OR Apache-2.0 Rust

Find the broken episodes in your LeRobot dataset in milliseconds, before they cost you a training run.
At the speed of Rust and assembly.

lecop validating a dataset: it lists a video with the wrong number of frames and an idle episode

Quick start

Install it with the tool you already use:

uv
uv tool install lecop

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

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

Or 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/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 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.

From Python

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.

From Rust

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.

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.
  • Fast when it decodes, too. With --decode every frame is decoded, 3.5x to 114x 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: about 3 times faster than without it, 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 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

Contributions are welcome. CONTRIBUTING.md covers setup, tests, real test datasets and how to open a PR; code style is in STYLE_GUIDE.md.

License

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

Metadata

Release files for lecop 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lecop 0.2.0
File Size Uploaded Provenance Actions
lecop-0.2.0.tar.gz 393.7 kB Without provenance Details for lecop-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for lecop 0.2.0
File Actions
lecop-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for lecop-0.2.0-py3-none-win_amd64.whl
lecop-0.2.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for lecop-0.2.0-py3-none-manylinux_2_28_x86_64.whl
lecop-0.2.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for lecop-0.2.0-py3-none-manylinux_2_28_aarch64.whl
lecop-0.2.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for lecop-0.2.0-py3-none-macosx_11_0_arm64.whl
lecop-0.2.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for lecop-0.2.0-py3-none-macosx_10_12_x86_64.whl

Total release size: 26.5 MB

Release files / lecop-0.2.0.tar.gz

Download URL lecop-0.2.0.tar.gz
Size 393.7 kB
Tags Source
SHA-256 checksum
How to use checksums
35d64298f92484a6a1446f0f9c7c0b2f48f17d44365384783545b01cc489d84b
BLAKE2b-256 checksum
How to use checksums
6f703fa7566e6df5fb95096f0188ca5bec5197a869d626acfb6fa3a572ad5bf6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lecop-0.2.0-py3-none-win_amd64.whl

Download URL lecop-0.2.0-py3-none-win_amd64.whl
Size 5.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
976a1ef97e8e99117bb58c258dc2bfc1f004013e52eefb7ae0b3f51ebc115ca3
BLAKE2b-256 checksum
How to use checksums
91dfcd0d3b4345bc5dd992e1004409459b9cbd3886c6c1d06c8bfad39c622723
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lecop-0.2.0-py3-none-manylinux_2_28_x86_64.whl

Download URL lecop-0.2.0-py3-none-manylinux_2_28_x86_64.whl
Size 5.8 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
ba3c5dbb239914b0caee2583ba7f02059a349a9ca883a29d789177a59293ad76
BLAKE2b-256 checksum
How to use checksums
84113d23f0ee000c3f68ecc9ce6820f650d5999279e1bc6a226e051563bd762c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lecop-0.2.0-py3-none-manylinux_2_28_aarch64.whl

Download URL lecop-0.2.0-py3-none-manylinux_2_28_aarch64.whl
Size 5.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
f8dc92f92a902a937aeb699d45038825045caf3dc23fc4420c9cd36cad2bed0d
BLAKE2b-256 checksum
How to use checksums
cee49e750a935d5ef285993cf9674a5feaa6c0b51eeaa4899d2a2fa21e375cd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lecop-0.2.0-py3-none-macosx_11_0_arm64.whl

Download URL lecop-0.2.0-py3-none-macosx_11_0_arm64.whl
Size 4.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6a3a2085dcfdd4a877767e27003c8558db92587e06003ae7e70b738f6d4eb030
BLAKE2b-256 checksum
How to use checksums
fcad25199c90238c011ba4a5dccbefc7502a693863c505b9c3f536208a4922db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lecop-0.2.0-py3-none-macosx_10_12_x86_64.whl

Download URL lecop-0.2.0-py3-none-macosx_10_12_x86_64.whl
Size 5.4 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
d5932d073e04ea48857647d882dd8e4d1ea9b519176a190b4a0124628f619b53
BLAKE2b-256 checksum
How to use checksums
075dc44da117a95202a52778fdbeccbb1022302b4677165e05b6cd0056444662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for lecop 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page