Skip to content
evlib logo

evlib: Event Camera Data Processing Library

[![PyPI Version](https://img.shields.io/pypi/v/evlib.svg)](https://pypi.org/project/evlib/) [![Python Versions](https://img.shields.io/pypi/pyversions/evlib.svg)](https://pypi.org/project/evlib/) [![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://tallamjr.github.io/evlib/) [![Python](https://github.com/tallamjr/evlib/actions/workflows/pytest.yml/badge.svg)](https://github.com/tallamjr/evlib/actions/workflows/pytest.yml) [![Rust](https://github.com/tallamjr/evlib/actions/workflows/rust.yml/badge.svg)](https://github.com/tallamjr/evlib/actions/workflows/rust.yml) [![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-blue)](https://github.com/tallamjr/evlib) [![License](https://img.shields.io/github/license/tallamjr/evlib)](https://github.com/tallamjr/evlib/blob/master/LICENSE.md)

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.

evlib architecture: a file (.raw, .hdf5, ...) flows through the Rust decode core (EVT2/3, ECF, AEDAT) into a Polars LazyFrame of x, y, t, p columns, which branches into collect(engine="streaming") and collect(engine="gpu") before filtering and representations evlib architecture (dark variant): a file (.raw, .hdf5, ...) flows through the Rust decode core (EVT2/3, ECF, AEDAT) into a Polars LazyFrame of x, y, t, p columns, which branches into collect(engine="streaming") and collect(engine="gpu") before filtering and representations

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_events returns a lazy LazyFrame; 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_sequence reproduces 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.core exposes array-based helper functions (events_to_block, merge_events, add_random_events, remove_events) for custom pipelines that need direct array access instead of a LazyFrame; see Architecture.

Explore the docs

  • Getting Started


    Install evlib and load your first event file in five minutes.

    Quick Start

  • User Guide


    Loading, formats, filtering, representations, and Polars preprocessing.

    Loading Data

  • RVT Pipeline


    RVT-identical stacked-histogram preprocessing across four backends, plus OpenEB conformance.

    RVT Overview

  • Models & Training


    E2VID and RVT models, PyTorch datasets, and detection evaluation.

    Models Overview

  • API Reference


    Full reference for core, formats, filtering, representations, processing, and data loading.

    API Core

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()}")
Loaded 4,588,809 events
Resolution: 640 x 480
Duration:   0:00:06.284008

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.

evlib vs RVT preprocessing on an RTX 4090: evlib is faster than RVT on both GPU and CPU

evlib vs RVT preprocessing on an RTX 4090: evlib is faster than RVT on both GPU and CPU

See the Performance Guide and RVT Pipeline pages for the full benchmark set, including the representations-versus-tonic comparison and GPU memory footprint.

Installation

pip install evlib

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.