Skip to main content

Neuromorphic datasets and transformations.

Project description

tonic PyPI codecov Documentation Status contributors Binder DOI Discord

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!


You can find the full documentation on Tonic on this site.


pip install tonic

or (thanks to @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:



If you're looking for a minimal example to run, this is it!

import tonic
import tonic.transforms as transforms

sensor_size = tonic.datasets.NMNIST.sensor_size
transform = transforms.Compose(
        transforms.ToFrame(sensor_size=sensor_size, time_window=3000),

testset = tonic.datasets.NMNIST(save_to="./data", train=False, transform=transform)

from import DataLoader

testloader = DataLoader(

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 or alternatively here on GitHub via the Discussions page!


Please check out the contributions page for details.


If you find this package helpful, please consider citing it:

  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 
  publisher    = {Zenodo},
  version      = {0.4.0},
  doi          = {10.5281/zenodo.5079802},
  url          = {}

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

tonic-1.1.2.tar.gz (1.6 MB view hashes)

Uploaded source

Built Distribution

tonic-1.1.2-py3-none-any.whl (88.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page