aedat

A fast AEDAT 4 python decoder.

https://github.com/neuromorphicsystems/aedat

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.9%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

A fast AEDAT 4 python decoder.

Basic Info
Statistics
  • Stars: 42
  • Watchers: 4
  • Forks: 6
  • Open Issues: 0
  • Releases: 5
Created over 6 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

AEDAT is a fast AEDAT 4 python reader, with a Rust underlying implementation.

Run pip install aedat to install it.

Example

The aedat library provides a single class: Decoder. A decoder object is created by passing a file name to Decoder. The file name must be a path-like object.

```python import aedat

decoder = aedat.Decoder("/path/to/file.aedat") print(decoder.idtostream())

for packet in decoder: print(packet["stream_id"], end=": ") if "events" in packet: print("{} polarity events".format(len(packet["events"]))) elif "frame" in packet: print("{} x {} frame".format(packet["frame"]["width"], packet["frame"]["height"])) elif "imus" in packet: print("{} IMU samples".format(len(packet["imus"]))) elif "triggers" in packet: print("{} trigger events".format(len(packet["triggers"]))) ```

Process frames

Pillow (PIL)

```py import aedat import PIL.Image # https://pypi.org/project/Pillow/

index = 0 for packet in decoder: if "frame" in packet: image = PIL.Image.fromarray( packet["frame"]["pixels"], mode=packet["frame"]["format"], ) image.save(f"{index}.png") index += 1 ```

OpenCV

```py import aedat import cv2 # https://pypi.org/project/opencv-python/

index = 0 for packet in decoder: if "frame" in packet: image = packet["frame"]["pixels"] if packet["frame"]["format"] == "RGB": image = cv2.cvtColor(image, cv2.COLORRGB2BGR) elif packet["frame"]["format"] == "RGBA": image = cv2.cvtColor(image, cv2.COLORRGBA2BGRA) cv2.imwrite(f"{index}.png", image) index += 1 ```

Detailed example

This is the same as the first example, with detailed comments:

```python import aedat

decoder = aedat.Decoder("/path/to/file.aedat") """ decoder is a packet iterator with an additional method idtostream idtostream returns a dictionary with the following structure: { : { "type": , } } type is one of "events", "frame", "imus", "triggers" if type is "events" or "frame", its parent dictionary has the following structure: { "type": , "width": , "height": , } """ print(decoder.idtostream())

for packet in decoder: """ packet is a dictionary with the following structure: { "streamid": , } packet also has exactly one of the following fields: "events", "frame", "imus", "triggers" """ print(packet["streamid"], end=": ") if "events" in packet: """ packet["events"] is a structured numpy array with the following dtype: [ ("t", ", "begint": , "endt": , "exposurebegint": , "exposureendt": , "format": , "width": , "height": , "offsetx": , "offsety": , "pixels": , } format is one of "L", "RGB", "RGBA" """ print("{} x {} frame".format(packet["frame"]["width"], packet["frame"]["height"])) elif "imus" in packet: """ packet["imus"] is a structured numpy array with the following dtype: [ ("t", "<u8"), ("temperature", "<f4"), ("accelerometerx", "<f4"), ("accelerometery", "<f4"), ("accelerometerz", "<f4"), ("gyroscopex", "<f4"), ("gyroscopey", "<f4"), ("gyroscopez", "<f4"), ("magnetometerx", "<f4"), ("magnetometery", "<f4"), ("magnetometer_z", "<f4"), ] """ print("{} IMU samples".format(len(packet["imus"]))) elif "triggers" in packet: """ packet["triggers"] is a structured numpy array with the following dtype: [ ("t", "<u8"), ("source", "u1"), ] the source value has the following meaning: 0: timestamp reset 1: external signal rising edge 2: external signal falling edge 3: external signal pulse 4: external generator rising edge 5: external generator falling edge 6: frame begin 7: frame end 8: exposure begin 9: exposure end """ print("{} trigger events".format(len(packet["triggers"]))) ```

Because the lifetime of the file handle is managed by Rust, decoder objects are not compatible with the with statement. To ensure garbage collection, point the decoder variable to something else, for example None, when you are done using it:

```py import aedat

decoder = aedat.Decoder("/path/to/file.aedat")

do something with decoder

decoder = None ```

Install from source

Local build (first run).

sh python3 -m venv .venv source .venv/bin/activate pip install --upgrade pip pip install maturin numpy maturin develop # or maturin develop --release to build with optimizations

Local build (subsequent runs).

sh source .venv/bin/activate maturin develop # or maturin develop --release to build with optimizations

After changing any of the files in framebuffers, one must run:

sh flatc --rust -o src/ flatbuffers/*.fbs

To format the code, run:

sh cargo fmt

Publish

  1. Bump the version number in Cargo.toml and pyproject.toml.

  2. Create a new release on GitHub.

Owner

  • Name: International Centre for Neuromorphic Systems
  • Login: neuromorphicsystems
  • Kind: organization
  • Location: Sydney, Australia

GitHub Events

Total
  • Create event: 2
  • Issues event: 2
  • Release event: 2
  • Watch event: 11
  • Delete event: 1
  • Issue comment event: 4
  • Push event: 8
  • Pull request event: 2
Last Year
  • Create event: 2
  • Issues event: 2
  • Release event: 2
  • Watch event: 11
  • Delete event: 1
  • Issue comment event: 4
  • Push event: 8
  • Pull request event: 2

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 41
  • Total Committers: 1
  • Avg Commits per committer: 41.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 18
  • Committers: 1
  • Avg Commits per committer: 18.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Alexandre Marcireau a****u@g****m 41

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 14
  • Total pull requests: 6
  • Average time to close issues: 2 months
  • Average time to close pull requests: 22 days
  • Total issue authors: 10
  • Total pull request authors: 3
  • Average comments per issue: 2.07
  • Average comments per pull request: 1.33
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 months
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 3.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • biphasic (4)
  • Tobias-Fischer (2)
  • GEN418 (1)
  • tonygallen (1)
  • Zizzzzzzz (1)
  • russelljjarvis (1)
  • fanpeng-kong (1)
  • zhang-pengyu (1)
  • yanxiang-wang (1)
  • ac-freeman (1)
Pull Request Authors
  • Tobias-Fischer (3)
  • aMarcireau (2)
  • ac-freeman (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 3,357 last-month
  • Total dependent packages: 2
    (may contain duplicates)
  • Total dependent repositories: 3
    (may contain duplicates)
  • Total versions: 16
  • Total maintainers: 1
pypi.org: aedat

A fast AEDAT4 decoder with an underlying Rust implementation

  • Versions: 11
  • Dependent Packages: 1
  • Dependent Repositories: 3
  • Downloads: 3,357 Last month
Rankings
Downloads: 5.6%
Average: 8.2%
Dependent repos count: 9.0%
Dependent packages count: 10.1%
Maintainers (1)
Last synced: 11 months ago
conda-forge.org: aedat
  • Versions: 5
  • Dependent Packages: 1
  • Dependent Repositories: 0
Rankings
Dependent packages count: 28.8%
Dependent repos count: 34.0%
Average: 39.2%
Stargazers count: 46.3%
Forks count: 47.7%
Last synced: 11 months ago

Dependencies

Cargo.lock cargo
  • autocfg 1.0.1
  • bitflags 1.3.2
  • cc 1.0.71
  • cfg-if 0.1.10
  • cfg-if 1.0.0
  • flatbuffers 2.0.0
  • indoc 0.3.6
  • indoc-impl 0.3.6
  • instant 0.1.12
  • jobserver 0.1.24
  • libc 0.2.105
  • lock_api 0.4.5
  • lz4 1.23.2
  • lz4-sys 1.9.2
  • matrixmultiply 0.3.1
  • ndarray 0.15.3
  • num-complex 0.4.0
  • num-integer 0.1.44
  • num-traits 0.2.14
  • numpy 0.14.1
  • once_cell 1.8.0
  • parking_lot 0.11.2
  • parking_lot_core 0.8.5
  • paste 0.1.18
  • paste-impl 0.1.18
  • proc-macro-hack 0.5.19
  • proc-macro2 1.0.30
  • pyo3 0.14.5
  • pyo3-build-config 0.14.5
  • pyo3-macros 0.14.5
  • pyo3-macros-backend 0.14.5
  • quote 1.0.10
  • rawpointer 0.2.1
  • redox_syscall 0.2.10
  • roxmltree 0.14.1
  • scopeguard 1.1.0
  • smallvec 1.7.0
  • syn 1.0.80
  • thiserror 1.0.30
  • thiserror-impl 1.0.30
  • unicode-xid 0.2.2
  • unindent 0.1.7
  • winapi 0.3.9
  • winapi-i686-pc-windows-gnu 0.4.0
  • winapi-x86_64-pc-windows-gnu 0.4.0
  • xmlparser 0.13.3
  • zstd 0.9.0+zstd.1.5.0
  • zstd-safe 4.1.1+zstd.1.5.0
  • zstd-sys 1.6.1+zstd.1.5.0
.github/workflows/build_wheels.yml actions
  • actions-rs/toolchain v1 composite
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/upload-artifact v3 composite
  • pypa/cibuildwheel v2.11.2 composite
  • pypa/gh-action-pypi-publish v1.5.0 composite