Locally Adaptive Decay Surfaces for event data representation.
Project description
Locally Adaptive Decay Surfaces (LADS)
Python package for event-based vision processing with LADS, paper preprint available here.
Installation
You can install the package using:
pip install event-lads
Usage
The LADS class is the core of this package and is used to integrate event data into locally adaptive decay surfaces. See the code snippet below for sample usage.
A full implementation for all decay functions with a real event clip is provided in create_event_video.py.
import torch
import numpy as np
from event_lads import *
import matplotlib.pyplot as plt
# Initialize LADS
lads = LADS(
H=64, W=64, # Spatial dims of input events and output surface
device=torch.device("cuda:0" if torch.cuda.is_available() else "cpu"),
decay_func="er", # Options:["global-li", "er", "fft", "log"]
reference_event_rate=0.1,
decay_param=0.2,
patch_size=8
)
# Generate dummy event data
events = np.array([
[0.1, 32, 32, 1], #(timestamp, x, y, polarity)
[0.11, 10, 20, 1],
[0.2, 40, 50, -1],
[0.3, 32, 32, 1],
[0.35, 32, 32, 1],
[0.36, 10, 20, 1],
[0.4, 40, 50, -1],
[0.5, 32, 32, 1]
])
# Generate the surface by integrating the first block of events:
surface, patch_scores, patch_decay_factors = lads.integrateEvents(events[:4])
# patch_scores & patch_decay_factors are no longer needed but returned for analysis/visualisation.
frame = LADS_to_output_frame(surface, clip_val=3) # Convert the surface (tensor) to frame (ndarray).
plt.imshow(frame, cmap='gray')
plt.show()
# Update the surface by integrating more events:
surface, patch_scores, patch_decay_factors = lads.integrateEvents(events[4:])
frame = LADS_to_output_frame(surface, clip_val=3)
plt.imshow(frame, cmap='gray')
plt.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file event_lads-0.1.tar.gz.
File metadata
- Download URL: event_lads-0.1.tar.gz
- Upload date:
- Size: 57.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51f11c56dd20742696d38ebd3c276a76a6af56a85d76c0cb98b6119b6a0e4ee6
|
|
| MD5 |
b16005f95a74d46b9ea1970e395343d8
|
|
| BLAKE2b-256 |
69d648e9cb06cbc8c161464727d51e6b4fe1e60c67b38ea031af62c501a930ce
|
File details
Details for the file event_lads-0.1-py3-none-any.whl.
File metadata
- Download URL: event_lads-0.1-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a34b1cc1591ad7fa33ae3aaafe676afb1b9c82056f57320360b7a3780463cc1
|
|
| MD5 |
37edfdd7347e2a15954e7e386cc734a6
|
|
| BLAKE2b-256 |
efe42e20457bffe827c373ba2c9b535daeb05ba390e5c052619cb12c86cc9ead
|