Track birdnet main: sensitivity only for 2.4-based models - #983
Conversation
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>
There was a problem hiding this comment.
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 inanalyze()andrun_inference(). - Disable the GUI sensitivity slider for BirdNET 3.0 and Perch, forcing display to
1.0when disabled. - Switch
birdnetdependency 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.
| sensitivity_update = ( | ||
| gr.update(interactive=True) | ||
| if model_supports_sensitivity(value) | ||
| else gr.update(interactive=False, value=1.0) | ||
| ) |
There was a problem hiding this comment.
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.
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>
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.