Skip to main content

Inspect, clean, convert, and benchmark event-camera data from the command line

Project description

evlab

Inspect, clean, convert, and benchmark event-camera data from the command line.

Event-based vision has a preprocessing problem: every sensor and dataset ships a different container (AEDAT, ROS bags, CSV, NPZ, proprietary .dat), every paper wants a different representation (voxel grids, time surfaces, frames), and every pipeline reimplements the same denoising filters. evlab is the small, boring tool that handles that mess so you can get to the actual work.

pip install evlab[viz]

evlab info recording.npz                 # what is this file?
evlab convert events.aedat4 events.npz   # normalize the container
evlab convert drive.dat events.npz       # Prophesee .dat works too
evlab convert flight.bag events.npz      # ...and ROS bags (dvs_msgs)
evlab denoise events.npz clean.npz --filter baf --window 5000
evlab voxel clean.npz voxels.npy --bins 10
evlab visualize clean.npz preview.gif --mode gif
evlab benchmark events.npz clean.npz     # what did the filter do?
evlab corrupt clean.npz bad.npz --emit-recipe r.json   # benchmark generator
evlab corrupt-bench bad.npz --filter baf # per-type scores + detection AUROC
evlab features events.npz feats.csv      # 12 per-window monitor statistics

How good is a denoising filter, really? Generate a labeled stream and score it:

evlab synth labeled.npz --signal-rate 20000 --noise-rate 8000
evlab denoise-bench labeled.npz --filter baf --window 3000
#   precision     : 99.2%
#   recall        : 37.8%
#   f1            : 0.548
#   noise removed : 99.2%

Need a robustness benchmark instead of a clean one? evlab corrupt injects six physically modeled sensor failure modes (leak-event hot pixels, mains flicker, background-activity bursts, dead regions, readout congestion, polarity faults) as timed episodes with per-event ground-truth labels, at two documented severities. Injected timestamps are snapped to the recording's detected clock quantum, so detectors find the corruption, not the injection. --emit-recipe/--recipe make a corrupted benchmark exactly reproducible from the source recording:

evlab corrupt drive.npz drive_c.npz --types flicker,burst --severity low \
    --seed 3 --emit-recipe drive_c.recipe.json
evlab corrupt drive.npz drive_c_again.npz --recipe drive_c.recipe.json  # identical

evlab corrupt-bench then scores any denoising filter on the corrupted stream: precision/recall against the per-event labels, removal rate broken out per corruption type, clean-signal retention, and (using the embedded episode schedule) the filter's per-window removal rate as a corruption detector, reported as windowed AUROC and median time-to-detection at 5% false-positive rate:

evlab corrupt-bench drive_c.npz --filter baf --window 3000
#   precision       : 87.5%
#   recall          : 96.1%
#   clean retention : 45.7%
#   burst           : 94.6% of 224,508 removed
#   hot-pixels      : 96.5% of 881,946 removed
#   as detector     : AUROC 1.000, 2/2 episodes, median TTD 72 ms

Status

Early alpha. Works and is tested: the canonical representation; loading NPZ/CSV/TXT, AEDAT4 ([aedat] extra), Prophesee legacy .dat (with timestamp-wrap handling), and ROS1/ROS2 bags with EventArray topics ([ros] extra); BAF/refractory denoising; voxel grids, time surfaces, accumulate frames; synthetic labeled streams and precision/recall filter scoring; six-type corruption injection with reproducible recipes and per-type filter scoring with detection AUROC / time-to-detection; 12 causal per-window monitoring features (evlab features); and the eleven CLI commands above. Planned next: Prophesee EVT3 .raw, dataset-aware loaders (via Tonic), streaming via Faery, and more filters (STCF, IE/YNoise) under denoise-bench.

Python API

import evlab

data = evlab.load("recording.npz")          # EventData: (x, y, t, p) + sensor size
print(data.event_rate)

from evlab.filters import background_activity_filter
clean = background_activity_filter(data, time_window_us=5000)

from evlab.representations import voxel_grid
grid = voxel_grid(clean, bins=10)            # (10, H, W) float32, ready for torch

Design notes

  • One canonical in-memory format: a t-sorted structured numpy array (x: u2, y: u2, t: i8 (µs), p: i1) plus sensor geometry. Every loader normalizes into it; every filter/representation consumes it.
  • Zero heavy dependencies in the core (numpy + click). Visualization, AEDAT support, and dataset loaders are opt-in extras.
  • Filters return copies; nothing mutates your data behind your back.

Development

pip install -e .[dev]
pytest
ruff check src tests

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

evlab-0.2.0a1.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

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

evlab-0.2.0a1-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file evlab-0.2.0a1.tar.gz.

File metadata

  • Download URL: evlab-0.2.0a1.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evlab-0.2.0a1.tar.gz
Algorithm Hash digest
SHA256 d88030050d8fcbc26aec97ef6e155bfcee2af52a1789ca8fc280b3754d9ce8cb
MD5 56efb49ed6284f1915f91d4c216b3000
BLAKE2b-256 90880c4fa5408e6d9f389a9ef0503f6a0ae064a00be4bb58c792bb4ff4a45b8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for evlab-0.2.0a1.tar.gz:

Publisher: release.yml on JPL11/evlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file evlab-0.2.0a1-py3-none-any.whl.

File metadata

  • Download URL: evlab-0.2.0a1-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for evlab-0.2.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 370e58a2baf02462ea6d59281f8ce6a61824c0f727770d822f4154bfbae65215
MD5 136f25813e3882f6179566919b982b9b
BLAKE2b-256 9e4a972e60af59026c7ad74f3c1b1f20d5c92ef5494ccf0fb0f8d23356da17e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for evlab-0.2.0a1-py3-none-any.whl:

Publisher: release.yml on JPL11/evlab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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