Note
Go to the end to download the full example code.
CropTime#
The CropTime
removes all events
below min and above max.
Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers). Got range [0.0..2.0].
import tonic
nmnist = tonic.datasets.NMNIST("../../tutorials/data", train=False)
events, label = nmnist[0]
transform = tonic.transforms.Compose(
[
tonic.transforms.CropTime(max=100000),
tonic.transforms.ToFrame(
sensor_size=nmnist.sensor_size,
time_window=10000,
),
]
)
frames = transform(events)
ani = tonic.utils.plot_animation(frames)
Total running time of the script: (0 minutes 0.837 seconds)