crowsetta.BBox#
- class crowsetta.BBox(onset: float, offset: float, low_freq: float, high_freq: float, label: str)[source]#
Bases:
object
A class that represents a bounding box on a spectrogram, drawn around animal communication or other sounds.
Examples
A toy example of a bounding box-like annotation.
>>> bbox1 = crowsetta.BBox(label='Pinacosaurus grangeri', onset=1.0, offset=2.0, low_freq=3e3, high_freq=1e4) >>> bbox2 = crowsetta.BBox(label='Pinacosaurus grangeri', onset=3.0, offset=4.0, low_freq=3.25e3, high_freq=1.25e4) >>> bboxes = [bbox1, bbox2] >>> annot = crowsetta.Annotation(notated_path='prebird1.wav', annot_path='prebird1.csv', bboxes=bboxes) >>> print(annot) Annotation(annot_path=PosixPath('prebird1.csv'), notated_path=PosixPath('prebird1.wav'), bboxes=[BBox(onset=1.0, offset=2.0, low_freq=3000.0, high_freq=10000.0, label='Pinacosaurus grangeri'), BBox(onset=3.0, offset=4.0, low_freq=3250.0, high_freq=12500.0, label='Pinacosaurus grangeri')]) # noqa
- __init__(onset: float, offset: float, low_freq: float, high_freq: float, label: str) None #
Method generated by attrs for class BBox.
Methods
__init__
(onset, offset, low_freq, high_freq, ...)Method generated by attrs for class BBox.
lt_high_freq
(attribute, value)lt_offset
(attribute, value)Attributes