|
|
evlib is an event camera processing library with a Rust backend and Python bindings, built for scalable processing of real-world event camera datasets. It keeps a thin Rust core for binary format decoding and native compute kernels, and does all DataFrame work in Polars from Python, so the same lazy query runs on the CPU streaming engine or, unchanged, on the GPU via cudf-polars.
Why evlib¶
- Universal format support: EVT2/3, HDF5 (with the Prophesee ECF codec), AEDAT, AER, and text. Format detection is automatic. EVT2 decode is checked byte-identical to the OpenEB reference decoder by a committed-digest conformance gate.
- Polars DataFrame integration:
load_eventsreturns a lazyLazyFrame; filtering and representation building are Polars expressions that collect on the CPU streaming engine or, unchanged, on the GPU via cudf-polars. - RVT-identical preprocessing:
evlib.rvt.process_sequencereproduces RVT's stacked-histogram pipeline across four backends (polars,rust,cuda,metal), bit-validated against RVT's own torch preprocessing. - Deep learning models: E2VID and RVT (
evlib.models), with pretrained weight loading, PyTorch datasets (evlib.data), and Prophesee-compatible detection evaluation (evlib.eval). - Real-world scale: tested against files up to 1.6GB with an exact, empirically confirmed 13 bytes/event on-wire layout.
- Low-level utilities:
evlib.coreexposes array-based helper functions (events_to_block,merge_events,add_random_events,remove_events) for custom pipelines that need direct array access instead of aLazyFrame; see Architecture.
Explore the docs¶
-
Getting Started
Install evlib and load your first event file in five minutes.
-
User Guide
Loading, formats, filtering, representations, and Polars preprocessing.
-
RVT Pipeline
RVT-identical stacked-histogram preprocessing across four backends, plus OpenEB conformance.
-
Models & Training
E2VID and RVT models, PyTorch datasets, and detection evaluation.
-
API Reference
Full reference for core, formats, filtering, representations, processing, and data loading.
A worked example¶
import evlib
# Automatic format detection: returns a Polars LazyFrame
events = evlib.load_events("data/prophesee/samples/evt2/80_balls.raw")
df = events.collect(engine="streaming")
print(f"Loaded {len(df):,} events")
print(f"Resolution: {df['x'].max()+1} x {df['y'].max()+1}")
print(f"Duration: {df['t'].max() - df['t'].min()}")
See the Quick Start guide for filtering and representation examples that build on this.
Performance¶
evlib is bit-validated against RVT (PyTorch), tonic, OpenEB, and dv_processing. On the gen4_1mpx validation set (18 sequences, RTX 4090), RVT preprocessing matches RVT torch exactly bar a single roughly 1e-10 boundary quirk, and evlib's CUDA backend reaches parity-plus with RVT's own torch-GPU pipeline while its Rust CPU backend is 1.32x faster than RVT's torch-CPU reference.
See the Performance Guide and RVT Pipeline pages for the full benchmark set, including the representations-versus-tonic comparison and GPU memory footprint.
Installation¶
Polars is a hard dependency, so no extra install step is needed for DataFrame
support. For PyTorch model support, pip install evlib[torch]. See the
Installation guide for source builds,
system dependencies, and platform-specific HDF5 notes.
Development and support¶
pytest # Python test suite
cargo test # Rust test suite
pytest --markdown-docs docs/ # documentation examples
See the Contributing guide for the full development workflow. Report bugs and request features on GitHub Issues.
License¶
MIT License, see LICENSE.md for details.