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 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 --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: 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 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.3.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.3.0
File Size Uploaded Provenance Actions
lecop-0.3.0.tar.gz 395.1 kB Without provenance Details for lecop-0.3.0.tar.gz

Built distributions (wheels)

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

Total release size: 26.5 MB

Release files / lecop-0.3.0.tar.gz

Download URL lecop-0.3.0.tar.gz
Size 395.1 kB
Tags Source
SHA-256 checksum
How to use checksums
796ad6286713861bb171dd0ff6dded90b8556d435429b1322ffcf4ac8becf5a2
BLAKE2b-256 checksum
How to use checksums
1e40cfe2e87c5f242096c3d1aaea88d3888f4f6b4d7f3311b8e6280838cdf08a
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.3.0-py3-none-win_amd64.whl

Download URL lecop-0.3.0-py3-none-win_amd64.whl
Size 5.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
1f1f2b10924ce50bc52d3ef700db04b08e9e3a5330938c27c951f6e607a58f37
BLAKE2b-256 checksum
How to use checksums
8a8ee660d0c5be5ee486ae6be676dcc7a04fa2681cbcca98400bab5aaefc6cbd
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.3.0-py3-none-manylinux_2_28_x86_64.whl

Download URL lecop-0.3.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
7e5c5789ecc3e330641a43dbdc3cf1f50bd929553578c90765cfcb8edbf9563f
BLAKE2b-256 checksum
How to use checksums
947534e27e818bf5370a8e08ca4d87bb49c2c8f743160aef8609830b73335b51
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.3.0-py3-none-manylinux_2_28_aarch64.whl

Download URL lecop-0.3.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
31becd0736b1ac4ffd809a5484e038f8902abb44946539e91741e9927149e261
BLAKE2b-256 checksum
How to use checksums
47ac5c1ba6a365ea679873ff8330b02db6e6f30c58ce6f5adba4e3f39b8a9f72
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.3.0-py3-none-macosx_11_0_arm64.whl

Download URL lecop-0.3.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
3ca930c6e48b00edc334d1be27ac4a5e751fe09315fe6ec1247bf59401f2400f
BLAKE2b-256 checksum
How to use checksums
cdf2c501b88186faffd9445bb949a686f415decabb4e13110fd7313255fd3f53
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.3.0-py3-none-macosx_10_12_x86_64.whl

Download URL lecop-0.3.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
c6f8b1ed1b839d4c96eb7c04a9dc863f13c9ae7bd9d19e33ea5d9d0f3b6294f8
BLAKE2b-256 checksum
How to use checksums
8e996d45f30d0a6100a6aa6bf355598ea5f927c4d7b574f16cfa52f04d56bf28
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.3.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