qualia_plugin_snn.preprocessing.Group2TimeStepsBySample module

Provide a preprocessing module to group frame data from same sample into timesteps.

class qualia_plugin_snn.preprocessing.Group2TimeStepsBySample.Group2TimeStepsBySample[source]

Bases: Preprocessing[RawDataModel, RawDataModel]

Preprocessing module to group frame data from same sample into timesteps.

__init__(timesteps: int) None[source]

Construct qualia_plugin_snn.preprocessing.Group2TimeStepsBySample.Group2TimeStepsBySample.

Parameters:

timesteps (int) – Number of timesteps to group frames from a sample

Return type:

None

__call__(datamodel: RawDataModel) RawDataModel[source]

Group frames from the same samples of from a qualia_core.datamodel.RawDataModel.RawDataModel into timesteps.

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

Input data should be 2D or 1D (+ channel) with [N, H, W, C] order (channels_last). Output data has [N // T, T, H, W, C] dimensions Extra data from a sample that do not fit in a timestep group is truncated.

Parameters:

datamodel (RawDataModel) – The input dataset

Returns:

The dataset with additional timestep dimension

Return type:

RawDataModel