vak.transforms.frame_labels.functional#
Functional forms of transformations related to frame labels, i.e., vectors where each element represents a label for a frame, either a single sample in audio or a single time bin from a spectrogram.
This module is structured as followed: - from_segments: transform to get frame labels from annotations - to_labels: transform to get back just string labels from frame labels,
used to evaluate a model
to_segments: transform to get back segment onsets, offsets, and labels from frame labels. Inverse of
from_segments
.post-processing transforms that can be used to “clean up” a vector of frame labels - to_inds_list: helper function used to find segments in a vector of frame labels - remove_short_segments: remove any segment less than a minimum duration - take_majority_vote: take a “majority vote” within each segment bounded by the “unlabeled” label,
and apply the most “popular” label within each segment to all timebins in that segment
postprocess: combines remove_short_segments and take_majority_vote in one transform
Functions
|
Make a vector of labels for a vector of frames, given labeled segments in the form of onset times, offset times, and segment labels. |
|
Apply post-processing transformations to a vector of frame labels. |
|
Remove segments from vector of frame labels that are shorter than a specified duration. |
|
Transform segments containing multiple labels into segments with a single label by taking a "majority vote", i.e. assign all frames in the segment the most frequently occurring label in the segment. |
|
Given a vector of frame labels, returns a list of indexing vectors, one for each labeled segment in the vector. |
|
Convert vector of frame labels to a string, one character for each continuous segment. |
|
Convert a vector of frame labels into segments in the form of onset indices, offset indices, and labels. |