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%| | 51200/169674850 [00:00<08:18, 340384.16it/s]
0%| | 311296/169674850 [00:00<02:27, 1145135.47it/s]
1%| | 1340416/169674850 [00:00<00:45, 3702229.42it/s]
2%|▏ | 3987456/169674850 [00:00<00:18, 9083647.52it/s]
4%|▍ | 6920192/169674850 [00:00<00:12, 12739310.32it/s]
6%|▌ | 9951232/169674850 [00:00<00:10, 15161323.58it/s]
8%|▊ | 12965888/169674850 [00:01<00:09, 16655680.67it/s]
9%|▉ | 16029696/169674850 [00:01<00:08, 17748838.91it/s]
11%|█▏ | 19257344/169674850 [00:01<00:07, 18811247.55it/s]
13%|█▎ | 22484992/169674850 [00:01<00:07, 19546602.02it/s]
15%|█▌ | 25696256/169674850 [00:01<00:07, 20003760.73it/s]
17%|█▋ | 28973056/169674850 [00:01<00:06, 20449338.64it/s]
19%|█▉ | 32331776/169674850 [00:01<00:06, 20902202.10it/s]
21%|██ | 35706880/169674850 [00:02<00:06, 21282813.70it/s]
23%|██▎ | 38983680/169674850 [00:02<00:06, 21326712.77it/s]
25%|██▌ | 42424320/169674850 [00:02<00:05, 21659002.79it/s]
27%|██▋ | 45848576/169674850 [00:02<00:05, 21922973.15it/s]
29%|██▉ | 49354752/169674850 [00:02<00:05, 22234853.78it/s]
31%|███ | 52877312/169674850 [00:02<00:05, 22425777.86it/s]
33%|███▎ | 56399872/169674850 [00:03<00:05, 22586994.02it/s]
35%|███▌ | 59922432/169674850 [00:03<00:04, 22834154.19it/s]
37%|███▋ | 63477760/169674850 [00:03<00:04, 22859245.41it/s]
40%|███▉ | 67033088/169674850 [00:03<00:04, 22929696.69it/s]
42%|████▏ | 70588416/169674850 [00:03<00:04, 23018957.43it/s]
44%|████▎ | 74160128/169674850 [00:03<00:04, 23253664.89it/s]
46%|████▌ | 77780992/169674850 [00:03<00:03, 23242339.79it/s]
48%|████▊ | 81418240/169674850 [00:04<00:03, 23390236.88it/s]
50%|█████ | 85055488/169674850 [00:04<00:03, 24582722.29it/s]
52%|█████▏ | 87529472/169674850 [00:04<00:03, 24441193.37it/s]
53%|█████▎ | 90642432/169674850 [00:04<00:03, 24776024.45it/s]
55%|█████▍ | 93127680/169674850 [00:04<00:03, 24338574.68it/s]
57%|█████▋ | 96278528/169674850 [00:04<00:02, 24566377.98it/s]
58%|█████▊ | 98734080/169674850 [00:04<00:02, 24349703.93it/s]
60%|██████ | 102029312/169674850 [00:04<00:02, 25225731.10it/s]
62%|██████▏ | 104548352/169674850 [00:05<00:02, 24632103.27it/s]
64%|██████▎ | 107894784/169674850 [00:05<00:02, 25227772.56it/s]
65%|██████▌ | 110409728/169674850 [00:05<00:02, 24982899.43it/s]
67%|██████▋ | 113694720/169674850 [00:05<00:02, 25762844.66it/s]
69%|██████▊ | 116262912/169674850 [00:05<00:02, 25050946.93it/s]
70%|███████ | 119461888/169674850 [00:05<00:01, 25637481.38it/s]
72%|███████▏ | 122018816/169674850 [00:05<00:01, 24940273.56it/s]
74%|███████▍ | 125376512/169674850 [00:05<00:01, 25946995.61it/s]
75%|███████▌ | 127963136/169674850 [00:05<00:01, 25208324.00it/s]
77%|███████▋ | 131307520/169674850 [00:06<00:01, 26134641.03it/s]
79%|███████▉ | 133913600/169674850 [00:06<00:01, 25409997.93it/s]
81%|████████ | 137320448/169674850 [00:06<00:01, 26422540.95it/s]
82%|████████▏ | 139954176/169674850 [00:06<00:01, 25696541.62it/s]
85%|████████▍ | 143431680/169674850 [00:06<00:00, 26805887.27it/s]
86%|████████▌ | 146103296/169674850 [00:06<00:00, 26049195.94it/s]
88%|████████▊ | 149592064/169674850 [00:06<00:00, 27098895.36it/s]
90%|████████▉ | 152293376/169674850 [00:06<00:00, 26411593.19it/s]
92%|█████████▏| 155752448/169674850 [00:06<00:00, 27182624.70it/s]
93%|█████████▎| 158461952/169674850 [00:07<00:00, 26708069.89it/s]
95%|█████████▌| 161896448/169674850 [00:07<00:00, 27133858.85it/s]
97%|█████████▋| 164601856/169674850 [00:07<00:00, 26840610.83it/s]
99%|█████████▉| 168056832/169674850 [00:07<00:00, 27084562.71it/s]
169675776it [00:07, 22627892.28it/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.421 seconds)