Frames2Py¶
Frames2Py is a Python library for live, decoupled observation of event-camera state.
An event camera reports brightness changes per pixel, as a stream of events, often millions a second. Most programs that consume such a stream need two things at once: a hot loop that keeps up with the stream (tracking, inference, control), and some way to look at what the sensor is seeing right now (a display, a monitor, a logger, a second algorithm). Put the second inside the first and the hot loop slows to the speed of the display. Put a queue between them and the queue grows, or blocks, or drops.
Frames2Py separates them. Your producer feeds events to Engine.ingest(), which
accumulates them through a kernel into a per-pixel representation and publishes snapshots
of it. Any number of consumers read the latest snapshot at their own pace. The producer
never waits for them.
The Architecture page has the ingest path step by step, and the rules the design keeps.
What is in the box¶
Engine: the live runtime. One producer thread callsingest(); consumers callsnapshot()or wait for a newer one withwait_for_newer(), and readstats.Accumulator: the same accumulation without publication, for synchronous use: offline processing, tests, your own loop.- Seven kernels: event counts, per-polarity counts, a time surface, a per-call exponential decay, an event-time exponential decay, and two temporal kernels for models: a per-polarity histogram over time bins and a voxel grid.
- Snapshots: each publication is a frame and its metadata, shared by every consumer and never written again.
- File adapters for EVT 2.0 / 3.0 (Prophesee RAW), AEDAT 4.0 and HDF5; a recorder that writes events to HDF5; paced replay of recordings and frames at fixed steps of event time; and a small viewer.
- A PyTorch recipe for handing snapshots to models, with explicit copies, dtypes and devices. PyTorch is not a dependency.
The core needs NumPy and nothing else. Adapters, the recorder and the viewer are optional extras.
Where to start¶
- Install it:
pip install frames2py. - Run the quickstart: synthetic events in, a snapshot out, in about 20 lines.
- Read Concepts for the vocabulary, then the event contract before feeding real data.
- Run the end-to-end notebook,
examples/live_observation.ipynb, from a checkout: a live Engine on a synthetic stream, a tracker and a deliberately slow consumer waiting for snapshots, areset(), and what each of them saw.
What Frames2Py is not¶
It is not a camera SDK or driver, a file-conversion toolkit, an ML framework, a general
stream processor or a visualisation package. It reads event arrays at one boundary
(EVENT_DTYPE) and leaves decoding of most formats, hardware access and offline
conversion to the tools that already do them well.
Status¶
Version 1.1.0 (see the changelog). The public API described here is stable: changing it incompatibly needs a 2.0. Frames2Py is maintained on a best-effort basis. Performance figures are measurements on one machine, with their conditions: see Performance. What it doesn't do or support is collected under Known limitations.
Frames2Py is licensed under the Apache License, Version 2.0, from 1.1.0 on (LICENSE). Releases 1.0.0rc1 and 1.0.0 were published under the MIT License, which still applies to them. Reporting a security problem: Security.