dcase_util.data.DecisionEncoder.find_contiguous_regions

DecisionEncoder.find_contiguous_regions(activity_array)[source]

Find contiguous regions from bool valued numpy.array. Transforms boolean values for each frame into pairs of onsets and offsets.

Parameters
activity_arraynumpy.array [shape=(t)]

Event activity array, bool values

Returns
numpy.ndarray [shape=(2, number of found changes)]

Onset and offset indices pairs in matrix