https://github.com/neuromorphs/tonic
Event datasets and transforms.
https://github.com/neuromorphs/tonic
augmentation datasets event-based neuromorphic spikes transformations
Last synced: 5 months ago
JSON representation
Event datasets and transforms.
- Host: GitHub
- URL: https://github.com/neuromorphs/tonic
- Owner: neuromorphs
- License: gpl-3.0
- Created: 2019-07-11T22:28:33.000Z (about 6 years ago)
- Default Branch: develop
- Last Pushed: 2025-04-24T19:54:28.000Z (5 months ago)
- Last Synced: 2025-04-24T20:42:47.477Z (5 months ago)
- Topics: augmentation, datasets, event-based, neuromorphic, spikes, transformations
- Language: Python
- Homepage: https://tonic.readthedocs.io
- Size: 5.09 MB
- Stars: 237
- Watchers: 15
- Forks: 48
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README

[](https://pypi.org/project/tonic/)
[](https://codecov.io/gh/neuromorphs/tonic)
[](https://tonic.readthedocs.io/en/latest/?badge=latest)
[](https://github.com/neuromorphs/tonic/pulse)
[](https://mybinder.org/v2/gh/neuromorphs/tonic/main?labpath=docs%2Ftutorials)
[](https://doi.org/10.5281/zenodo.5079802)
[](https://discord.gg/qubbM4uPuA)**This project is looking for a new maintainer. Reach out to Gregor if you're interested!**
**Tonic** is a tool to facilitate the download, manipulation and loading of event-based/spike-based data. It's like PyTorch Vision but for neuromorphic data!
## Documentation
You can find the full documentation on Tonic [on this site](https://tonic.readthedocs.io/en/latest/index.html).* [A first example](https://tonic.readthedocs.io/en/latest/getting_started/nmnist.html) to get a feeling for how Tonic works.
* [Run tutorials in your browser](https://mybinder.org/v2/gh/neuromorphs/tonic/main?labpath=docs%2Ftutorials) quick and easy.
* [List of datasets](https://tonic.readthedocs.io/en/main/datasets.html).
* [List of transformations](https://tonic.readthedocs.io/en/main/auto_examples/index.html).
* [About](https://tonic.readthedocs.io/en/latest/about/info.html) this project.
* [Release notes](https://tonic.readthedocs.io/en/latest/about/release_notes.html) on version changes.## Install
```bash
pip install tonic
```
or (thanks to [@Tobias-Fischer](https://github.com/Tobias-Fischer))
```
conda install -c conda-forge tonic
```
For the latest pre-release on the develop branch that passed the tests:
```
pip install tonic --pre
```
This package has been tested on:| Linux | [](https://github.com/neuromorphs/tonic)|
|----------|-------------------------------------------------------------------------------------------------------------------------------------------|
| **Windows** | [](https://github.com/neuromorphs/tonic) |## Quickstart
If you're looking for a minimal example to run, this is it!```python
import tonic
import tonic.transforms as transformssensor_size = tonic.datasets.NMNIST.sensor_size
transform = transforms.Compose(
[
transforms.Denoise(filter_time=10000),
transforms.ToFrame(sensor_size=sensor_size, time_window=3000),
]
)testset = tonic.datasets.NMNIST(save_to="./data", train=False, transform=transform)
from torch.utils.data import DataLoader
testloader = DataLoader(
testset,
batch_size=10,
collate_fn=tonic.collation.PadTensors(batch_first=True),
)frames, targets = next(iter(testloader))
```## Discussion and questions
Have a question about how something works? Ideas for improvement? Feature request? Please get in touch on the #tonic [Discord channel](https://discord.gg/V6FHBZURkg)
or alternatively here on GitHub via the [Discussions](https://github.com/neuromorphs/tonic/discussions) page!## Contributing
Please check out the [contributions](https://tonic.readthedocs.io/en/latest/about/contribute.html) page for details.## Sponsoring
The development of this library is supported by## Citation
If you find this package helpful, please consider citing it:```BibTex
@software{lenz_gregor_2021_5079802,
author = {Lenz, Gregor and
Chaney, Kenneth and
Shrestha, Sumit Bam and
Oubari, Omar and
Picaud, Serge and
Zarrella, Guido},
title = {Tonic: event-based datasets and transformations.},
month = jul,
year = 2021,
note = {{Documentation available under
https://tonic.readthedocs.io}},
publisher = {Zenodo},
version = {0.4.0},
doi = {10.5281/zenodo.5079802},
url = {https://doi.org/10.5281/zenodo.5079802}
}
```