vak.transforms.frame_labels.functional.segment_inds_list_from_boundary_labels

vak.transforms.frame_labels.functional.segment_inds_list_from_boundary_labels(boundary_labels: ndarray[Any, dtype[_ScalarType_co]], force_boundary_first_ind: bool = True) list[ndarray[Any, dtype[_ScalarType_co]]][source]

Given an array of boundary labels, return a list of numpy.ndarray vectors, each of which can be used to index one segment in a vector of frame labels.

Parameters:
  • boundary_labels (numpy.ndarray) – Vector of integers {0, 1}, where 1 indicates a boundary, and 0 indicates no boundary. Output of a frame classification model trained to classify each frame as “boundary” or “no boundary”.

  • force_boundary_first_ind (bool) – If True, and the first index of boundary_labels is not classified as a boundary, force it to be a boundary.

Returns:

segment_inds_list – Of fancy indexing arrays. Each array can be used to index one segment in frame_labels.

Return type:

list