crowsetta.formats.seq.yarden.SongAnnotationGUI#
- class crowsetta.formats.seq.yarden.SongAnnotationGUI(annotations: ndarray, audio_paths: ndarray, annot_path)[source]#
Bases:
objectClass that represents annotations from .mat files created by SongAnnotationGUI: yardencsGitHub/BirdSongBout
- audio_paths#
A
numpyarray where each element is a path to an audio file. Same length asannotations. Each element inannotationsis the annotation for the corresponding path inaudio_paths.- Type:
- annot_path#
Path to mat file from which annotations were loaded.
- Type:
- __init__(annotations: ndarray, audio_paths: ndarray, annot_path) None#
Method generated by attrs for class SongAnnotationGUI.
Methods
__init__(annotations, audio_paths, annot_path)Method generated by attrs for class SongAnnotationGUI.
from_file(annot_path)Load annotations from mat files created by SongAnnotationGUI: yardencsGitHub/BirdSongBout
to_annot([round_times, decimals])Convert this annotation to a
crowsetta.Annotation.to_seq([round_times, decimals])Convert this set of annotations to a
listofcrowsetta.Sequenceinstances.Attributes
- classmethod from_file(annot_path: str | bytes | PathLike | Path) Self[source]#
Load annotations from mat files created by SongAnnotationGUI: yardencsGitHub/BirdSongBout
- Parameters:
annot_path (str, pathlib.Path) – Path to .mat file with annotations.
- to_annot(round_times: bool = True, decimals: int = 3) List[Annotation][source]#
Convert this annotation to a
crowsetta.Annotation.- Parameters:
- Returns:
annots – A
listofcrowsetta.Annotationinstances.- Return type:
Notes
The
round_timesanddecimalsarguments are provided to reduce differences across platforms due to floating point error, e.g. when loading annotation files and then sending them to a csv file, the result should be the same on Windows and Linux.
- to_seq(round_times: bool = True, decimals: int = 3) List[Sequence][source]#
Convert this set of annotations to a
listofcrowsetta.Sequenceinstances.We assume there is one
Sequenceper annotated song in the source annotations.- Parameters:
- Returns:
seqs – A
listofSequenceinstances, one for each element inannotations.- Return type:
Notes
The
round_timesanddecimalsarguments are provided to reduce differences across platforms due to floating point error, e.g. when loading annotation files and then sending them to a csv file, the result should be the same on Windows and Linux.