-
Notifications
You must be signed in to change notification settings - Fork 68
PTDT-3807: Add temporal audio annotation support #2013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
PTDT-3807: Add temporal audio annotation support #2013
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
8e06a7a
to
2361ca3
Compare
3e51273
to
59f0cd8
Compare
d186b38
to
b186359
Compare
f0a0723
to
e63b306
Compare
0683dfd
to
6b54e26
Compare
# Use the modular hierarchy builder to create NDJSON annotations | ||
ndjson_annotations = create_audio_ndjson_annotations( | ||
audio_annotations, | ||
label.data.global_key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Audio Annotation Method Relies on Unreliable Attribute
The _create_audio_annotations
method directly accesses label.data.global_key
. However, label.data
isn't guaranteed to always have this attribute (it might use uid
or external_id
), which can cause an AttributeError
during audio annotation processing.
Description
This PR introduces Audio Temporal Annotations - a new feature that enables precise time-based annotations for audio files in the Labelbox SDK. This includes support for temporal classification annotations with millisecond-level timing precision.
Motivation: Audio annotation workflows require precise timing control for applications like:
Context: This feature extends the existing audio annotation infrastructure to support temporal annotations, using a millisecond-based timing system that provides the precision needed for audio applications while maintaining compatibility with the existing NDJSON serialization format.
Type of change
All Submissions
New Feature Submissions
Changes to Core Features
Summary of Changes
New Audio Temporal Annotation Types
AudioClassificationAnnotation
: Time-based classifications (radio, checklist, text) for audio segmentsCore Infrastructure Updates
TemporalFrame
,AnnotationGroupManager
,ValueGrouper
, andHierarchyBuilder
componentstemporal.py
module with generic components that can be reused for video, audio, and other temporal annotation typesCode Architecture Improvements
Generic[TemporalAnnotation]
for compile-time type checkingframe_extractor
callable allows different annotation types to use the same processing logicoverlaps()
method and improved temporal containment logiccreate_audio_ndjson_annotations()
convenience functionTesting
test_v3_serialization.py
(attached at the bottom) that validates both structure and valuesDocumentation & Examples
audio.ipynb
with temporal annotation examplesdemo_audio_token_temporal.py
showing per-token temporal annotationsSerialization & Import Support
Key Features
Precise Timing Control
Per-Token Temporal Annotations
Ontology Setup for Temporal Annotations
Label Integration
Technical Architecture
Generic Temporal Components
The refactored architecture provides reusable components for any temporal annotation type:
This feature enables the Labelbox SDK to support precise temporal audio annotation workflows while providing a robust, reusable architecture for future temporal annotation types. The modular design ensures maintainability and extensibility while preserving full backward compatibility.
Click to expand: Python Script
Note
Adds temporal audio classification annotations with start/end frames, NDJSON serialization, tests, and updated examples.
AudioClassificationAnnotation
withstart_frame
/end_frame
/segment_index
inlabelbox/data/annotation_types/audio.py
and export in__init__.py
.ClassificationAnswer
andClassificationAnnotation
to optionally carrystart_frame
/end_frame
for nested temporal data.Label
to acceptAudioClassificationAnnotation
and include audio inframe_annotations
.serialization/ndjson/temporal.py
with genericcreate_temporal_ndjson_annotations
and audio helpercreate_audio_ndjson_annotations
to build hierarchical temporal NDJSON.serialization/ndjson/label.py
to emit audio temporal annotations and exclude them from non-video flow; small error message fix.tests/data/serialization/ndjson/test_audio.py
.examples/annotation_import/audio.ipynb
with temporal token annotations, ontology INDEX-scoped text class, and MAL upload flow.examples/README.md
tables.Written by Cursor Bugbot for commit 66e4c44. This will update automatically on new commits. Configure here.