vak.prep.unit_dataset.unit_dataset.Segment#

class vak.prep.unit_dataset.unit_dataset.Segment(data: ndarray[Any, dtype[_ScalarType_co]], samplerate: int, onset_s: float, offset_s: float, label: str, sample_dur: float, segment_dur: float, audio_path: str, annot_path: str)[source]#

Bases: object

Dataclass that represents a segment from segmented audio or spectrogram.

The attributes are metadata used to track the origin of this segment in a dataset of such segments.

The dataset including metadata is saved as a csv file where these attributes become the columns.

__init__(data: ndarray[Any, dtype[_ScalarType_co]], samplerate: int, onset_s: float, offset_s: float, label: str, sample_dur: float, segment_dur: float, audio_path: str, annot_path: str) None#

Method generated by attrs for class Segment.

Methods

__init__(data, samplerate, onset_s, ...)

Method generated by attrs for class Segment.

Attributes

data

samplerate

onset_s

offset_s

label

sample_dur

segment_dur

audio_path

annot_path