qualia_plugin_snn.preprocessing.IntegrateEventsByFixedFramesNumber module

Provide a preprocessing module to construct fixed number of frames from a sample of event data.

class qualia_plugin_snn.preprocessing.IntegrateEventsByFixedFramesNumber.IntegrateEventsByFixedFramesNumber[source]

Bases: IntegrateEventsByFixedDuration

Preprocessing module to construct fixed number of frames from a sample of event data.

__init__(split_by: str, frames_num: int) None[source]

Construct qualia_plugin_snn.preprocessing.IntegrateEventsByFixedFramesNumber.IntegrateEventsByFixedFramesNumber.

Parameters:
  • split_by (str) – 'time' or 'number', see spikingjelly.datasets.cal_fixed_frames_number_segment_index()

  • frames_num (int) – Number of frames to produce per sample

Return type:

None

__call__(datamodel: EventDataModel) RawDataModel[source]

Construct frames from events of the same sample of a qualia_plugin_snn.datamodel.EventDataModel.EventDataModel.

Relies on sample indices (begin, end) from the info array to only collect events from the same sample.

Input data should be 2D event data with (t, x, y, p) columns or 1D event data with (t, x, p) columns. Output data has [N, H, W, C] or [N, W, C] dimensions

Uses a derivative of SpikingJelly’s implementation of spikingjelly.datasets.integrate_events_by_fixed_frames_number()

Parameters:

datamodel (EventDataModel) – The input event-based dataset

Returns:

The new frame dataset

Return type:

RawDataModel

import_data(dataset: Dataset[Any]) Dataset[Any][source]
Parameters:

dataset (Dataset[Any])

Return type:

Dataset[Any]