Metadata-Version: 2.4
Name: robot-data-audit
Version: 0.7.3
Summary: Robot Data Audit (RDA) - Quality auditing tool for robot datasets
Author-email: Niu Su Tech <dev@niusutech.com>
License: MIT License
        
        Copyright (c) 2026 Niu Su Tech
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/liesliy/rda
Project-URL: Documentation, https://github.com/liesliy/rda#readme
Project-URL: Issues, https://github.com/liesliy/rda/issues
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0
Requires-Dist: pydantic>=2.0
Requires-Dist: numpy>=1.24
Requires-Dist: requests>=2.20
Provides-Extra: lerobot
Requires-Dist: lerobot>=0.6; extra == "lerobot"
Provides-Extra: video
Requires-Dist: av>=12.0; extra == "video"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Requires-Dist: ruff>=0.1; extra == "dev"
Provides-Extra: ui
Requires-Dist: streamlit>=1.36.0; extra == "ui"
Requires-Dist: plotly>=5.18.0; extra == "ui"
Requires-Dist: pandas>=2.0; extra == "ui"
Provides-Extra: all
Requires-Dist: lerobot>=0.6; extra == "all"
Requires-Dist: av>=12.0; extra == "all"
Requires-Dist: streamlit>=1.36.0; extra == "all"
Requires-Dist: plotly>=5.18.0; extra == "all"
Requires-Dist: pandas>=2.0; extra == "all"
Dynamic: license-file

# Robot Data Audit (RDA)

[![PyPI](https://img.shields.io/pypi/v/robot-data-audit)](https://pypi.org/project/robot-data-audit/)
[![Python](https://img.shields.io/pypi/pyversions/robot-data-audit)](https://pypi.org/project/robot-data-audit/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://static.pepy.tech/badge/robot-data-audit)](https://pepy.tech/project/robot-data-audit)
[![Tests](https://github.com/liesliy/rda/actions/workflows/ci.yml/badge.svg)](https://github.com/liesliy/rda/actions/workflows/ci.yml)

[![audit: lerobot/pusht](https://raw.githubusercontent.com/liesliy/rda/main/docs/examples/rda_badge_pusht.svg)](https://liesliy.github.io/rda/examples/rda_report_pusht.html) [![audit: AgiBotWorld2026 RL](https://raw.githubusercontent.com/liesliy/rda/main/docs/examples/rda_badge_agibot_rl.svg)](https://liesliy.github.io/rda/examples/rda_report_agibot_rl_hgdagger.html)

> **Independent quality assessment for robot data.** Runs locally — your data never leaves your machine.
>
> RDA is a diagnostic tool. It does not guarantee training success-rate improvements.

RDA audits robot manipulation datasets (LeRobot format) for integrity, temporal consistency, motion quality and distribution coverage, then generates optimization recommendations calibrated to your target model architecture. Use it as an independent check before you accept a vendor dataset, train a policy, or publish a benchmark.

<p align="center">
  <img width="2549" alt="RDA audit overview" src="https://github.com/user-attachments/assets/35173b6a-275c-466c-985f-9674f7a59a1d" />
</p>

## Install

```bash
pip install robot-data-audit
```

Optional dependency tiers:

| Tier | Extra | Unlocks |
|---|---|---|
| Core (default) | — | parquet audits: integrity + temporal/motion + dataset-utility metrics |
| Visual | `pip install robot-data-audit[video]` or `pip install av` | the 4 visual metrics (freeze / timestamp-alignment / stream-sync / quality) |
| Lerobot | `[lerobot]` | `.parquet` dataset loading via the lerobot package |
| UI | `[ui]` | the web dashboard |

**Visual metrics without PyAV are reported as "not audited", never as
"pass"**: the JSON report carries a top-level `skipped_by_missing_dep`
field and the CLI prints a warning listing the skipped checks. The web
dashboard shows the same guarantee — a dep-missing dataset renders a
"not audited ≠ pass" banner, and the Health Overview adds a Visual
Integrity section (checked / flagged / not-checked episode counts) while
Episode Explorer gains a per-episode Visual Audit panel (freeze-region
table, per-camera quality penalties, per-sample quality curves).

## Quick start

```bash
# 1. Audit a dataset — 18 metrics incl. visual-stream integrity, three-tier verdicts (PASS / REVIEW / EXCLUDE)
rda audit /path/to/lerobot/dataset

# 2. Recommendations calibrated to your model type
rda recommend /path/to/dataset --policy temporal   # or frame-wise

# 3. Optional web dashboard
rda ui
```

`rda audit` is fully offline. `rda recommend` computes all metrics locally and sends only aggregated statistics (<1KB) to the rules API — cached for offline reuse, and `RDA_API_URL` can point to your own server for private deployments. The `usable_retention` statistic is **fps-aware** (v0.7.3): a "usable" run must span ≥16 frames *and* ≥1 second (DROID's `min_non_idle_len=16` encodes 1 s at 15-30 Hz; on 50 Hz data the floor rises to 50 frames so sub-second twitches no longer count).

<p align="center">
  <img width="2549" alt="RDA recommendations" src="https://github.com/user-attachments/assets/e366cdf1-b169-46b0-b020-5327493a9124" />
</p>

## Why RDA

**12 local datasets, 4,959 episodes, one set of default thresholds, zero per-dataset tuning** — full table in [docs/benchmark.md](docs/benchmark.md).

**Full audit of lerobot/libero_10 (v3.0)** — 379 episodes, 101,469 frames: all 12 applicable integrity checks clean, 0 hard defects; the one REVIEW signal (low-motion heuristic) is discussed honestly. **[Read the report →](docs/benchmark_libero10.md)**

**Blind test** — we injected 50 defective episodes (5 defect classes, seed=42) into `lerobot/pusht` and kept 156 as controls. RDA caught all 50 under the broad criterion, precision **1.000** (zero false alarms on controls) under the strict one. **[Read the blind-test report →](https://liesliy.github.io/rda/examples/rda_report_pusht.html)**

**Validated on AgiBotWorld2026** — third-party audit of AgiBot's Phase 3 dataset: all 5 simulation tasks + a real-robot RL package, 1,112 episodes, 4,448 integrity checks with 0 failures, and a **3.1× enrichment** of RDA's discontinuity spikes at official human-takeover boundaries. Zero adaptation needed. **[Read the case study →](docs/examples/agibotworld2026.md)**

Every audit can also render into a shareable single-file HTML report and a README badge:

```bash
python tools/rda_render.py rda_report.json --html report.html --badge badge.svg
```

More: [CLI reference & metrics table](docs/cli.md) · [experiments](experiments/) · [real-world feedback form](https://github.com/liesliy/rda/issues/new?template=real-world-feedback.yml)

## Metric provenance

Every metric ships with a four-file provenance record (`docs/provenance/<metric>/`): **algorithm.md** (how it works), **source.md** (public precedents consulted — ideas only), **implementation_origin.md** (original implementation, zero third-party code), **license.md** (compliance notes). Covered: all 18 metrics (`missing_dropout`, `invalid_values`, `schema_consistency`, `timestamp_validity`, `joint_limit`, `video_frame_integrity`, `video_freeze`, `video_timestamp_alignment`, `video_stream_sync`, `visual_quality`, `sensor_synchronization`, `sampling_jitter`, `velocity_acceleration`, `action_discontinuity`, `temporal_sufficiency`, `idle_ratio`, `distribution`, `coverage`). Index: [docs/provenance/](docs/provenance/).

## Citation

```bibtex
@software{robot_data_audit,
  title = {Robot Data Audit: Quality Auditing for Robot Manipulation Datasets},
  author = {Niu Su Tech},
  year = {2026},
  url = {https://github.com/liesliy/rda}
}
```

MIT License.
