vak.common.annotation.has_unlabeled#

vak.common.annotation.has_unlabeled(annot: Annotation, duration: float) bool[source]#

Returns True if an annotated sequence has unlabeled segments.

Tests whether an instance of crowsetta.Annotation.seq has intervals between the annotated segments with a non-zero duration, or any unannotated periods before or after the annotated segments.

Parameters:
  • annot (crowsetta.Annotation) – A crowsetta.Annotation with a seq attribute (that is a crowsetta.Sequence).

  • duration (float) – Total duration of the vocalization that is annotated by annot. Needed to determine whether the duration is greater than the time of the last offset in the annotated segments.

Returns:

has_unlabeled – If True, there are unlabeled periods in the vocalization annotated by annot.

Return type:

bool