Downsample#

The Downsample applies spatial and/or temporal factors to events.

Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).

import tonic

nmnist = tonic.datasets.NMNIST("../../tutorials/data", train=False)
events, label = nmnist[0]

transform = tonic.transforms.Compose(
    [
        tonic.transforms.Downsample(spatial_factor=0.5),
        tonic.transforms.ToFrame(
            sensor_size=(17, 17, 2),
            time_window=10000,
        ),
    ]
)

frames = transform(events)

ani = tonic.utils.plot_animation(frames)

Total running time of the script: (0 minutes 4.416 seconds)

Gallery generated by Sphinx-Gallery