Skip to main content

Score robot demonstrations by motion quality

Project description

democlean

Score robot demonstrations by motion quality. Identify jerky, inconsistent episodes before training.

Install

pip install democlean

Usage

# Score a dataset
democlean analyze lerobot/pusht

# Keep top 80%
democlean analyze lerobot/pusht --keep 0.8 -r report.json

# Filter by threshold
democlean analyze lerobot/pusht --min-mi 2.0

# Normalize by episode length
democlean analyze lerobot/pusht --normalize-length --keep 0.8

Output

democlean 0.1.0

Dataset lerobot/pusht
Episodes: 50 | Dims: 2->2

Distribution
  ███████████████████████████████  High   30
  ██████████                       Medium 15
  █████                            Low     5

Mean   2.55   (typical for human teleop)
Std    0.27
Range  [1.90, 3.04]

Flagged (lowest MI)
  ep  46  1.897
  ep   6  1.984

How It Works

democlean computes Mutual Information (MI) between states and actions using the KSG estimator.

High MI indicates:

  • Temporally smooth actions
  • Low jerk motion
  • Purposeful movement

Low MI indicates:

  • Jerky, hesitant motion
  • Inconsistent action timing

Limitations:

  • MI correlates with episode length (r~0.8). Use --normalize-length to account for this.
  • Does not detect task failure. Use task-specific metrics for that.
  • Works best with 50+ episodes.

Interpreting Scores

MI Range Meaning
> 3.0 Very smooth, consistent
2.0 - 3.0 Typical human teleop
1.0 - 2.0 Moderate quality
< 1.0 Noisy or random

Python API

from democlean import DemoScorer

scorer = DemoScorer(k=3)
scores = scorer.score_dataset("lerobot/pusht")
keep = scorer.filter_top_k(scores, percentile=80)

CLI Options

Flag Description
--keep R Keep top R ratio (0-1)
--top-k K Keep top K episodes
--min-mi T Drop episodes below threshold T
--normalize-length Normalize MI by episode length
-k N KSG neighbors (default: 3)
--max-dim D PCA reduce states to D dimensions
--ci Compute 95% confidence intervals
-r FILE Save JSON report
-q Quiet mode
--explain Show detailed explanation

Comparison with score_lerobot_episodes

Tool Detects
score_lerobot_episodes Visual issues (blur, jitter)
democlean Motion issues (jerky, inconsistent)

They complement each other.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

democlean-0.1.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

democlean-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file democlean-0.1.0.tar.gz.

File metadata

  • Download URL: democlean-0.1.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for democlean-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0ea6a4ca3220c0286cc6007b0703ddb7316aa466b13ac5f1f1828426a8154382
MD5 ba320ae6c1330fc227eef72ad46bf0c7
BLAKE2b-256 654a3efd6bf5494f87cc71db85c9af7619258b6c64c5ed378ca219d3f8685c95

See more details on using hashes here.

File details

Details for the file democlean-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: democlean-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for democlean-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd3db7f70fa7a6a596137d0e6ef06723b482db056a52d9688797cece23af0476
MD5 a6d8c8e399d998e056119c8865da90dc
BLAKE2b-256 59c09a7b9af4bdb262add67a97dfa82c0de60a51873c36b6e5fb824bbfc9ad83

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page