tonic 1.5.1.dev18__tar.gz → 1.5.1.dev20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/.binder/requirements.txt +0 -1
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/ChangeLog +2 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/PKG-INFO +1 -1
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/about/about.rst +0 -1
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/datasets.rst +0 -14
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/torch_requirements.txt +0 -1
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/__init__.py +0 -5
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic.egg-info/PKG-INFO +1 -1
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic.egg-info/SOURCES.txt +1 -15
- tonic-1.5.1.dev20/tonic.egg-info/pbr.json +1 -0
- tonic-1.5.1.dev18/docs/about/prototype.rst +0 -6
- tonic-1.5.1.dev18/test/prototype_dataset_utils.py +0 -86
- tonic-1.5.1.dev18/test/test_prototype_datasets.py +0 -300
- tonic-1.5.1.dev18/tonic/prototype/README.md +0 -129
- tonic-1.5.1.dev18/tonic/prototype/__init__.py +0 -1
- tonic-1.5.1.dev18/tonic/prototype/datasets/__init__.py +0 -19
- tonic-1.5.1.dev18/tonic/prototype/datasets/ncars.py +0 -100
- tonic-1.5.1.dev18/tonic/prototype/datasets/nmnist.py +0 -151
- tonic-1.5.1.dev18/tonic/prototype/datasets/prophesee.py +0 -338
- tonic-1.5.1.dev18/tonic/prototype/datasets/stmnist.py +0 -134
- tonic-1.5.1.dev18/tonic/prototype/datasets/utils/__init__.py +0 -0
- tonic-1.5.1.dev18/tonic/prototype/datasets/utils/_dataset.py +0 -63
- tonic-1.5.1.dev18/tonic/prototype/datasets/utils/_utils.py +0 -31
- tonic-1.5.1.dev18/tonic/prototype/slicers.py +0 -89
- tonic-1.5.1.dev18/tonic.egg-info/pbr.json +0 -1
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/.coveragerc +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/.github/workflows/ci-pipeline.yml +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/.pre-commit-config.yaml +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/.readthedocs.yml +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/AUTHORS +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/LICENSE.txt +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/MANIFEST.in +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/README.md +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/Makefile +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_static/event-cameras/eventstream.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_static/event-cameras/framestream.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_static/event-cameras/receptive-fields.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_static/event-cameras/sampling-theorems.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_static/snn/neuron-models.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_static/snn/surrogates.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_static/tonic-logo-black-bg.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_static/tonic-logo-black.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_static/tonic-logo-white.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_static/tonic_favicon.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_templates/class_dataset.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/_templates/class_transform.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/about/info.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/about/release_notes.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/conf.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/README.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/representations/README.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/representations/plot_tobinarep.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/representations/plot_toframe.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/representations/plot_toimage.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/representations/plot_totimesurface.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/representations/plot_tovoxelgrid.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/README.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_centercrop.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_crop_time.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_decimation.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_denoise.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_downsample.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_drop_event.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_drop_event_by_area.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_drop_event_by_time.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_drop_pixel.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_event_downsampling.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_merge_polarities.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_random_crop.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_random_flip_lr.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_random_flip_ud.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_random_time_reversal.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_refractory_period.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_spatial_jitter.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_time_jitter.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_uniform_noise.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/getting_involved/communication_channels.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/getting_involved/contribute.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/getting_involved/getting_involved.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/getting_started/getting_started.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/getting_started/install.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/getting_started/nmnist.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/how-tos/how-tos.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/how-tos/loading-raw-events.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/how-tos/visualizing-data.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/how-tos/wrapping_own_data.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/index.md +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/make.bat +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/reading_material/design_choices.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/reading_material/intro-event-cameras.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/reading_material/intro-snns.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/reading_material/reading_material.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/reading_material/training-snns.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/requirements.txt +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/transformations.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/tutorials/Aug_DiskCachDataset.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/tutorials/audio_transforms_tutorial.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/tutorials/batching.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/tutorials/davis_data.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/tutorials/fast_dataloading.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/tutorials/large_datasets.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/tutorials/slicing.ipynb +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/docs/tutorials/tutorials.rst +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/requirements.txt +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/setup.cfg +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/setup.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/dataset_utils.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/requirements.txt +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_audio_augmentations.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_audio_transforms.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_aug_caching.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_caching.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_chained_transforms.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_data/sample.aedat4 +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_data/sample_aedat_header.aedat +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_data/sample_ncars.dat +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_data/sample_nmnist.bin +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_data/sample_stmnist.mat +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_datasets.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_dsec.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_io.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_representations.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_sliced_dataset.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_slicers.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_tonic_utils.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/test_transforms.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/test/utils.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/audio_augmentations.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/audio_transforms.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/cached_dataset.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/collation.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/dataset.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/__init__.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/asl_dvs.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/cifar10dvs.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/davisdataset.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/dsec.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/dvs_lips.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/dvsgesture.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/ebssa.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/hsd.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/mvsec.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/ncaltech101.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/nmnist.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/ntidigits18.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/pokerdvs.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/s_mnist.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/threeET_eyetracking.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/tum_vie.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/datasets/visual_place_recognition.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/download_utils.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/__init__.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/crop.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/decimate.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/denoise.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/drop_event.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/drop_pixel.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/event_downsampling.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/refractory_period.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/spatial_jitter.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/time_jitter.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/time_skew.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/to_averaged_timesurface.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/to_bina_rep.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/to_frame.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/to_timesurface.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/to_voxel_grid.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/functional/uniform_noise.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/io.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/sliced_dataset.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/slicers.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/transforms.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic/utils.py +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic-logo-padded.png +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic.egg-info/dependency_links.txt +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic.egg-info/not-zip-safe +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic.egg-info/requires.txt +0 -0
- {tonic-1.5.1.dev18 → tonic-1.5.1.dev20}/tonic.egg-info/top_level.txt +0 -0
|
@@ -61,17 +61,3 @@ Eye tracking
|
|
|
61
61
|
:template: class_dataset.rst
|
|
62
62
|
|
|
63
63
|
ThreeET_Eyetracking
|
|
64
|
-
|
|
65
|
-
.. currentmodule:: tonic.prototype.datasets
|
|
66
|
-
|
|
67
|
-
Prototype iterable datasets
|
|
68
|
-
---------------------------
|
|
69
|
-
.. autosummary::
|
|
70
|
-
:toctree: generated/
|
|
71
|
-
:template: class_dataset.rst
|
|
72
|
-
|
|
73
|
-
NMNIST
|
|
74
|
-
NCARS
|
|
75
|
-
STMNIST
|
|
76
|
-
Gen1AutomotiveDetection
|
|
77
|
-
Gen4AutomotiveDetectionMini
|
|
@@ -10,10 +10,5 @@ from .cached_dataset import (
|
|
|
10
10
|
from .dataset import Dataset
|
|
11
11
|
from .sliced_dataset import SlicedDataset
|
|
12
12
|
|
|
13
|
-
try:
|
|
14
|
-
from . import prototype
|
|
15
|
-
except (ImportError, NameError):
|
|
16
|
-
pass
|
|
17
|
-
|
|
18
13
|
all = "__version__"
|
|
19
14
|
__version__ = VersionInfo("tonic").release_string()
|
|
@@ -33,7 +33,6 @@ docs/_templates/class_dataset.rst
|
|
|
33
33
|
docs/_templates/class_transform.rst
|
|
34
34
|
docs/about/about.rst
|
|
35
35
|
docs/about/info.rst
|
|
36
|
-
docs/about/prototype.rst
|
|
37
36
|
docs/about/release_notes.rst
|
|
38
37
|
docs/gallery/README.rst
|
|
39
38
|
docs/gallery/representations/README.rst
|
|
@@ -86,7 +85,6 @@ docs/tutorials/large_datasets.ipynb
|
|
|
86
85
|
docs/tutorials/slicing.ipynb
|
|
87
86
|
docs/tutorials/tutorials.rst
|
|
88
87
|
test/dataset_utils.py
|
|
89
|
-
test/prototype_dataset_utils.py
|
|
90
88
|
test/requirements.txt
|
|
91
89
|
test/test_audio_augmentations.py
|
|
92
90
|
test/test_audio_transforms.py
|
|
@@ -96,7 +94,6 @@ test/test_chained_transforms.py
|
|
|
96
94
|
test/test_datasets.py
|
|
97
95
|
test/test_dsec.py
|
|
98
96
|
test/test_io.py
|
|
99
|
-
test/test_prototype_datasets.py
|
|
100
97
|
test/test_representations.py
|
|
101
98
|
test/test_sliced_dataset.py
|
|
102
99
|
test/test_slicers.py
|
|
@@ -162,15 +159,4 @@ tonic/functional/to_bina_rep.py
|
|
|
162
159
|
tonic/functional/to_frame.py
|
|
163
160
|
tonic/functional/to_timesurface.py
|
|
164
161
|
tonic/functional/to_voxel_grid.py
|
|
165
|
-
tonic/functional/uniform_noise.py
|
|
166
|
-
tonic/prototype/README.md
|
|
167
|
-
tonic/prototype/__init__.py
|
|
168
|
-
tonic/prototype/slicers.py
|
|
169
|
-
tonic/prototype/datasets/__init__.py
|
|
170
|
-
tonic/prototype/datasets/ncars.py
|
|
171
|
-
tonic/prototype/datasets/nmnist.py
|
|
172
|
-
tonic/prototype/datasets/prophesee.py
|
|
173
|
-
tonic/prototype/datasets/stmnist.py
|
|
174
|
-
tonic/prototype/datasets/utils/__init__.py
|
|
175
|
-
tonic/prototype/datasets/utils/_dataset.py
|
|
176
|
-
tonic/prototype/datasets/utils/_utils.py
|
|
162
|
+
tonic/functional/uniform_noise.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "3a8e1e2", "is_release": false}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
Prototype Tonic v2
|
|
2
|
-
==================
|
|
3
|
-
|
|
4
|
-
Lately torchvision is making efforts to change its datasets to a new format of iterable datasets. That means that the size of a dataset is not necessarily fixed upfront and samples can be streamed individually. As the sizes of datasets grow, it becomes infeasible to keep all samples in memory, sometimes even the list of file paths to all samples. This also quickly is becoming a problem for event-based data, as with increasing spatial sizes of event cameras the amount of events per second increases drastically.
|
|
5
|
-
|
|
6
|
-
To address this issue, PyTorch created a new package `torchdata <https://pytorch.org/data/main/index.html>`_ which focuses on separating transformation logic (such as augementations) from loading functionality (batching / multithreading). Tonic will also take advantage of these newest developments and will preferrably implement new datasets in the new iterable style.
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import shutil
|
|
3
|
-
import unittest
|
|
4
|
-
from typing import Any, Dict, Union
|
|
5
|
-
from unittest.mock import patch
|
|
6
|
-
|
|
7
|
-
import numpy as np
|
|
8
|
-
|
|
9
|
-
# On Unix it yields "/tmp", on Findus "C:\\tmp".
|
|
10
|
-
# Actually, on Windows the temporary folder is in C:\\Users\<username>\AppData\Local\Temp (or C:\\System32\Temp, I do not remember). I do not know how to solve this.
|
|
11
|
-
TMP_DIR = os.path.join(os.path.abspath(os.sep), "tmp")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class DatasetTestCase(unittest.TestCase):
|
|
15
|
-
DATASET_CLASS = None
|
|
16
|
-
FEATURE_TYPES = None
|
|
17
|
-
|
|
18
|
-
_CHECK_FUNCTIONS = {"check_exists"}
|
|
19
|
-
_DOWNLOAD_EXTRACT_FUNCTIONS = {}
|
|
20
|
-
|
|
21
|
-
def inject_fake_data(
|
|
22
|
-
self, tmpdir: str, config: Dict[str, Any]
|
|
23
|
-
) -> Union[int, Dict[str, Any]]:
|
|
24
|
-
"""Inject fake data for dataset into a temporary directory.
|
|
25
|
-
|
|
26
|
-
During the creation of the dataset the download and extract logic is disabled. Thus, the fake data injected
|
|
27
|
-
here needs to resemble the raw data, i.e. the state of the dataset directly after the files are downloaded and
|
|
28
|
-
potentially extracted.
|
|
29
|
-
Args:
|
|
30
|
-
tmpdir (str): Path to a temporary directory. For most cases this acts as root directory for the dataset
|
|
31
|
-
to be created and in turn also for the fake data injected here.
|
|
32
|
-
config (Dict[str, Any]): Configuration that will be passed to the dataset constructor. It provides at least
|
|
33
|
-
fields for all dataset parameters with default values.
|
|
34
|
-
Needs to return one of the following:
|
|
35
|
-
1. (int): Number of examples in the dataset to be created, or
|
|
36
|
-
2. (Dict[str, Any]): Additional information about the injected fake data. Must contain the field
|
|
37
|
-
``"num_examples"`` that corresponds to the number of examples in the dataset to be created.
|
|
38
|
-
"""
|
|
39
|
-
raise NotImplementedError(
|
|
40
|
-
"You need to provide fake data in order for the tests to run."
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
def create_dataset(self, inject_fake_data: bool = True, **kwargs: Any):
|
|
44
|
-
self.inject_fake_data(TMP_DIR)
|
|
45
|
-
|
|
46
|
-
if inject_fake_data:
|
|
47
|
-
with patch.object(self.DATASET_CLASS, "_check_exists", return_value=True):
|
|
48
|
-
dataset = self.DATASET_CLASS(**self.KWARGS)
|
|
49
|
-
else:
|
|
50
|
-
dataset = self.DATASET_CLASS(**self.KWARGS)
|
|
51
|
-
return dataset
|
|
52
|
-
|
|
53
|
-
def _patch_checks(self):
|
|
54
|
-
return {
|
|
55
|
-
patch.object(self.DATASET_CLASS, function, return_value=True)
|
|
56
|
-
for function in self._CHECK_FUNCTIONS
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
# def test_download_started(self):
|
|
60
|
-
# with pytest.raises((FileNotFoundError, RuntimeError)):
|
|
61
|
-
# dataset, info = self.create_dataset(inject_fake_data=False)
|
|
62
|
-
|
|
63
|
-
def test_feature_types(self):
|
|
64
|
-
dataset = self.create_dataset()
|
|
65
|
-
data, target = next(iter(dataset))
|
|
66
|
-
|
|
67
|
-
if type(data) != tuple:
|
|
68
|
-
data = (data,)
|
|
69
|
-
if type(target) != tuple:
|
|
70
|
-
target = (target,)
|
|
71
|
-
assert len(data) == len(self.FEATURE_TYPES)
|
|
72
|
-
assert len(target) == len(self.TARGET_TYPES)
|
|
73
|
-
|
|
74
|
-
for (data_piece, feature_type) in zip(data, self.FEATURE_TYPES):
|
|
75
|
-
if type(data_piece) == np.ndarray:
|
|
76
|
-
assert data_piece.dtype == feature_type
|
|
77
|
-
else:
|
|
78
|
-
assert type(data_piece) == feature_type
|
|
79
|
-
|
|
80
|
-
@classmethod
|
|
81
|
-
def setUpClass(cls):
|
|
82
|
-
cls.KWARGS.update({"root": TMP_DIR})
|
|
83
|
-
shutil.rmtree(
|
|
84
|
-
os.path.join(TMP_DIR, cls.DATASET_CLASS.__name__), ignore_errors=True
|
|
85
|
-
)
|
|
86
|
-
super().setUpClass()
|
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
import shutil
|
|
2
|
-
from pathlib import Path
|
|
3
|
-
|
|
4
|
-
import numpy as np
|
|
5
|
-
import prototype_dataset_utils as dataset_utils
|
|
6
|
-
|
|
7
|
-
import tonic.prototype.datasets as datasets
|
|
8
|
-
|
|
9
|
-
PATH_TO_TEST_DATA = Path(".", "test", "test_data")
|
|
10
|
-
|
|
11
|
-
########
|
|
12
|
-
# NMNIST
|
|
13
|
-
########
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def create_nmnist_zip_archive(tmpdir: str, folder: str, filename: str):
|
|
17
|
-
"""This function recreates the same structure that we expect in the dataset:
|
|
18
|
-
|
|
19
|
-
[Train,Test]----! !---0/sample.bin !---1/sample.bin
|
|
20
|
-
!--- !---9/sample.bin
|
|
21
|
-
"""
|
|
22
|
-
filename = filename.split(".")[0] # Stripping the .zip extension.
|
|
23
|
-
folder_path = Path(tmpdir, "NMNIST", folder)
|
|
24
|
-
# We create a folder for each label.
|
|
25
|
-
for i in range(10):
|
|
26
|
-
destination_path = Path(folder_path, str(i))
|
|
27
|
-
destination_path.mkdir(parents=True, exist_ok=True)
|
|
28
|
-
shutil.copyfile(
|
|
29
|
-
PATH_TO_TEST_DATA / "sample_nmnist.bin",
|
|
30
|
-
destination_path / "sample_nmnist.bin",
|
|
31
|
-
)
|
|
32
|
-
# We compress the archive.
|
|
33
|
-
shutil.make_archive(
|
|
34
|
-
base_name=Path(tmpdir, "NMNIST", filename),
|
|
35
|
-
format="zip",
|
|
36
|
-
root_dir=folder_path.parent,
|
|
37
|
-
base_dir=folder,
|
|
38
|
-
)
|
|
39
|
-
# We remove the folder previously created.
|
|
40
|
-
shutil.rmtree(folder_path)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class NMNISTTestCase_Train_Uncompressed_AllSaccades(dataset_utils.DatasetTestCase):
|
|
44
|
-
DATASET_CLASS = datasets.NMNIST
|
|
45
|
-
FEATURE_TYPES = (datasets.NMNIST._DTYPE,)
|
|
46
|
-
TARGET_TYPES = (int,)
|
|
47
|
-
KWARGS = {"train": True, "keep_compressed": False, "first_saccade_only": False}
|
|
48
|
-
|
|
49
|
-
def inject_fake_data(self, tmpdir):
|
|
50
|
-
create_nmnist_zip_archive(
|
|
51
|
-
tmpdir, datasets.NMNIST._TRAIN_FOLDER, datasets.NMNIST._TRAIN_FILENAME
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
class NMNISTTestCase_Train_Compressed_AllSaccades(dataset_utils.DatasetTestCase):
|
|
56
|
-
DATASET_CLASS = datasets.NMNIST
|
|
57
|
-
FEATURE_TYPES = (datasets.NMNIST._DTYPE,)
|
|
58
|
-
TARGET_TYPES = (int,)
|
|
59
|
-
KWARGS = {"train": True, "keep_compressed": True, "first_saccade_only": False}
|
|
60
|
-
|
|
61
|
-
def inject_fake_data(self, tmpdir):
|
|
62
|
-
create_nmnist_zip_archive(
|
|
63
|
-
tmpdir, datasets.NMNIST._TRAIN_FOLDER, datasets.NMNIST._TRAIN_FILENAME
|
|
64
|
-
)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
class NMNISTTestCase_Train_Uncompressed_FirstSaccade(dataset_utils.DatasetTestCase):
|
|
68
|
-
DATASET_CLASS = datasets.NMNIST
|
|
69
|
-
FEATURE_TYPES = (datasets.NMNIST._DTYPE,)
|
|
70
|
-
TARGET_TYPES = (int,)
|
|
71
|
-
KWARGS = {"train": True, "keep_compressed": False, "first_saccade_only": True}
|
|
72
|
-
|
|
73
|
-
def inject_fake_data(self, tmpdir):
|
|
74
|
-
create_nmnist_zip_archive(
|
|
75
|
-
tmpdir, datasets.NMNIST._TRAIN_FOLDER, datasets.NMNIST._TRAIN_FILENAME
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
class NMNISTTestCase_Test_Uncompressed_AllSaccades(dataset_utils.DatasetTestCase):
|
|
80
|
-
DATASET_CLASS = datasets.NMNIST
|
|
81
|
-
FEATURE_TYPES = (datasets.NMNIST._DTYPE,)
|
|
82
|
-
TARGET_TYPES = (int,)
|
|
83
|
-
KWARGS = {"train": False, "keep_compressed": False, "first_saccade_only": False}
|
|
84
|
-
|
|
85
|
-
def inject_fake_data(self, tmpdir):
|
|
86
|
-
create_nmnist_zip_archive(
|
|
87
|
-
tmpdir, datasets.NMNIST._TEST_FOLDER, datasets.NMNIST._TEST_FILENAME
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
class NMNISTTestCase_Test_Compressed_AllSaccades(dataset_utils.DatasetTestCase):
|
|
92
|
-
DATASET_CLASS = datasets.NMNIST
|
|
93
|
-
FEATURE_TYPES = (datasets.NMNIST._DTYPE,)
|
|
94
|
-
TARGET_TYPES = (int,)
|
|
95
|
-
KWARGS = {"train": False, "keep_compressed": True, "first_saccade_only": False}
|
|
96
|
-
|
|
97
|
-
def inject_fake_data(self, tmpdir):
|
|
98
|
-
create_nmnist_zip_archive(
|
|
99
|
-
tmpdir, datasets.NMNIST._TEST_FOLDER, datasets.NMNIST._TEST_FILENAME
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
class NMNISTTestCase_Test_Uncompressed_FirstSaccade(dataset_utils.DatasetTestCase):
|
|
104
|
-
DATASET_CLASS = datasets.NMNIST
|
|
105
|
-
FEATURE_TYPES = (datasets.NMNIST._DTYPE,)
|
|
106
|
-
TARGET_TYPES = (int,)
|
|
107
|
-
KWARGS = {"train": False, "keep_compressed": False, "first_saccade_only": True}
|
|
108
|
-
|
|
109
|
-
def inject_fake_data(self, tmpdir):
|
|
110
|
-
create_nmnist_zip_archive(
|
|
111
|
-
tmpdir, datasets.NMNIST._TEST_FOLDER, datasets.NMNIST._TEST_FILENAME
|
|
112
|
-
)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
##########
|
|
116
|
-
# STMNIST
|
|
117
|
-
##########
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
def create_stmnist_zip_archive(tmpdir: str, filename: str):
|
|
121
|
-
"""This function recreates the same structure that we expect in the dataset:
|
|
122
|
-
data_submission/----!
|
|
123
|
-
|
|
124
|
-
!---0/sample.mat !---1/sample.mat !--- !---9/sample.mat
|
|
125
|
-
"""
|
|
126
|
-
folder_path = Path(tmpdir, "STMNIST", "data_submission")
|
|
127
|
-
# We create a folder for each label.
|
|
128
|
-
for i in range(10):
|
|
129
|
-
destination_path = Path(folder_path, str(i))
|
|
130
|
-
destination_path.mkdir(parents=True, exist_ok=True)
|
|
131
|
-
shutil.copyfile(
|
|
132
|
-
PATH_TO_TEST_DATA / "sample_stmnist.mat",
|
|
133
|
-
destination_path / "sample_stmnist.mat",
|
|
134
|
-
)
|
|
135
|
-
# We compress the archive.
|
|
136
|
-
shutil.make_archive(
|
|
137
|
-
base_name=Path(tmpdir, "STMNIST", filename),
|
|
138
|
-
format="zip",
|
|
139
|
-
base_dir=folder_path,
|
|
140
|
-
root_dir=folder_path,
|
|
141
|
-
)
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
class STMNISTTestCase_Uncompressed(dataset_utils.DatasetTestCase):
|
|
145
|
-
DATASET_CLASS = datasets.STMNIST
|
|
146
|
-
FEATURE_TYPES = (datasets.STMNIST._DTYPE,)
|
|
147
|
-
TARGET_TYPES = (int,)
|
|
148
|
-
KWARGS = {"keep_compressed": False}
|
|
149
|
-
|
|
150
|
-
def inject_fake_data(self, tmpdir):
|
|
151
|
-
create_stmnist_zip_archive(tmpdir, datasets.STMNIST.__name__)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
class STMNISTTestCase_Compressed(dataset_utils.DatasetTestCase):
|
|
155
|
-
DATASET_CLASS = datasets.STMNIST
|
|
156
|
-
FEATURE_TYPES = (datasets.STMNIST._DTYPE,)
|
|
157
|
-
TARGET_TYPES = (int,)
|
|
158
|
-
KWARGS = {"keep_compressed": True}
|
|
159
|
-
|
|
160
|
-
def inject_fake_data(self, tmpdir):
|
|
161
|
-
create_stmnist_zip_archive(tmpdir, datasets.STMNIST.__name__)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
#######
|
|
165
|
-
# NCARS
|
|
166
|
-
#######
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
def create_ncars_folder(tmpdir, folder_name):
|
|
170
|
-
for label_folder_name in ("background", "cars"):
|
|
171
|
-
test_dir = Path(tmpdir, "NCARS", folder_name, label_folder_name)
|
|
172
|
-
test_dir.mkdir(parents=True, exist_ok=True)
|
|
173
|
-
shutil.copyfile(
|
|
174
|
-
PATH_TO_TEST_DATA / "sample_ncars.dat",
|
|
175
|
-
test_dir / "sample_ncars.dat",
|
|
176
|
-
)
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
class NCARSTestCase_Train(dataset_utils.DatasetTestCase):
|
|
180
|
-
DATASET_CLASS = datasets.NCARS
|
|
181
|
-
FEATURE_TYPES = (datasets.NCARS._DTYPE,)
|
|
182
|
-
TARGET_TYPES = (int,)
|
|
183
|
-
KWARGS = {"train": True}
|
|
184
|
-
|
|
185
|
-
def inject_fake_data(self, tmpdir):
|
|
186
|
-
create_ncars_folder(tmpdir, datasets.NCARS._TRAIN_PATH)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
class NCARSTestCase_Test(dataset_utils.DatasetTestCase):
|
|
190
|
-
DATASET_CLASS = datasets.NCARS
|
|
191
|
-
FEATURE_TYPES = (datasets.NCARS._DTYPE,)
|
|
192
|
-
TARGET_TYPES = (int,)
|
|
193
|
-
KWARGS = {"train": False}
|
|
194
|
-
|
|
195
|
-
def inject_fake_data(self, tmpdir):
|
|
196
|
-
create_ncars_folder(tmpdir, datasets.NCARS._TEST_PATH)
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
#############################
|
|
200
|
-
# Gen4AutomotiveDetectionMini
|
|
201
|
-
#############################
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
def create_minidataset_folder(tmpdir, split_folder):
|
|
205
|
-
testfolder = Path(
|
|
206
|
-
tmpdir, "Gen4AutomotiveDetectionMini", "mini_dataset", split_folder
|
|
207
|
-
)
|
|
208
|
-
testfolder.mkdir(parents=True, exist_ok=True)
|
|
209
|
-
shutil.copyfile(
|
|
210
|
-
PATH_TO_TEST_DATA / "sample_ncars.dat",
|
|
211
|
-
Path(testfolder, "moorea_2019-02-19_004_td_610500000_670500000_td.dat"),
|
|
212
|
-
)
|
|
213
|
-
label = np.array([0.4, 0.2, 0.1, 0.1])
|
|
214
|
-
np.save(testfolder / "moorea_2019-02-19_004_td_610500000_670500000_bbox.npy", label)
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
class Gen4AutomotiveDetectionMiniTestCase_Train(dataset_utils.DatasetTestCase):
|
|
218
|
-
DATASET_CLASS = datasets.Gen4AutomotiveDetectionMini
|
|
219
|
-
FEATURE_TYPES = (datasets.Gen4AutomotiveDetectionMini._DTYPE,)
|
|
220
|
-
TARGET_TYPES = (np.array,)
|
|
221
|
-
KWARGS = {"split": "train"}
|
|
222
|
-
|
|
223
|
-
def inject_fake_data(self, tmpdir):
|
|
224
|
-
create_minidataset_folder(
|
|
225
|
-
tmpdir, datasets.Gen4AutomotiveDetectionMini._TRAIN_FOLDER
|
|
226
|
-
)
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
class Gen4AutomotiveDetectionMiniTestCase_Valid(dataset_utils.DatasetTestCase):
|
|
230
|
-
DATASET_CLASS = datasets.Gen4AutomotiveDetectionMini
|
|
231
|
-
FEATURE_TYPES = (datasets.Gen4AutomotiveDetectionMini._DTYPE,)
|
|
232
|
-
TARGET_TYPES = (np.array,)
|
|
233
|
-
KWARGS = {"split": "valid"}
|
|
234
|
-
|
|
235
|
-
def inject_fake_data(self, tmpdir):
|
|
236
|
-
create_minidataset_folder(
|
|
237
|
-
tmpdir, datasets.Gen4AutomotiveDetectionMini._VALID_FOLDER
|
|
238
|
-
)
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
class Gen4AutomotiveDetectionMiniTestCase_Test(dataset_utils.DatasetTestCase):
|
|
242
|
-
DATASET_CLASS = datasets.Gen4AutomotiveDetectionMini
|
|
243
|
-
FEATURE_TYPES = (datasets.Gen4AutomotiveDetectionMini._DTYPE,)
|
|
244
|
-
TARGET_TYPES = (np.array,)
|
|
245
|
-
KWARGS = {"split": "test"}
|
|
246
|
-
|
|
247
|
-
def inject_fake_data(self, tmpdir):
|
|
248
|
-
create_minidataset_folder(
|
|
249
|
-
tmpdir, datasets.Gen4AutomotiveDetectionMini._TEST_FOLDER
|
|
250
|
-
)
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
#########################
|
|
254
|
-
# Gen1AutomotiveDetection
|
|
255
|
-
#########################
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
def create_gen1dataset_folder(tmpdir, split_folder):
|
|
259
|
-
testfolder = Path(tmpdir, "detection_dataset_duration_60s_ratio_1.0", split_folder)
|
|
260
|
-
testfolder.mkdir(parents=True, exist_ok=True)
|
|
261
|
-
shutil.copyfile(
|
|
262
|
-
PATH_TO_TEST_DATA / "sample_ncars.dat",
|
|
263
|
-
Path(testfolder, "moorea_2019-02-19_004_td_610500000_670500000_td.dat"),
|
|
264
|
-
)
|
|
265
|
-
label = np.array([0.4, 0.2, 0.1, 0.1])
|
|
266
|
-
np.save(testfolder / "moorea_2019-02-19_004_td_610500000_670500000_bbox.npy", label)
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
class Gen1AutomotiveDetectionTestCase_Train(dataset_utils.DatasetTestCase):
|
|
270
|
-
DATASET_CLASS = datasets.Gen1AutomotiveDetection
|
|
271
|
-
FEATURE_TYPES = (datasets.Gen1AutomotiveDetection._DTYPE,)
|
|
272
|
-
TARGET_TYPES = (np.array,)
|
|
273
|
-
KWARGS = {"split": "train"}
|
|
274
|
-
|
|
275
|
-
def inject_fake_data(self, tmpdir):
|
|
276
|
-
create_gen1dataset_folder(
|
|
277
|
-
tmpdir, datasets.Gen1AutomotiveDetection._TRAIN_FOLDER
|
|
278
|
-
)
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
class Gen1AutomotiveDetectionTestCase_Valid(dataset_utils.DatasetTestCase):
|
|
282
|
-
DATASET_CLASS = datasets.Gen1AutomotiveDetection
|
|
283
|
-
FEATURE_TYPES = (datasets.Gen1AutomotiveDetection._DTYPE,)
|
|
284
|
-
TARGET_TYPES = (np.array,)
|
|
285
|
-
KWARGS = {"split": "valid"}
|
|
286
|
-
|
|
287
|
-
def inject_fake_data(self, tmpdir):
|
|
288
|
-
create_gen1dataset_folder(
|
|
289
|
-
tmpdir, datasets.Gen1AutomotiveDetection._VALID_FOLDER
|
|
290
|
-
)
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
class Gen1AutomotiveDetectionTestCase_Test(dataset_utils.DatasetTestCase):
|
|
294
|
-
DATASET_CLASS = datasets.Gen1AutomotiveDetection
|
|
295
|
-
FEATURE_TYPES = (datasets.Gen1AutomotiveDetection._DTYPE,)
|
|
296
|
-
TARGET_TYPES = (np.array,)
|
|
297
|
-
KWARGS = {"split": "test"}
|
|
298
|
-
|
|
299
|
-
def inject_fake_data(self, tmpdir):
|
|
300
|
-
create_gen1dataset_folder(tmpdir, datasets.Gen1AutomotiveDetection._TEST_FOLDER)
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
# Prototype datasets with Torchdata data pipes
|
|
2
|
-
|
|
3
|
-
[Torchdata](https://pytorch.org/data/beta/index.html) is a prototype library from PyTorch of common modular data loading primitives for easily constructing flexible and performant data pipelines.
|
|
4
|
-
|
|
5
|
-
An iterable-style dataset is an instance of a subclass of `IterableDataset` that implements the `__iter__()` protocol, and represents an iterable over data samples. This type of datasets is particularly suitable for cases where random reads are expensive or even improbable, and where the batch size depends on the fetched data.
|
|
6
|
-
|
|
7
|
-
For example, such a dataset, when called `iter(datapipe)`, could return a stream of data reading from a database, a remote server, or even logs generated in real time.
|
|
8
|
-
|
|
9
|
-
Here's an usage example with NMNIST implemented using datapipes.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
```python
|
|
13
|
-
from tonic.prototype.datasets.nmnist import NMNIST
|
|
14
|
-
|
|
15
|
-
datapipe = NMNIST(root="./data")
|
|
16
|
-
events, target = next(iter(datapipe))
|
|
17
|
-
events, target
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
(array([(10, 30, 937, 1), (33, 20, 1030, 1), (12, 27, 1052, 1), ...,
|
|
24
|
-
( 7, 15, 302706, 1), (26, 11, 303852, 1), (11, 17, 305341, 1)],
|
|
25
|
-
dtype=[('x', '<i8'), ('y', '<i8'), ('t', '<i8'), ('p', '<i8')]),
|
|
26
|
-
0)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
The dataset is fully compatible with Tonic transforms when the `transform` argument is specified:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```python
|
|
34
|
-
from tonic.transforms import ToFrame
|
|
35
|
-
t = ToFrame(sensor_size=NMNIST.sensor_size, time_window=10000)
|
|
36
|
-
datapipe = NMNIST(root="./data", transform=t)
|
|
37
|
-
frames, target = next(iter(datapipe))
|
|
38
|
-
frames[0]
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
array([[[0, 0, 0, ..., 0, 0, 0],
|
|
45
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
46
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
47
|
-
...,
|
|
48
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
49
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
50
|
-
[0, 0, 0, ..., 0, 0, 0]],
|
|
51
|
-
|
|
52
|
-
[[0, 0, 0, ..., 0, 0, 0],
|
|
53
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
54
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
55
|
-
...,
|
|
56
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
57
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
58
|
-
[0, 0, 0, ..., 0, 0, 0]]], dtype=int16)
|
|
59
|
-
|
|
60
|
-
One can also apply transforms externally, by using the `Mapper` datapipe from torchdata. Using the `input_col` optional parameter, one can apply the transform to the events (`input_col=0`) or the target (`input_col=1`) or both, by using a transform that acts on the tuple and not specifying `input_col`. This is useful if you want to implement your transform with a simple function and apply it to the dataset.
|
|
61
|
-
|
|
62
|
-
```python
|
|
63
|
-
from torchdata.datapipes.iter import Mapper
|
|
64
|
-
datapipe = NMNIST(root="./data")
|
|
65
|
-
datapipe = Mapper(datapipe, t, input_col=0) # input_col=0 tells Mapper to apply the function t to the entry number 0 of the tuple.
|
|
66
|
-
frames, target = next(iter(datapipe))
|
|
67
|
-
frames[0]
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
array([[[0, 0, 0, ..., 0, 0, 0],
|
|
71
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
72
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
73
|
-
...,
|
|
74
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
75
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
76
|
-
[0, 0, 0, ..., 0, 0, 0]],
|
|
77
|
-
|
|
78
|
-
[[0, 0, 0, ..., 0, 0, 0],
|
|
79
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
80
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
81
|
-
...,
|
|
82
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
83
|
-
[0, 0, 0, ..., 0, 0, 0],
|
|
84
|
-
[0, 0, 0, ..., 0, 0, 0]]], dtype=int16)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
Torchdata provides also built-in batchers, which allow to load batches of structured NumPy arrays without transforming them to normal arrays. The iterator returns a list of tuples `(events, target)`.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
```python
|
|
91
|
-
datapipe = NMNIST(root="./data")
|
|
92
|
-
datapipe = datapipe.batch(batch_size=2)
|
|
93
|
-
batch = next(iter(datapipe))
|
|
94
|
-
batch
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
[(array([(10, 30, 937, 1), (33, 20, 1030, 1), (12, 27, 1052, 1), ...,
|
|
101
|
-
( 7, 15, 302706, 1), (26, 11, 303852, 1), (11, 17, 305341, 1)],
|
|
102
|
-
dtype=[('x', '<i8'), ('y', '<i8'), ('t', '<i8'), ('p', '<i8')]),
|
|
103
|
-
0),
|
|
104
|
-
(array([( 7, 22, 2463, 0), ( 9, 24, 3432, 0), (15, 13, 3641, 0), ...,
|
|
105
|
-
(30, 23, 304620, 1), ( 7, 15, 305649, 0), ( 0, 27, 306232, 1)],
|
|
106
|
-
dtype=[('x', '<i8'), ('y', '<i8'), ('t', '<i8'), ('p', '<i8')]),
|
|
107
|
-
0)]
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
Check [Torchdata documentation](https://pytorch.org/data/beta/index.html) to know more about data pipes and what one can do with them. Torchvision seems to be heavily investing on this new format to allow for much more flexibility in datasets, and we plan on following them in order to make Tonic as compatible as possible with standard deep learning frameworks.
|
|
112
|
-
|
|
113
|
-
Please, report any bug if you experiment with data pipes. This is _really experimental_ code.
|
|
114
|
-
## Currently supported datasets
|
|
115
|
-
- [ ] CIFAR10DVS
|
|
116
|
-
- [ ] DAVISDATA
|
|
117
|
-
- [ ] DSEC
|
|
118
|
-
- [ ] DVSGesture
|
|
119
|
-
- [ ] DVSLip
|
|
120
|
-
- [ ] MVSEC
|
|
121
|
-
- [ ] NCALTECH101
|
|
122
|
-
- [x] NMNIST
|
|
123
|
-
- [ ] POKERDVS
|
|
124
|
-
- [ ] SMNIST
|
|
125
|
-
- [x] STMNIST
|
|
126
|
-
- [ ] SHD
|
|
127
|
-
- [ ] SSC
|
|
128
|
-
- [ ] TUMVIE
|
|
129
|
-
- [ ] VPR
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from . import datasets
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from .ncars import NCARS
|
|
2
|
-
from .nmnist import NMNIST
|
|
3
|
-
from .prophesee import (
|
|
4
|
-
Gen1AutomotiveDetection,
|
|
5
|
-
Gen4Automotive,
|
|
6
|
-
Gen4AutomotiveDetectionMini,
|
|
7
|
-
Gen4Downsampled,
|
|
8
|
-
)
|
|
9
|
-
from .stmnist import STMNIST
|
|
10
|
-
|
|
11
|
-
__all__ = [
|
|
12
|
-
"NMNIST",
|
|
13
|
-
"STMNIST",
|
|
14
|
-
"NCARS",
|
|
15
|
-
"Gen1AutomotiveDetection",
|
|
16
|
-
"Gen4Automotive",
|
|
17
|
-
"Gen4AutomotiveDetectionMini",
|
|
18
|
-
"Gen4Downsampled",
|
|
19
|
-
]
|