Skip to content

[DRAFT] Annotation#400

Draft
Gautzilla wants to merge 29 commits into
Project-OSmOSE:mainfrom
Gautzilla:annotation
Draft

[DRAFT] Annotation#400
Gautzilla wants to merge 29 commits into
Project-OSmOSE:mainfrom
Gautzilla:annotation

Conversation

@Gautzilla

Copy link
Copy Markdown
Contributor

🖼️ Annotation results are coming to OSEkit!

How does it work

The idea is to be able to load APLOSE results csv into OSEkit as a collection of new Annotation objects:

annotations = Annotation.from_csv(Path("aplose_results.csv"))

The annotations could then be filtered thanks to their properties :

image
verified_annotations = [
    a for a in annotations if all(v.is_validated for v in a.verifications)
]

Using the Annotation with OSEkit

The Annotation class inherits from the Event class: its begin and end properties can be used to access the audio corresponding to the annotation box easily, e.g.:

from osekit.core.audio_data import AudioData
from osekit.core.audio_dataset import AudioDataset
from osekit.core.audio_file import AudioFile

afs = [AudioFile(...)] # Or even project.origin_files with the Public API

annotation_audio_dataset = AudioDataset(
    [
        AudioData.from_files(
            files=afs,
            begin=annotation.begin,
            end=annotation.end,
        )
        for annotation in annotations
    ]
)

# Then you could e.g. plot each spectrogram with SpectroDataset.from_audio_dataset

@Gautzilla Gautzilla self-assigned this Jun 2, 2026
@Gautzilla Gautzilla added the Feature A new feature to add to OSEkit label Jun 2, 2026
@coveralls

coveralls commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 98.991% (+0.04%) from 98.955% — Gautzilla:annotation into Project-OSmOSE:main

Comment thread src/osekit/core/annotation.py Outdated
Comment thread src/osekit/core/annotation.py Outdated
"confidence_indicator_label",
"confidence_indicator_level",
"label",
"level",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The column names hasn't change on APLOSE side

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn good catch, I didn't see that my refactor affected also the dict keys!

I really should write an integration test before messing with everything 🥸

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature A new feature to add to OSEkit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants