eventify-dvs
Convert video files or webcam feeds into simulated event-camera (DVS) data using log-intensity differencing. A clean-room, dependency-light reimplementation of the core idea behind v2e/ESIM — no CUDA, no PyTorch, no pretrained models. Just NumPy, OpenCV, and h5py.
Install
pip install eventify-dvs
The CLI entry point is eventify. With uv:
uv add eventify-dvs
uv run eventify --help
CLI
Three subcommands under the eventify entry point.
eventify webcam — live event preview
Opens the default camera and shows the event stream in an OpenCV window. Press q to quit. On macOS, grant camera permission to your terminal app first (System Settings → Privacy & Security → Camera).
# Defaults — 1280x720 @ 60 FPS
eventify webcam
# Snappy, high-sensitivity preview
eventify webcam --threshold 0.03 --accum-ms 40
# Different camera
eventify webcam --device 1
| Flag | Default | Purpose |
|---|---|---|
--device |
0 |
Webcam device index |
--threshold |
0.05 |
Log-intensity event threshold |
--width |
1280 |
Requested capture width |
--height |
720 |
Requested capture height |
--fps |
60 |
Requested capture FPS |
--accum-ms |
80 |
Event accumulator half-life in ms |
--max-events |
8 |
Saturation ceiling for accumulated events per pixel |
eventify convert — video file → event-visualized video
eventify convert input.mp4 events.mp4
eventify convert input.mp4 events.mp4 --threshold 0.03
| Flag | Default | Purpose |
|---|---|---|
input |
— | Path to source video |
output |
— | Path to write the rendered MP4 |
--threshold |
0.05 |
Log-intensity event threshold |
eventify export — video → DVS-Gesture HDF5
Emits binary-polarity DVS events to an HDF5 file compatible with the DVS128 Gesture dataset layout (Tonic / SpikingJelly loaders).
eventify export input.mp4 events.h5
eventify export input.mp4 events.h5 --sensor-size 128,128 --interp 4
| Flag | Default | Purpose |
|---|---|---|
input |
— | Path to source video |
output |
— | Path to write the HDF5 events file |
--threshold |
0.05 |
Log-intensity event threshold |
--sensor-size |
source resolution | Override as W,H |
--interp |
0 |
Interpolated sub-frames between real frames |
Library
import numpy as np
from eventify import (
frame_to_event_tuples,
video_to_event_stream,
frame_stream,
interpolate_frames,
write_hdf5,
EVENT_DTYPE,
)
# Per-frame-pair event tuples
events = frame_to_event_tuples(prev, curr, prev_t_us=0, curr_t_us=1000)
# events["x"], events["y"], events["t"], events["p"] — p ∈ {0, 1}
# Full stream from a video file
chunks = list(video_to_event_stream("video.mp4", sensor_size=(128, 128), interp=4))
all_events = np.concatenate(chunks)
write_hdf5("out.h5", all_events, sensor_shape=(128, 128))
# Binned event tensors for SNN inference
for frames in frame_stream("video.mp4", sensor_size=(128, 128), n_bins=5, window_ms=50):
... # frames: (5, 2, 128, 128) — channel 0 = OFF, channel 1 = ON
API reference
-
frame_to_event_tuples(prev, curr, prev_t_us, curr_t_us, c_thresh=0.05, eps=1.0, sensor_size=None)— returns a NumPy structured array with dtypeEVENT_DTYPEand fields(x: i2, y: i2, t: i8, p: i1). Polarity is binary (0 = OFF, 1 = ON). A pixel whose log-delta spansKthresholds emitsKevents, uniformly staggered across the interval. -
video_to_event_stream(source, c_thresh=0.05, sensor_size=None, interp=0, capture_settings=None, duration_s=None, warmup_frames=0)— generator yielding one structured event array per (sub-)frame-pair. Timestamps are monotonic microseconds: container timestamps for file sources, wall-clock for live (integer) sources.duration_sstops the stream once timestamps reach it;warmup_framesdiscards initial frames so a webcam's auto-exposure can settle. -
frame_stream(source, sensor_size, n_bins, window_ms, c_thresh=0.05, capture_settings=None, stride_ms=None, dtype=np.float32)— generator yielding(n_bins, 2, H, W)tensors of per-bin event counts (channel 0 = OFF, channel 1 = ON).sensor_sizeis(W, H), like everywhere else in the library. Windows are non-overlapping unlessstride_ms < window_ms. -
interpolate_frames(prev, curr, n_intermediate)— linearly interpolatesn_intermediateframes between two endpoints, returning a list ofn_intermediate + 2frames. -
write_hdf5(path, events, sensor_shape)— writes events in the DVS-Gesture reprocessed layout:/events .attrs["sensor_shape"] (height, width) /xs i2 /ys i2 /ts i8 microseconds /ps i1 ∈ {0, 1} -
EVENT_DTYPE— NumPy structured dtype[("x", "<i2"), ("y", "<i2"), ("t", "<i8"), ("p", "<i1")].
Tests
uv run pytest
License
MIT — see LICENSE.
Metadata
Release files for eventify-dvs 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| eventify_dvs-0.2.0.tar.gz | 68.9 kB | With provenance | Details for eventify_dvs-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eventify_dvs-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for eventify_dvs-0.2.0-py3-none-any.whl |
Total release size: 81.6 kB
Release files / eventify_dvs-0.2.0.tar.gz
| Download URL | eventify_dvs-0.2.0.tar.gz |
|---|---|
| Size | 68.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2b558f3ae0f7b467ed3b97fdb63e670435e264bd262bc4e4e8c8fd5d6b79acb
|
|
BLAKE2b-256 checksum How to use checksums |
f61f0ee818d50a02e70852d123886f310ee2d508ce73166152cb4efc406b69f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.
Transparency logRelease files / eventify_dvs-0.2.0-py3-none-any.whl
| Download URL | eventify_dvs-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8df5d71d48f70e7c5e7bae4bf5b77cc84a6e2d0866ee6160cdc89664ad45295b
|
|
BLAKE2b-256 checksum How to use checksums |
d59c366f0240b0de42612f78379561fa6041eb58ad541a393904871db06ac824
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.
Transparency logSecurity for eventify-dvs 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for eventify_dvs-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.