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.
bash
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:
| Linux | |
|----------|-------------------------------------------------------------------------------------------------------------------------------------------|
| Windows |
|
If you're looking for a minimal example to run, this is it!
```python import tonic import tonic.transforms as transforms
sensor_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)) ```
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.
The development of this library is supported by
I have used 'tonic.dataset.SSC(download_dir, split='train',transform=transform)' to get the full dataset of SSC dataset, and it contains 35 classes. However. I only want to train some classes, such as [0,1,2,3,4,5,6]. How could I get the subdataset qucikly, I have tried it using the for loop method, but it seems a little stupid. What should I do? Hope for your reply
this line is the culprit https://github.com/neuromorphs/tonic/blob/develop/tonic/functional/to_frame.py#L61
This was introduced to make sure that in the case of audio samples all polarities have values 0 instead of 1. We need to introduce a check that raises a warning if there are more than 1 polarities present in the data
Images can be loaded super fast. When training CNNs on binned frames, this could speed up things even more. This obviously won't work with rasters
The dataset is available here. expelliarmus has to be used to read the binary data and the TorchData API (see #201) to create the dataset class.
See #201.
List of datasets to be ported: - [x] NMNIST. - [x] STMNIST. - [x] NCARS. - [ ] ASLDVS. - [ ] CIFAR10-DVS. - [ ] DVGGesture. - [ ] NCALTECH101. - [ ] POKERDVS. - [ ] SMNIST. - [ ] DVSLip. - [ ] SHD. - [ ] SSC. - [ ] DAVISDATA. - [ ] DSEC. - [ ] MVSEC. - [ ] TUMVIE. - [ ] VPR.
https://star-datasets.github.io/vector/
transforms
parameter for most datasets, in addition to transform
and target_transform
. This allows a user to pass a transform that will be called on data and targets at the same time.CenterCrop
transform for events, similar to what the frame-based equivalent does.event-based datasets neuromorphic augmentation spikes transformations