bex-bioacoustics 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. bex_bioacoustics-1.0.0/.gitignore +24 -0
  2. bex_bioacoustics-1.0.0/.streamlit/config.toml +9 -0
  3. bex_bioacoustics-1.0.0/LICENSE +202 -0
  4. bex_bioacoustics-1.0.0/PKG-INFO +202 -0
  5. bex_bioacoustics-1.0.0/PLAN.md +986 -0
  6. bex_bioacoustics-1.0.0/README.md +170 -0
  7. bex_bioacoustics-1.0.0/V1.md +858 -0
  8. bex_bioacoustics-1.0.0/app.py +38 -0
  9. bex_bioacoustics-1.0.0/assets/mission_flow.svg +122 -0
  10. bex_bioacoustics-1.0.0/bex/__init__.py +7 -0
  11. bex_bioacoustics-1.0.0/bex/adapters.py +90 -0
  12. bex_bioacoustics-1.0.0/bex/audio.py +93 -0
  13. bex_bioacoustics-1.0.0/bex/benchmark.py +347 -0
  14. bex_bioacoustics-1.0.0/bex/cli.py +146 -0
  15. bex_bioacoustics-1.0.0/bex/config.py +152 -0
  16. bex_bioacoustics-1.0.0/bex/geofilter.py +157 -0
  17. bex_bioacoustics-1.0.0/bex/ingest.py +238 -0
  18. bex_bioacoustics-1.0.0/bex/melcache.py +126 -0
  19. bex_bioacoustics-1.0.0/bex/metrics.py +345 -0
  20. bex_bioacoustics-1.0.0/bex/player.py +116 -0
  21. bex_bioacoustics-1.0.0/bex/profiles.py +140 -0
  22. bex_bioacoustics-1.0.0/bex/repair.py +82 -0
  23. bex_bioacoustics-1.0.0/bex/schemas.py +206 -0
  24. bex_bioacoustics-1.0.0/bex/scorecard.py +343 -0
  25. bex_bioacoustics-1.0.0/bex/stats.py +506 -0
  26. bex_bioacoustics-1.0.0/bex/store.py +172 -0
  27. bex_bioacoustics-1.0.0/bex/taxonomy.py +151 -0
  28. bex_bioacoustics-1.0.0/bex/thresholds.py +454 -0
  29. bex_bioacoustics-1.0.0/bex/truth.py +379 -0
  30. bex_bioacoustics-1.0.0/bex/views.py +779 -0
  31. bex_bioacoustics-1.0.0/bex/windows.py +108 -0
  32. bex_bioacoustics-1.0.0/bex.example.toml +31 -0
  33. bex_bioacoustics-1.0.0/envs/README.md +21 -0
  34. bex_bioacoustics-1.0.0/envs/birdnet/README.md +35 -0
  35. bex_bioacoustics-1.0.0/envs/birdnet/requirements.txt +7 -0
  36. bex_bioacoustics-1.0.0/envs/birdnet/run.py +172 -0
  37. bex_bioacoustics-1.0.0/envs/perch/README.md +79 -0
  38. bex_bioacoustics-1.0.0/envs/perch/embed.py +168 -0
  39. bex_bioacoustics-1.0.0/envs/perch/requirements.txt +10 -0
  40. bex_bioacoustics-1.0.0/envs/perch/run.py +315 -0
  41. bex_bioacoustics-1.0.0/profiles/uk-starter/profile.toml +6 -0
  42. bex_bioacoustics-1.0.0/profiles/uk-starter/tiers.csv +108 -0
  43. bex_bioacoustics-1.0.0/profiles/us-ca-sierra/profile.toml +6 -0
  44. bex_bioacoustics-1.0.0/profiles/us-ca-sierra/tiers.csv +57 -0
  45. bex_bioacoustics-1.0.0/pyproject.toml +74 -0
  46. bex_bioacoustics-1.0.0/scripts/compare.py +152 -0
  47. bex_bioacoustics-1.0.0/scripts/crosscheck.py +152 -0
  48. bex_bioacoustics-1.0.0/scripts/evaluate.py +187 -0
  49. bex_bioacoustics-1.0.0/scripts/forensics.py +149 -0
  50. bex_bioacoustics-1.0.0/tests/conftest.py +30 -0
  51. bex_bioacoustics-1.0.0/tests/test_adapters.py +82 -0
  52. bex_bioacoustics-1.0.0/tests/test_app.py +297 -0
  53. bex_bioacoustics-1.0.0/tests/test_benchmark.py +131 -0
  54. bex_bioacoustics-1.0.0/tests/test_cli.py +42 -0
  55. bex_bioacoustics-1.0.0/tests/test_config.py +22 -0
  56. bex_bioacoustics-1.0.0/tests/test_geofilter.py +99 -0
  57. bex_bioacoustics-1.0.0/tests/test_ingest.py +107 -0
  58. bex_bioacoustics-1.0.0/tests/test_melcache.py +85 -0
  59. bex_bioacoustics-1.0.0/tests/test_metrics.py +269 -0
  60. bex_bioacoustics-1.0.0/tests/test_player.py +29 -0
  61. bex_bioacoustics-1.0.0/tests/test_profiles.py +79 -0
  62. bex_bioacoustics-1.0.0/tests/test_repair.py +41 -0
  63. bex_bioacoustics-1.0.0/tests/test_schemas.py +115 -0
  64. bex_bioacoustics-1.0.0/tests/test_scorecard.py +330 -0
  65. bex_bioacoustics-1.0.0/tests/test_stats.py +275 -0
  66. bex_bioacoustics-1.0.0/tests/test_store.py +113 -0
  67. bex_bioacoustics-1.0.0/tests/test_taxonomy.py +68 -0
  68. bex_bioacoustics-1.0.0/tests/test_thresholds.py +186 -0
  69. bex_bioacoustics-1.0.0/tests/test_truth.py +389 -0
  70. bex_bioacoustics-1.0.0/tests/test_views.py +353 -0
  71. bex_bioacoustics-1.0.0/tests/test_views_nav.py +140 -0
  72. bex_bioacoustics-1.0.0/tests/test_windows.py +74 -0
  73. bex_bioacoustics-1.0.0/ui/__init__.py +1 -0
  74. bex_bioacoustics-1.0.0/ui/common.py +412 -0
  75. bex_bioacoustics-1.0.0/ui/pages/about.py +76 -0
  76. bex_bioacoustics-1.0.0/ui/pages/compare.py +395 -0
  77. bex_bioacoustics-1.0.0/ui/pages/explorer.py +621 -0
  78. bex_bioacoustics-1.0.0/ui/pages/forensics.py +420 -0
  79. bex_bioacoustics-1.0.0/ui/pages/home.py +127 -0
  80. bex_bioacoustics-1.0.0/ui/pages/models.py +99 -0
  81. bex_bioacoustics-1.0.0/ui/pages/recordings.py +70 -0
  82. bex_bioacoustics-1.0.0/ui/pages/scorecard.py +503 -0
  83. bex_bioacoustics-1.0.0/ui/pages/thresholds.py +318 -0
  84. bex_bioacoustics-1.0.0/ui/sidebar.py +249 -0
@@ -0,0 +1,24 @@
1
+ # Local config (copy bex.example.toml -> bex.toml)
2
+ bex.toml
3
+
4
+ # Hot-tier data — regenerable, never committed
5
+ store/
6
+ cache/
7
+
8
+ # Virtual environments (app env here; runner envs under envs/*/)
9
+ .venv/
10
+ envs/*/.venv/
11
+
12
+ # Data that must never land in the repo (PLAN.md §8 rule 4)
13
+ data/audio
14
+ *.flac
15
+ *.wav
16
+ *.mp3
17
+
18
+ # Python
19
+ __pycache__/
20
+ *.egg-info/
21
+ .pytest_cache/
22
+
23
+ # uv lockfile: the documented install is pip; a stale lock would mislead
24
+ uv.lock
@@ -0,0 +1,9 @@
1
+ # BEX theme: the brand's petrol teal as the accent colour (buttons, sliders,
2
+ # selected options, tags). The dark theme uses a slightly lighter teal, still
3
+ # deep enough for white text on it to stay legible (4.1:1). The palette is
4
+ # described in V1.md (HM1); ui/common.py (BRAND) holds the logo colours.
5
+ [theme.light]
6
+ primaryColor = "#3e6a6b"
7
+
8
+ [theme.dark]
9
+ primaryColor = "#4f868c"
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.5
2
+ Name: bex-bioacoustics
3
+ Version: 1.0.0
4
+ Summary: BEX, the Bioacoustics Explorer: benchmark bioacoustic ID models on your own recordings, with the geographic filter made visible
5
+ Project-URL: Homepage, https://github.com/donora/bex
6
+ Project-URL: Source, https://github.com/donora/bex
7
+ Project-URL: Issues, https://github.com/donora/bex/issues
8
+ Author-email: Mara Donora <mara.donora@gmail.com>
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: benchmark,bioacoustics,bird song,birdnet,ecology,passive acoustic monitoring,perch
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
17
+ Requires-Python: >=3.12
18
+ Requires-Dist: altair>=5.0
19
+ Requires-Dist: audioread>=3.0
20
+ Requires-Dist: librosa>=0.10
21
+ Requires-Dist: matplotlib>=3.8
22
+ Requires-Dist: numpy>=1.26
23
+ Requires-Dist: pandas>=2.0
24
+ Requires-Dist: polars>=1.0
25
+ Requires-Dist: pyarrow>=15.0
26
+ Requires-Dist: soundfile>=0.12
27
+ Requires-Dist: streamlit-image-coordinates>=0.4
28
+ Requires-Dist: streamlit>=1.63
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=8.0; extra == 'dev'
31
+ Description-Content-Type: text/markdown
32
+
33
+ # BEX — Bioacoustics Explorer
34
+
35
+ **Benchmark and compare bioacoustic identification models on your own recordings.**
36
+
37
+ Every bioacoustic project makes processing decisions: which model to process the data, which confidence
38
+ threshold, whether to trust the model's location filter, etc. BEX runs your recordings
39
+ through several models (currently BirdNET and Perch - can also add your own models), scores each against the same
40
+ ground truth, and helps you design and quantify on a pipeline with a known precision and recall
41
+ for every species. It also makes **the geographic filter visible**: what each model
42
+ predicted before its location prior silenced it, and how often that filter hides a
43
+ bird that was really there.
44
+
45
+ BEX is a local app (Streamlit) plus a command line. It processes local audio.
46
+
47
+ ## What's in the app
48
+
49
+ - **Explorer** — one recording at a time: a navigator over the whole recording
50
+ (where each model was right, wrong, or silent), the spectrogram with the
51
+ annotators' boxes, a score lane per model, an audio player on the same time axis,
52
+ and a window inspector.
53
+ - **Compare models** — what each model would give you at your threshold rule: how
54
+ often it is right when it reports a bird, how many songs it finds, false
55
+ detections per hour, precision–recall, and species by species.
56
+ - **Species scorecard** — one bird at a time: what each model found and missed,
57
+ on which recordings, and what it confuses the bird with.
58
+ - **Geofilter forensics** — what a location filter hides, what that costs each
59
+ model in precision and recall, and which birds it suppresses most.
60
+ - **Thresholds** — every model's threshold for every species, fitted by a rule
61
+ (e.g. "95% precision"), overridable by hand, and saved as named sets you can
62
+ apply to recordings that have no annotations.
63
+
64
+ The sidebar holds the experiment's settings (dataset, models, plausibility
65
+ profile, threshold rule) and keeps them as you move between pages.
66
+
67
+ - **NB** - This app can ingest the Sierra Nevada soundscape (open-source, labelled, 33x1hr recordings with expert birdsong labels) as a demonstration set. See below ('Scoring needs annotations') for instructions.
68
+
69
+ ## Install
70
+
71
+ Python 3.12. Developed and tested on macOS (Apple silicon).
72
+
73
+ ```bash
74
+ python3.12 -m venv .venv
75
+ .venv/bin/pip install bex-bioacoustics
76
+ ```
77
+
78
+ The package is `bex-bioacoustics`; the command and the Python import are `bex`.
79
+
80
+ ## Quick start with your own recordings
81
+
82
+ **1. Make a project folder.** BEX keeps its working data (scores, spectrograms,
83
+ threshold sets) here, and finds it again through the `bex.toml` it writes.
84
+
85
+ ```bash
86
+ mkdir my-project && cd my-project
87
+ bex init
88
+ ```
89
+
90
+ **2. Scan a folder of recordings** (WAV, FLAC, MP3 or OGG; subfolders too). Files
91
+ stay where they are. The location is what BirdNET's filter needs; recording times
92
+ are read from AudioMoth-style filenames.
93
+
94
+ ```bash
95
+ bex scan /path/to/recordings --name my-site --site "Glen Affric" --lat 57.25 --lon -4.92
96
+ bex melcache my-site # the spectrograms the Explorer draws (resumable)
97
+ bex repair my-site # only if some files will not decode
98
+ ```
99
+
100
+ **3. Run the models.** Each model runs in its own environment, because BirdNET and
101
+ Perch cannot share dependencies with each other or with the app. The runners live
102
+ in this repository, so clone it once:
103
+
104
+ ```bash
105
+ git clone https://github.com/donora/bex bex-src
106
+ cd bex-src/envs/birdnet
107
+ python3.12 -m venv .venv
108
+ .venv/bin/pip install -r requirements.txt
109
+ .venv/bin/pip install bex-bioacoustics --no-deps
110
+ BEX_CONFIG=/path/to/my-project/bex.toml .venv/bin/python run.py --dataset my-site
111
+ ```
112
+
113
+ Perch is the same in `envs/perch` (it needs TensorFlow, so expect a larger install
114
+ and ~80 s per hour of audio against BirdNET's ~5 s). Model weights download on
115
+ first run. See [envs/birdnet](envs/birdnet/) and [envs/perch](envs/perch/).
116
+
117
+ **4. Open the app.**
118
+
119
+ ```bash
120
+ bex app
121
+ ```
122
+
123
+ ### Scoring needs annotations
124
+
125
+ Everything above works on unlabelled audio: you can explore every model's
126
+ detections, and apply a saved threshold set. **However, comparing models against ground
127
+ truth needs annotations**, and in this version the only importer is for the
128
+ annotated Sierra Nevada soundscape set that BEX was built on (`bex ingest-sne`;
129
+ point `audio_dir` and `labels_dir` in `bex.toml` at your copy). A general importer
130
+ for your own annotations, and a labelling mode in the Explorer, are next on the
131
+ roadmap.
132
+
133
+ ## Results so far
134
+
135
+ On 33 h of strongly annotated Sierra Nevada soundscapes (56 species):
136
+
137
+ | model | cmAP | micro AP |
138
+ |---|---|---|
139
+ | BirdNET 2.4 | **0.485** | **0.817** |
140
+ | Perch v2 (sigmoid, float32) | 0.375 | 0.646 |
141
+ | Perch v2 (softmax) | 0.363 | 0.646 |
142
+
143
+ - **BirdNET's location filter mostly hides real birds here.** Of the detections
144
+ it suppresses, most were annotated in that very window; one abundant resident
145
+ (Fox Sparrow, just under the filter's occurrence cutoff) accounts for most of it.
146
+ - **There is no single good threshold.** Reaching 95% precision takes a threshold
147
+ anywhere from 0.18 to 0.98 for BirdNET depending on the species, which is why
148
+ BEX thresholds species by species.
149
+ - **Perch is far "muddier"** — many more species scoring confidently in the same
150
+ window, much of it between close relatives — while finding more of the
151
+ annotated species at a matched number of detections.
152
+
153
+ Every number is reproducible headlessly (`scripts/evaluate.py`,
154
+ `scripts/compare.py`, `scripts/forensics.py`) and re-derived from the raw score
155
+ matrices by `scripts/crosscheck.py`. [PLAN.md](PLAN.md) has the full account,
156
+ including two representation traps (softmax readout, float16 storage) that were
157
+ distorting the comparison and how they were resolved.
158
+
159
+ ## Roadmap
160
+
161
+ - **Label your own data in the Explorer** — minute-by-minute labelling with the
162
+ models' suggestions as a guide, signed-off chunks, and versioned label sets
163
+ (PLAN.md, Stage 6.5).
164
+ - An importer for your own annotations.
165
+ - More models: region-tuned classifiers, BirdNET custom classifiers, new Perch
166
+ releases.
167
+
168
+ [PLAN.md](PLAN.md) is the design document (architecture, metric definitions,
169
+ staged roadmap); [V1.md](V1.md) records how version 1 of the app was designed.
170
+
171
+ ## Licences
172
+
173
+ BEX is Apache-2.0 (see [LICENSE](LICENSE)). It ships **no model weights and no
174
+ audio**: you download the models yourself when you set up the runners, and their
175
+ own licences apply to your use of them.
176
+
177
+ - **BirdNET**'s model weights (including its location model) are
178
+ **CC BY-NC-SA 4.0: non-commercial use only.** Research, conservation and
179
+ personal use are fine; using BirdNET for paid work needs a commercial licence
180
+ from the BirdNET team.
181
+ - **Perch** is Apache-2.0.
182
+ - Xeno-Canto recordings BEX links to are licensed per recording by their recordists.
183
+
184
+ ## Development
185
+
186
+ ```bash
187
+ git clone https://github.com/donora/bex && cd bex
188
+ python3.12 -m venv .venv
189
+ .venv/bin/pip install -e ".[dev]"
190
+ .venv/bin/pytest # runs without audio or models; app tests skip without a store
191
+ bex app # or: .venv/bin/streamlit run app.py
192
+ ```
193
+
194
+ ```
195
+ app.py the app's entry point: page setup and navigation
196
+ ui/ the app — sidebar.py (settings), common.py (shared), pages/ (one per page)
197
+ bex/ the library — every number the app shows is computed here
198
+ profiles/ plausibility profiles (bring your own — PLAN.md §3c)
199
+ envs/ one isolated runner environment per model (PLAN.md §3b)
200
+ scripts/ the headless versions of the app's analyses
201
+ tests/ tests, runnable without audio, models, or the store
202
+ ```