crowsetta.formats.seq.yarden.SongAnnotationGUI#
- class crowsetta.formats.seq.yarden.SongAnnotationGUI(annotations: ndarray, audio_paths: ndarray, annot_path)[source]#
Bases:
object
Class that represents annotations from .mat files created by SongAnnotationGUI: yardencsGitHub/BirdSongBout
- audio_paths#
A
numpy
array where each element is a path to an audio file. Same length asannotations
. Each element inannotations
is 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
list
ofcrowsetta.Sequence
instances.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
list
ofcrowsetta.Annotation
instances.- Return type:
Notes
The
round_times
anddecimals
arguments 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
list
ofcrowsetta.Sequence
instances.We assume there is one
Sequence
per annotated song in the source annotations.- Parameters:
- Returns:
seqs – A
list
ofSequence
instances, one for each element inannotations
.- Return type:
Notes
The
round_times
anddecimals
arguments 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.