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%| | 59392/169674850 [00:00<07:15, 389168.17it/s]
0%| | 251904/169674850 [00:00<03:07, 903062.76it/s]
1%| | 913408/169674850 [00:00<01:08, 2471132.22it/s]
2%|▏ | 3435520/169674850 [00:00<00:20, 8025095.89it/s]
4%|▍ | 6597632/169674850 [00:00<00:11, 13632656.99it/s]
5%|▍ | 8252416/169674850 [00:00<00:11, 14103471.12it/s]
7%|▋ | 11496448/169674850 [00:00<00:08, 18080982.92it/s]
8%|▊ | 13373440/169674850 [00:01<00:08, 17688384.08it/s]
10%|▉ | 16509952/169674850 [00:01<00:07, 20477161.79it/s]
11%|█ | 18596864/169674850 [00:01<00:07, 19828992.91it/s]
13%|█▎ | 21588992/169674850 [00:01<00:06, 21698835.21it/s]
14%|█▍ | 23780352/169674850 [00:01<00:06, 20907706.45it/s]
16%|█▌ | 26799104/169674850 [00:01<00:06, 22592856.20it/s]
17%|█▋ | 29071360/169674850 [00:01<00:06, 21633838.84it/s]
19%|█▉ | 32009216/169674850 [00:01<00:05, 23003230.19it/s]
20%|██ | 34320384/169674850 [00:01<00:06, 21957056.57it/s]
22%|██▏ | 37268480/169674850 [00:02<00:05, 23310886.94it/s]
23%|██▎ | 39610368/169674850 [00:02<00:05, 22226704.27it/s]
25%|██▌ | 42560512/169674850 [00:02<00:05, 23533749.69it/s]
26%|██▋ | 44925952/169674850 [00:02<00:05, 22392704.59it/s]
28%|██▊ | 47885312/169674850 [00:02<00:05, 23734559.24it/s]
30%|██▉ | 50272256/169674850 [00:02<00:05, 22537144.23it/s]
31%|███▏ | 53242880/169674850 [00:02<00:04, 23905699.30it/s]
33%|███▎ | 55649280/169674850 [00:02<00:05, 22684807.38it/s]
35%|███▍ | 58698752/169674850 [00:03<00:04, 24232947.64it/s]
36%|███▌ | 61139968/169674850 [00:03<00:04, 23010771.87it/s]
38%|███▊ | 64236544/169674850 [00:03<00:04, 24597410.81it/s]
39%|███▉ | 66715648/169674850 [00:03<00:04, 23380809.72it/s]
41%|████▏ | 70036480/169674850 [00:03<00:03, 25402601.11it/s]
43%|████▎ | 72597504/169674850 [00:03<00:04, 24165301.31it/s]
45%|████▍ | 76016640/169674850 [00:03<00:03, 26095790.85it/s]
46%|████▋ | 78645248/169674850 [00:03<00:03, 24874828.05it/s]
48%|████▊ | 81996800/169674850 [00:03<00:03, 26621126.28it/s]
50%|████▉ | 84678656/169674850 [00:04<00:03, 25163456.72it/s]
52%|█████▏ | 87976960/169674850 [00:04<00:03, 26777974.00it/s]
53%|█████▎ | 90679296/169674850 [00:04<00:03, 25280590.33it/s]
55%|█████▌ | 94022656/169674850 [00:04<00:02, 27006773.90it/s]
57%|█████▋ | 96751616/169674850 [00:04<00:02, 25515350.69it/s]
59%|█████▉ | 100199424/169674850 [00:04<00:02, 27455466.41it/s]
61%|██████ | 102976512/169674850 [00:04<00:02, 25895257.86it/s]
63%|██████▎ | 106507264/169674850 [00:04<00:02, 27930921.88it/s]
64%|██████▍ | 109335552/169674850 [00:04<00:02, 26424090.75it/s]
67%|██████▋ | 112864256/169674850 [00:05<00:01, 28412367.96it/s]
68%|██████▊ | 115741696/169674850 [00:05<00:02, 26228441.78it/s]
70%|███████ | 119303168/169674850 [00:05<00:01, 28119619.22it/s]
72%|███████▏ | 122161152/169674850 [00:05<00:01, 26724937.08it/s]
74%|███████▍ | 125824000/169674850 [00:05<00:01, 28231651.27it/s]
76%|███████▌ | 128674816/169674850 [00:05<00:01, 27750539.97it/s]
78%|███████▊ | 132557824/169674850 [00:05<00:01, 30458924.76it/s]
80%|███████▉ | 135633920/169674850 [00:05<00:01, 28122639.28it/s]
82%|████████▏ | 139570176/169674850 [00:06<00:00, 30482920.38it/s]
84%|████████▍ | 142664704/169674850 [00:06<00:00, 28728832.12it/s]
86%|████████▋ | 146582528/169674850 [00:06<00:00, 31129041.79it/s]
88%|████████▊ | 149744640/169674850 [00:06<00:00, 29510391.00it/s]
91%|█████████ | 153713664/169674850 [00:06<00:00, 32258534.64it/s]
93%|█████████▎| 156999680/169674850 [00:06<00:00, 30025548.04it/s]
95%|█████████▍| 160721920/169674850 [00:06<00:00, 31961930.49it/s]
97%|█████████▋| 163985408/169674850 [00:06<00:00, 32055066.21it/s]
99%|█████████▊| 167238656/169674850 [00:06<00:00, 30563047.58it/s]
169675776it [00:06, 24313373.16it/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 15.469 seconds)