vak.transforms.frame_labels.functional.to_inds_list#
- vak.transforms.frame_labels.functional.to_inds_list(frame_labels: ndarray, unlabeled_label: int = 0) list[ndarray] [source]#
Given a vector of frame labels, returns a list of indexing vectors, one for each labeled segment in the vector.
- Parameters:
frame_labels (numpy.ndarray) – A vector where each element represents a label for a frame, either a single sample in audio or a single time bin from a spectrogram.
unlabeled_label (int) – Label that was given to segments that were not labeled in annotation, e.g. silent periods between annotated segments. Default is 0.
return_inds (bool) – If True, return list of indices for segments in frame_labels, in addition to the segments themselves. If False, just return list of numpy.ndarrays that are the segments from frame_labels.
- Returns:
segment_inds_list – of numpy.ndarray, indices that will recover segments list from frame_labels.
- Return type: