tonic 1.5.1.dev19__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.dev19 → tonic-1.5.1.dev20}/.binder/requirements.txt +0 -1
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/ChangeLog +2 -1
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/PKG-INFO +1 -1
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/about/about.rst +0 -1
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/datasets.rst +5 -14
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/torch_requirements.txt +0 -1
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/__init__.py +0 -5
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/__init__.py +0 -2
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic.egg-info/PKG-INFO +1 -1
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic.egg-info/SOURCES.txt +1 -16
- tonic-1.5.1.dev20/tonic.egg-info/pbr.json +1 -0
- tonic-1.5.1.dev19/docs/about/prototype.rst +0 -6
- tonic-1.5.1.dev19/test/prototype_dataset_utils.py +0 -86
- tonic-1.5.1.dev19/test/test_prototype_datasets.py +0 -300
- tonic-1.5.1.dev19/tonic/datasets/nerdd.py +0 -120
- tonic-1.5.1.dev19/tonic/prototype/README.md +0 -129
- tonic-1.5.1.dev19/tonic/prototype/__init__.py +0 -1
- tonic-1.5.1.dev19/tonic/prototype/datasets/__init__.py +0 -19
- tonic-1.5.1.dev19/tonic/prototype/datasets/ncars.py +0 -100
- tonic-1.5.1.dev19/tonic/prototype/datasets/nmnist.py +0 -151
- tonic-1.5.1.dev19/tonic/prototype/datasets/prophesee.py +0 -338
- tonic-1.5.1.dev19/tonic/prototype/datasets/stmnist.py +0 -134
- tonic-1.5.1.dev19/tonic/prototype/datasets/utils/__init__.py +0 -0
- tonic-1.5.1.dev19/tonic/prototype/datasets/utils/_dataset.py +0 -63
- tonic-1.5.1.dev19/tonic/prototype/datasets/utils/_utils.py +0 -31
- tonic-1.5.1.dev19/tonic/prototype/slicers.py +0 -89
- tonic-1.5.1.dev19/tonic.egg-info/pbr.json +0 -1
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/.coveragerc +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/.github/workflows/ci-pipeline.yml +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/.pre-commit-config.yaml +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/.readthedocs.yml +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/AUTHORS +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/LICENSE.txt +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/MANIFEST.in +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/README.md +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/Makefile +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_static/event-cameras/eventstream.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_static/event-cameras/framestream.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_static/event-cameras/receptive-fields.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_static/event-cameras/sampling-theorems.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_static/snn/neuron-models.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_static/snn/surrogates.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_static/tonic-logo-black-bg.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_static/tonic-logo-black.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_static/tonic-logo-white.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_static/tonic_favicon.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_templates/class_dataset.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/_templates/class_transform.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/about/info.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/about/release_notes.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/conf.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/README.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/representations/README.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/representations/plot_tobinarep.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/representations/plot_toframe.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/representations/plot_toimage.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/representations/plot_totimesurface.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/representations/plot_tovoxelgrid.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/README.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_centercrop.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_crop_time.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_decimation.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_denoise.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_downsample.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_drop_event.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_drop_event_by_area.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_drop_event_by_time.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_drop_pixel.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_event_downsampling.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_merge_polarities.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_random_crop.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_random_flip_lr.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_random_flip_ud.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_random_time_reversal.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_refractory_period.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_spatial_jitter.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_time_jitter.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/gallery/transformations/plot_uniform_noise.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/getting_involved/communication_channels.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/getting_involved/contribute.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/getting_involved/getting_involved.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/getting_started/getting_started.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/getting_started/install.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/getting_started/nmnist.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/how-tos/how-tos.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/how-tos/loading-raw-events.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/how-tos/visualizing-data.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/how-tos/wrapping_own_data.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/index.md +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/make.bat +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/reading_material/design_choices.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/reading_material/intro-event-cameras.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/reading_material/intro-snns.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/reading_material/reading_material.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/reading_material/training-snns.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/requirements.txt +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/transformations.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/tutorials/Aug_DiskCachDataset.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/tutorials/audio_transforms_tutorial.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/tutorials/batching.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/tutorials/davis_data.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/tutorials/fast_dataloading.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/tutorials/large_datasets.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/tutorials/slicing.ipynb +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/docs/tutorials/tutorials.rst +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/requirements.txt +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/setup.cfg +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/setup.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/dataset_utils.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/requirements.txt +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_audio_augmentations.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_audio_transforms.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_aug_caching.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_caching.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_chained_transforms.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_data/sample.aedat4 +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_data/sample_aedat_header.aedat +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_data/sample_ncars.dat +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_data/sample_nmnist.bin +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_data/sample_stmnist.mat +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_datasets.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_dsec.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_io.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_representations.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_sliced_dataset.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_slicers.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_tonic_utils.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/test_transforms.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/test/utils.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/audio_augmentations.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/audio_transforms.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/cached_dataset.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/collation.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/dataset.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/asl_dvs.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/cifar10dvs.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/davisdataset.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/dsec.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/dvs_lips.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/dvsgesture.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/ebssa.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/hsd.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/mvsec.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/ncaltech101.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/nmnist.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/ntidigits18.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/pokerdvs.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/s_mnist.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/threeET_eyetracking.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/tum_vie.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/datasets/visual_place_recognition.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/download_utils.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/__init__.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/crop.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/decimate.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/denoise.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/drop_event.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/drop_pixel.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/event_downsampling.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/refractory_period.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/spatial_jitter.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/time_jitter.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/time_skew.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/to_averaged_timesurface.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/to_bina_rep.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/to_frame.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/to_timesurface.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/to_voxel_grid.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/functional/uniform_noise.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/io.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/sliced_dataset.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/slicers.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/transforms.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic/utils.py +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic-logo-padded.png +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic.egg-info/dependency_links.txt +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic.egg-info/not-zip-safe +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic.egg-info/requires.txt +0 -0
- {tonic-1.5.1.dev19 → tonic-1.5.1.dev20}/tonic.egg-info/top_level.txt +0 -0
|
@@ -45,28 +45,19 @@ Pose estimation, visual odometry, SLAM
|
|
|
45
45
|
MVSEC
|
|
46
46
|
TUMVIE
|
|
47
47
|
VPR
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
|
|
49
|
+
Star tracking
|
|
50
50
|
-------------------
|
|
51
51
|
.. autosummary::
|
|
52
52
|
:toctree: generated/
|
|
53
53
|
:template: class_dataset.rst
|
|
54
54
|
|
|
55
|
-
ThreeET_Eyetracking
|
|
56
|
-
NeRDD
|
|
57
55
|
EBSSA
|
|
58
56
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Prototype iterable datasets
|
|
63
|
-
---------------------------
|
|
57
|
+
Eye tracking
|
|
58
|
+
-------------------
|
|
64
59
|
.. autosummary::
|
|
65
60
|
:toctree: generated/
|
|
66
61
|
:template: class_dataset.rst
|
|
67
62
|
|
|
68
|
-
|
|
69
|
-
NCARS
|
|
70
|
-
STMNIST
|
|
71
|
-
Gen1AutomotiveDetection
|
|
72
|
-
Gen4AutomotiveDetectionMini
|
|
63
|
+
ThreeET_Eyetracking
|
|
@@ -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()
|
|
@@ -9,7 +9,6 @@ from .ntidigits18 import NTIDIGITS18
|
|
|
9
9
|
from .hsd import SHD, SSC
|
|
10
10
|
from .mvsec import MVSEC
|
|
11
11
|
from .ncaltech101 import NCALTECH101
|
|
12
|
-
from .nerdd import NERDD
|
|
13
12
|
from .nmnist import NMNIST
|
|
14
13
|
from .pokerdvs import POKERDVS
|
|
15
14
|
from .s_mnist import SMNIST
|
|
@@ -26,7 +25,6 @@ __all__ = [
|
|
|
26
25
|
"EBSSA",
|
|
27
26
|
"MVSEC",
|
|
28
27
|
"NCALTECH101",
|
|
29
|
-
"NERDD",
|
|
30
28
|
"NMNIST",
|
|
31
29
|
"POKERDVS",
|
|
32
30
|
"SHD",
|
|
@@ -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
|
|
@@ -139,7 +136,6 @@ tonic/datasets/ebssa.py
|
|
|
139
136
|
tonic/datasets/hsd.py
|
|
140
137
|
tonic/datasets/mvsec.py
|
|
141
138
|
tonic/datasets/ncaltech101.py
|
|
142
|
-
tonic/datasets/nerdd.py
|
|
143
139
|
tonic/datasets/nmnist.py
|
|
144
140
|
tonic/datasets/ntidigits18.py
|
|
145
141
|
tonic/datasets/pokerdvs.py
|
|
@@ -163,15 +159,4 @@ tonic/functional/to_bina_rep.py
|
|
|
163
159
|
tonic/functional/to_frame.py
|
|
164
160
|
tonic/functional/to_timesurface.py
|
|
165
161
|
tonic/functional/to_voxel_grid.py
|
|
166
|
-
tonic/functional/uniform_noise.py
|
|
167
|
-
tonic/prototype/README.md
|
|
168
|
-
tonic/prototype/__init__.py
|
|
169
|
-
tonic/prototype/slicers.py
|
|
170
|
-
tonic/prototype/datasets/__init__.py
|
|
171
|
-
tonic/prototype/datasets/ncars.py
|
|
172
|
-
tonic/prototype/datasets/nmnist.py
|
|
173
|
-
tonic/prototype/datasets/prophesee.py
|
|
174
|
-
tonic/prototype/datasets/stmnist.py
|
|
175
|
-
tonic/prototype/datasets/utils/__init__.py
|
|
176
|
-
tonic/prototype/datasets/utils/_dataset.py
|
|
177
|
-
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,120 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import numpy as np
|
|
3
|
-
from typing import Any, Callable, Optional, Tuple
|
|
4
|
-
from tonic.download_utils import extract_archive
|
|
5
|
-
from tonic.io import make_structured_array
|
|
6
|
-
|
|
7
|
-
class NERDD:
|
|
8
|
-
"""`NeRDD <https://github.com/MagriniGabriele/NeRDD>`_
|
|
9
|
-
Neuromorphic Event-based Reactive Driving Dataset.
|
|
10
|
-
|
|
11
|
-
Parameters:
|
|
12
|
-
root (string): Location to save files to on disk.
|
|
13
|
-
transforms (callable, optional): A callable of transforms that is applied to both data and
|
|
14
|
-
labels at the same time.
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
filename = "NeRDD.zip"
|
|
18
|
-
folder_name = "DATA"
|
|
19
|
-
sensor_size = (1280, 720, 2)
|
|
20
|
-
dtype = np.dtype([("t", np.int32), ("x", np.int16), ("y", np.int16), ("p", bool)])
|
|
21
|
-
ordering = dtype.names
|
|
22
|
-
|
|
23
|
-
def __init__(
|
|
24
|
-
self,
|
|
25
|
-
root: str,
|
|
26
|
-
transforms: Optional[Callable] = None,
|
|
27
|
-
):
|
|
28
|
-
self.data = []
|
|
29
|
-
self.targets = []
|
|
30
|
-
self.location_on_system = root
|
|
31
|
-
self.transforms = transforms
|
|
32
|
-
|
|
33
|
-
if not self._check_extracted():
|
|
34
|
-
if not self._check_zip_exists():
|
|
35
|
-
raise FileNotFoundError(
|
|
36
|
-
f"The dataset archive '{self.filename}' was not found in {self.location_on_system}. "
|
|
37
|
-
"Please download it manually and place it in the specified directory."
|
|
38
|
-
)
|
|
39
|
-
self._extract_archive()
|
|
40
|
-
|
|
41
|
-
self._load_dataset_structure()
|
|
42
|
-
|
|
43
|
-
def _check_zip_exists(self) -> bool:
|
|
44
|
-
"""Check if the zip file exists in the specified directory."""
|
|
45
|
-
return os.path.isfile(os.path.join(self.location_on_system, self.filename))
|
|
46
|
-
|
|
47
|
-
def _check_extracted(self) -> bool:
|
|
48
|
-
"""Check if the dataset has been extracted and contains at least 10 .npz files."""
|
|
49
|
-
data_path = os.path.join(self.location_on_system, self.folder_name)
|
|
50
|
-
if not os.path.isdir(data_path):
|
|
51
|
-
return False
|
|
52
|
-
npz_files = []
|
|
53
|
-
for root, _, files in os.walk(data_path):
|
|
54
|
-
npz_files.extend([f for f in files if f.endswith(".npz")])
|
|
55
|
-
return len(npz_files) == 115
|
|
56
|
-
|
|
57
|
-
def _extract_archive(self):
|
|
58
|
-
"""Extract the dataset archive."""
|
|
59
|
-
print(f"Extracting {self.filename}...")
|
|
60
|
-
archive_path = os.path.join(self.location_on_system, self.filename)
|
|
61
|
-
extract_archive(archive_path)
|
|
62
|
-
print(f"Extraction complete. Files are now in {self.location_on_system}.")
|
|
63
|
-
|
|
64
|
-
def _load_dataset_structure(self):
|
|
65
|
-
"""Load the dataset files and their corresponding labels."""
|
|
66
|
-
data_path = os.path.join(self.location_on_system, self.folder_name)
|
|
67
|
-
archives = [
|
|
68
|
-
f for f in os.listdir(data_path)
|
|
69
|
-
if os.path.isdir(os.path.join(data_path, f))
|
|
70
|
-
]
|
|
71
|
-
|
|
72
|
-
for archive in archives:
|
|
73
|
-
archive_path = os.path.join(data_path, archive)
|
|
74
|
-
scenes = [
|
|
75
|
-
f for f in os.listdir(archive_path)
|
|
76
|
-
if os.path.isdir(os.path.join(archive_path, f))
|
|
77
|
-
]
|
|
78
|
-
|
|
79
|
-
for scene in scenes:
|
|
80
|
-
scene_path = os.path.join(archive_path, scene)
|
|
81
|
-
event_file = os.path.join(scene_path, "Event", "output_events.npz")
|
|
82
|
-
rgb_folder = os.path.join(scene_path, "rgb_folder")
|
|
83
|
-
label_file = os.path.join(scene_path, "ev_rgb_coordinates.txt")
|
|
84
|
-
|
|
85
|
-
if os.path.exists(event_file) and os.path.exists(label_file):
|
|
86
|
-
self.data.append((event_file, label_file))
|
|
87
|
-
else:
|
|
88
|
-
print(f"Skipping scene {scene} in archive {archive}: missing files.")
|
|
89
|
-
|
|
90
|
-
def __getitem__(self, index: int) -> Tuple[Any, Any]:
|
|
91
|
-
"""
|
|
92
|
-
Returns:
|
|
93
|
-
(events, target) where target is index of the target class.
|
|
94
|
-
"""
|
|
95
|
-
event_file, label_file = self.data[index]
|
|
96
|
-
events = np.load(event_file)["data"]
|
|
97
|
-
events = make_structured_array(
|
|
98
|
-
events[:, 3], # t
|
|
99
|
-
events[:, 0], # x
|
|
100
|
-
events[:, 1], # y
|
|
101
|
-
events[:, 2], # p
|
|
102
|
-
dtype=self.dtype,
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
with open(label_file, "r") as f:
|
|
106
|
-
bboxes = []
|
|
107
|
-
for line in f.readlines():
|
|
108
|
-
timestamp, bbox_str = line.strip().split(":")
|
|
109
|
-
bbox_coords = list(map(float, bbox_str.split(",")))
|
|
110
|
-
bboxes.append([float(timestamp)] + bbox_coords)
|
|
111
|
-
bboxes = np.array(bboxes, dtype=np.float32)
|
|
112
|
-
|
|
113
|
-
# Apply transforms if provided
|
|
114
|
-
if self.transforms is not None:
|
|
115
|
-
events, bboxes = self.transforms(events, bboxes)
|
|
116
|
-
|
|
117
|
-
return events, bboxes
|
|
118
|
-
|
|
119
|
-
def __len__(self):
|
|
120
|
-
return len(self.data)
|