Skip to content

Track birdnet main: sensitivity only for 2.4-based models - #983

Merged
Josef-Haupt merged 3 commits into
mainfrom
birdnet-main-sensitivity
Aug 17, 2026
Merged

Track birdnet main: sensitivity only for 2.4-based models#983
Josef-Haupt merged 3 commits into
mainfrom
birdnet-main-sensitivity

Conversation

@Josef-Haupt

Copy link
Copy Markdown
Member

birdnet 1.0.0 applied a second sigmoid to the 3.0 acoustic model (all confidences squashed into [0.5, 0.73], every species passing any threshold) and its 3.0 pb backend failed every inference. Both are fixed on birdnet main, which the dependency now points at as a direct URL; PyPI rejects direct-URL requirements, so it must become a version pin before publishing.

With the fix, the library rejects a sigmoid_sensitivity other than 1.0 for 3.0 (the exports apply the sigmoid in-graph). Sensitivity is settled once in analyze() via model_utils.effective_sensitivity: only BirdNET 2.4 and custom classifiers take it, 3.0/Perch runs coerce to 1.0 with a warning, so the params file, result columns and resume fingerprint record the value actually used. The GUI slider is disabled (and shown as 1.0) whenever 3.0 or Perch is selected, at build, on switch and on preset load. Documented in the breaking-changes page and the CLI help.

birdnet 1.0.0 applied a second sigmoid to the 3.0 acoustic model (all
confidences squashed into [0.5, 0.73], every species passing any threshold)
and its 3.0 pb backend failed every inference. Both are fixed on birdnet
main, which the dependency now points at as a direct URL; PyPI rejects
direct-URL requirements, so it must become a version pin before publishing.

With the fix, the library rejects a sigmoid_sensitivity other than 1.0 for
3.0 (the exports apply the sigmoid in-graph). Sensitivity is settled once
in analyze() via model_utils.effective_sensitivity: only BirdNET 2.4 and
custom classifiers take it, 3.0/Perch runs coerce to 1.0 with a warning,
so the params file, result columns and resume fingerprint record the value
actually used. The GUI slider is disabled (and shown as 1.0) whenever 3.0
or Perch is selected, at build, on switch and on preset load. Documented
in the breaking-changes page and the CLI help.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 17, 2026 11:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Tracks upstream birdnet main fixes and makes sensitivity behavior consistent with BirdNET 3.0’s in-graph sigmoid by coercing non-1.0 sensitivity to 1.0 (with a warning) except for BirdNET 2.4 and custom classifiers; updates CLI/docs and adjusts the GUI to disable sensitivity when it has no effect.

Changes:

  • Add supports_sensitivity() + effective_sensitivity() and apply coercion in analyze() and run_inference().
  • Disable the GUI sensitivity slider for BirdNET 3.0 and Perch, forcing display to 1.0 when disabled.
  • Switch birdnet dependency to a direct GitHub URL tarball and document the breaking change / CLI help text.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_model_utils.py Adds tests for sensitivity support rules and coercion for BirdNET 3.0 inference.
pyproject.toml Points birdnet dependency to a specific GitHub tarball (unreleased main).
docs/breaking-changes.rst Documents that sensitivity is ignored for BirdNET 3.0 and Perch, and what to do instead.
birdnet_analyzer/model_utils.py Introduces sensitivity support detection + coercion with warning; applies it before inference.
birdnet_analyzer/gui/utils.py Disables/enables sensitivity slider based on selected model (including on model switch).
birdnet_analyzer/cli.py Updates --sensitivity help text to reflect model-specific behavior.
birdnet_analyzer/analyze/core.py Settles effective sensitivity once so params/resume/outputs record the actually-used value.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread birdnet_analyzer/gui/utils.py Outdated
Comment on lines +638 to +642
sensitivity_update = (
gr.update(interactive=True)
if model_supports_sensitivity(value)
else gr.update(interactive=False, value=1.0)
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 4fa31e1: re-enabling now restores the persisted sensitivity_slider value (read live from the tab settings, since slider release persists it) and clamps it to the slider range. Covered by tests/gui/test_sensitivity_slider.py, which drives the radio's change handler through 2.4 → 3.0 → 2.4 → Perch.

Josef-Haupt and others added 2 commits August 17, 2026 13:41
Disabling the slider for 3.0/Perch shows 1.0; switching back to 2.4 or a
custom classifier now brings back the value the user last set (read from
the persisted tab settings, which slider release writes) instead of leaving
1.0 in place for the rest of the session. Round trip covered by a test that
drives the model radio's change handler.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The species-list block draws a plotly map while building; plotly is a
gui-only extra that CI's gui-tests job does not install.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Josef-Haupt
Josef-Haupt merged commit 6d0dfa2 into main Aug 17, 2026
13 checks passed
@Josef-Haupt
Josef-Haupt deleted the birdnet-main-sensitivity branch August 17, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants