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%| | 62464/169674850 [00:00<07:18, 387134.68it/s]
0%| | 340992/169674850 [00:00<02:25, 1165219.82it/s]
1%| | 1437696/169674850 [00:00<00:45, 3702549.83it/s]
3%|▎ | 4500480/169674850 [00:00<00:17, 9642421.60it/s]
5%|▍ | 7695360/169674850 [00:00<00:12, 13202559.93it/s]
6%|▋ | 10906624/169674850 [00:00<00:10, 15381601.95it/s]
8%|▊ | 14134272/169674850 [00:01<00:09, 16815992.23it/s]
10%|█ | 17411072/169674850 [00:01<00:08, 17782774.72it/s]
12%|█▏ | 20671488/169674850 [00:01<00:08, 18507857.97it/s]
14%|█▍ | 23997440/169674850 [00:01<00:07, 19022845.63it/s]
16%|█▌ | 27372544/169674850 [00:01<00:07, 19454898.82it/s]
18%|█▊ | 30764032/169674850 [00:01<00:07, 19825852.16it/s]
20%|██ | 34155520/169674850 [00:02<00:06, 20085031.01it/s]
22%|██▏ | 37596160/169674850 [00:02<00:06, 20462483.42it/s]
24%|██▍ | 41102336/169674850 [00:02<00:06, 20600472.91it/s]
26%|██▋ | 44608512/169674850 [00:02<00:06, 20800197.99it/s]
28%|██▊ | 48131072/169674850 [00:02<00:05, 21070630.55it/s]
30%|███ | 51670016/169674850 [00:02<00:05, 21192159.32it/s]
33%|███▎ | 55258112/169674850 [00:03<00:05, 21463832.10it/s]
34%|███▍ | 58304512/169674850 [00:03<00:04, 23333295.99it/s]
36%|███▌ | 60722176/169674850 [00:03<00:05, 21073065.06it/s]
38%|███▊ | 64154624/169674850 [00:03<00:04, 24074306.96it/s]
39%|███▉ | 66705408/169674850 [00:03<00:04, 21630064.55it/s]
41%|████ | 69839872/169674850 [00:03<00:04, 21105398.75it/s]
43%|████▎ | 72723456/169674850 [00:03<00:04, 22845227.17it/s]
44%|████▍ | 75394048/169674850 [00:04<00:04, 21730811.22it/s]
46%|████▌ | 77941760/169674850 [00:04<00:04, 22641661.27it/s]
48%|████▊ | 80980992/169674850 [00:04<00:03, 24594939.52it/s]
49%|████▉ | 83528704/169674850 [00:04<00:03, 22138009.05it/s]
51%|█████ | 86404096/169674850 [00:04<00:03, 23797757.88it/s]
52%|█████▏ | 88879104/169674850 [00:04<00:03, 21369741.43it/s]
54%|█████▍ | 91909120/169674850 [00:04<00:03, 23567300.42it/s]
56%|█████▌ | 94481408/169674850 [00:04<00:03, 22535870.72it/s]
57%|█████▋ | 96816128/169674850 [00:04<00:03, 22200217.24it/s]
59%|█████▉ | 100199424/169674850 [00:05<00:03, 23090421.30it/s]
60%|██████ | 102538240/169674850 [00:05<00:02, 22762591.60it/s]
62%|██████▏ | 105942016/169674850 [00:05<00:02, 25760976.62it/s]
64%|██████▍ | 108568576/169674850 [00:05<00:02, 22653324.09it/s]
66%|██████▌ | 111930368/169674850 [00:05<00:02, 24261904.03it/s]
67%|██████▋ | 114425856/169674850 [00:05<00:02, 23044498.19it/s]
70%|██████▉ | 118041600/169674850 [00:05<00:02, 24977126.86it/s]
71%|███████ | 120574976/169674850 [00:05<00:02, 23653968.40it/s]
73%|███████▎ | 124106752/169674850 [00:06<00:01, 26667467.03it/s]
75%|███████▍ | 126839808/169674850 [00:06<00:01, 23855335.59it/s]
77%|███████▋ | 130477056/169674850 [00:06<00:01, 25539814.83it/s]
78%|███████▊ | 133094400/169674850 [00:06<00:01, 24465704.32it/s]
80%|████████ | 136195072/169674850 [00:06<00:01, 26122971.19it/s]
82%|████████▏ | 138947584/169674850 [00:06<00:01, 25898749.93it/s]
83%|████████▎ | 141575168/169674850 [00:06<00:01, 25052446.55it/s]
85%|████████▌ | 144594944/169674850 [00:06<00:00, 26458138.19it/s]
87%|████████▋ | 147680256/169674850 [00:06<00:00, 26693569.89it/s]
89%|████████▊ | 150372352/169674850 [00:07<00:00, 25652582.68it/s]
90%|█████████ | 153398272/169674850 [00:07<00:00, 26921120.40it/s]
92%|█████████▏| 156478464/169674850 [00:07<00:00, 27124225.45it/s]
94%|█████████▍| 159207424/169674850 [00:07<00:00, 26040413.20it/s]
96%|█████████▌| 162311168/169674850 [00:07<00:00, 27417273.69it/s]
98%|█████████▊| 165456896/169674850 [00:07<00:00, 27658547.60it/s]
99%|█████████▉| 168238080/169674850 [00:07<00:00, 26402443.15it/s]
169675776it [00:07, 21899462.62it/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 13.349 seconds)