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.

In CI

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/dataset

Options and a pre-commit hook are in In a pipeline.

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.1

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.1
File Size Uploaded Provenance Actions
lecop-0.3.1.tar.gz 397.1 kB Without provenance Details for lecop-0.3.1.tar.gz

Built distributions (wheels)

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

Total release size: 26.5 MB

Release files / lecop-0.3.1.tar.gz

Download URL lecop-0.3.1.tar.gz
Size 397.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d58ce227f3010c98468a324e2d0af31c6f41116b2fed485aa14e7e17696282c9
BLAKE2b-256 checksum
How to use checksums
5ee453c8761e8bda8c66397016dbd3d71735576bfe722e7fbd28db2bf3b67fff
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.1-py3-none-win_amd64.whl

Download URL lecop-0.3.1-py3-none-win_amd64.whl
Size 5.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
265b204b832132779bba333effaffe05fe18e751c7bc3680b2a305a6501eea14
BLAKE2b-256 checksum
How to use checksums
5ebd2598ee31fdc0c39069805107184c5b144c1bbb0e92f58ac438fd83a86468
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.1-py3-none-manylinux_2_28_x86_64.whl

Download URL lecop-0.3.1-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
84d2c9912dd09d22ff818b695f1ff3ef7237a2ef781b0fddaeea0d7945252b5c
BLAKE2b-256 checksum
How to use checksums
1c349c0bab0070023a17645ce5648425da77709f6f9f709612d9a253aea2cce7
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.1-py3-none-manylinux_2_28_aarch64.whl

Download URL lecop-0.3.1-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
6be0019e7af15ba1a682f81a1b64a9bf217b4856e330233b4cdce4431a5f9fb0
BLAKE2b-256 checksum
How to use checksums
cca1eed8cd6481162ac9c74e31cf7c94ff9f12e266685f44c6dc1c7fa0f97a01
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.1-py3-none-macosx_11_0_arm64.whl

Download URL lecop-0.3.1-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
e594640d3793ac3b6e9af54e6b7da777cc0a6ca48503bcebc54f0c5c1440f6da
BLAKE2b-256 checksum
How to use checksums
8e4129499a8c8d453efd62050c441ad46aef76b9d0abb0e9dd9e7f57bef4a984
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.1-py3-none-macosx_10_12_x86_64.whl

Download URL lecop-0.3.1-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
3e71b95fd71771e22b8247880d6dc7fd610c05c23c6c786aeecc9e03ac597b6d
BLAKE2b-256 checksum
How to use checksums
43060b75e15a0c4349f0f1712b15b01432324dca37b0806f506eb347769a9d88
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.1

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