Metadata-Version: 2.1
Name: evutils
Version: 0.3.0
Summary: Utilities for event-based vision
Keywords: events,dvs,neuromorphic,vision,event-based
Author-Email: Jakub Mandula <jakub.mandula@pbl.ee.ethz.ch>
License: Copyright (c) 2024 Jakub Mandula
         
         Permission is hereby granted, free of charge, to any person obtaining a copy
         of this software and associated documentation files (the "Software"), to deal
         in the Software without restriction, including without limitation the rights
         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         copies of the Software, and to permit persons to whom the Software is
         furnished to do so, subject to the following conditions:
         
         The above copyright notice and this permission notice shall be included in all
         copies or substantial portions of the Software.
         
         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         SOFTWARE.
Requires-Python: >=3.10
Requires-Dist: numpy>=2.0.0
Requires-Dist: tqdm>=4.41
Requires-Dist: matplotlib>=3.1
Requires-Dist: opencv-python>=4.2
Requires-Dist: numba>=0.57
Requires-Dist: scipy>=1.15.3
Requires-Dist: pandas>=2.3.3
Provides-Extra: torch
Requires-Dist: torch>=2.0; extra == "torch"
Provides-Extra: hdf5
Requires-Dist: hdf5plugin==6.0.0; extra == "hdf5"
Requires-Dist: h5py==3.16.0; extra == "hdf5"
Provides-Extra: test
Requires-Dist: pytest>=9.0.2; extra == "test"
Provides-Extra: docs
Requires-Dist: sphinx>=8.0.0; extra == "docs"
Requires-Dist: sphinx-autoapi>=3.6.1; extra == "docs"
Requires-Dist: sphinx-autodoc-typehints>=3.0.1; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=3.1.0; extra == "docs"
Requires-Dist: sphinx_book_theme>=1.0.0; extra == "docs"
Requires-Dist: pydata_sphinx_theme>=0.19.0; extra == "docs"
Requires-Dist: myst-parser>=4.0.0; extra == "docs"
Provides-Extra: dev
Requires-Dist: evutils[docs,hdf5,test,torch]; extra == "dev"
Description-Content-Type: text/markdown

EV Utils
========

EV-utils is a collection of utilities for working event based data inspired by the [event_utils](https://github.com/TimoStoff/event_utils) library. This library aims at being camera independent (yet also supporting specific camera vendors) with minimal dependencies but also performent. The library is divided into severla modules some of which can be used without installing all the dependencies. These include:

```
└── augment - Event augmentations
└── dataset - Wrappers for various dataset loaders
└── events 
└── io
    ├── reader 
    └── writer
└── random
└── torch
└── types
└── vis
    ├── histogram
    └── reconstructor
```


## Installation

### From Git
```bash
git clone --recurse-submodules git@git.ee.ethz.ch:pbl/research/event-camera/evutils.git

cd evutils
pip install . 
pip install -e . # Use this to install an editable version of the package
```

## Quick API overview 

### `augment`

Event augmentations

### `dataset`

Wrappers for various dataset loaders

### `io`

The `io` module provides methods for reading and writing events into various event formats. It provides a simple `.read()` and `.write()` interface as well as more advanced interfaces using iterators and slicing.

```python
from evutils.io.reader import EventReader_RAW


ev_file = EventReader_RAW("raw_file.raw", delta_t=10e3)

events = ev_file.read()

```

### `utils`

Various utility functions

### `random`

Generating random events and adding noise to event recordings

### `types`

This provides several standard types for representing Events in numpy arrays


### `vis`

The `vis` moduels provides several methods for visualizing the events (for example as histograms), but also provides a streamlined interface for more complex visualization techneques, such as using the [E2Vid](https://github.com/uzh-rpg/rpg_e2vid) reconstructor.

You need to download the pretrained weights:
```bash
wget "http://rpg.ifi.uzh.ch/data/E2VID/models/E2VID_lightweight.pth.tar" -O models/E2VID_lightweight.pth.tar
```


```python
from evutils.vis.reconstructor import RPG_Reconstructor

reconstructor = RPG_Reconstructor(1280, 720)

img = reconstructor.gen_frame(events)

```

## Running tests

You can run tests on using the pytest utility:
```bash
pytest -s
```


## Acknowledgements

Thanks to all the contributors for supporting this project:

* Elia Franc
* Jakub Mandula
