Note
Go to the end to download the full example code.
ToVoxelGrid#
Downloading https://prod-dcd-datasets-public-files-eu-west-1.s3.eu-west-1.amazonaws.com/a99d0fee-a95b-4231-ad22-988fdb0a2411 to ../../tutorials/data/NMNIST/test.zip
0%| | 0/169674850 [00:00<?, ?it/s]
0%| | 52224/169674850 [00:00<08:35, 329219.16it/s]
0%| | 242688/169674850 [00:00<03:23, 833316.34it/s]
0%| | 696320/169674850 [00:00<01:37, 1735739.84it/s]
2%|▏ | 2896896/169674850 [00:00<00:25, 6443468.62it/s]
5%|▍ | 8446976/169674850 [00:00<00:09, 16471602.34it/s]
9%|▉ | 15408128/169674850 [00:00<00:05, 26563787.78it/s]
11%|█▏ | 19464192/169674850 [00:01<00:05, 29596138.22it/s]
13%|█▎ | 22580224/169674850 [00:01<00:04, 29788663.30it/s]
17%|█▋ | 29080576/169674850 [00:01<00:04, 33907435.28it/s]
21%|██ | 35999744/169674850 [00:01<00:03, 38329591.68it/s]
24%|██▎ | 40099840/169674850 [00:01<00:03, 38712580.08it/s]
26%|██▌ | 44521472/169674850 [00:01<00:03, 40112349.50it/s]
29%|██▉ | 49608704/169674850 [00:01<00:02, 41070142.57it/s]
32%|███▏ | 54135808/169674850 [00:01<00:02, 40104581.28it/s]
36%|███▌ | 61020160/169674850 [00:02<00:02, 40614439.78it/s]
38%|███▊ | 65084416/169674850 [00:02<00:02, 38652081.25it/s]
42%|████▏ | 70933504/169674850 [00:02<00:02, 38257594.46it/s]
46%|████▌ | 77712384/169674850 [00:02<00:02, 41578232.13it/s]
48%|████▊ | 81867776/169674850 [00:02<00:02, 40640200.41it/s]
51%|█████ | 85913600/169674850 [00:02<00:02, 39562714.32it/s]
54%|█████▎ | 90973184/169674850 [00:02<00:01, 40353154.67it/s]
56%|█████▌ | 95031296/169674850 [00:02<00:01, 38705146.30it/s]
61%|██████ | 102993920/169674850 [00:03<00:01, 49425919.41it/s]
64%|██████▎ | 108081152/169674850 [00:03<00:01, 42928787.48it/s]
66%|██████▋ | 112602112/169674850 [00:03<00:01, 41564466.06it/s]
69%|██████▉ | 116911104/169674850 [00:03<00:01, 41885646.89it/s]
71%|███████▏ | 121211904/169674850 [00:03<00:01, 41718055.09it/s]
74%|███████▍ | 125819904/169674850 [00:03<00:01, 37107881.88it/s]
79%|███████▊ | 133412864/169674850 [00:03<00:00, 46908784.46it/s]
82%|████████▏ | 138386432/169674850 [00:03<00:00, 41792796.23it/s]
86%|████████▌ | 146040832/169674850 [00:04<00:00, 43646992.27it/s]
89%|████████▊ | 150574080/169674850 [00:04<00:00, 43493707.46it/s]
93%|█████████▎| 157418496/169674850 [00:04<00:00, 48197586.76it/s]
96%|█████████▌| 162366464/169674850 [00:04<00:00, 44553941.99it/s]
99%|█████████▉| 167759872/169674850 [00:04<00:00, 41686471.30it/s]
169675776it [00:04, 36819867.91it/s]
Extracting ../../tutorials/data/NMNIST/test.zip to ../../tutorials/data/NMNIST
import tonic
nmnist = tonic.datasets.NMNIST("../../tutorials/data", train=False)
events, label = nmnist[0]
transform = tonic.transforms.ToVoxelGrid(
sensor_size=nmnist.sensor_size,
n_time_bins=20,
)
frames = transform(events)
ani = tonic.utils.plot_animation(frames)
Total running time of the script: (0 minutes 11.365 seconds)