birdnet-analyzer 2.1.0__py3-none-any.whl → 2.1.1__py3-none-any.whl
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.
- birdnet_analyzer/__init__.py +9 -9
- birdnet_analyzer/analyze/__init__.py +19 -19
- birdnet_analyzer/analyze/__main__.py +3 -3
- birdnet_analyzer/analyze/cli.py +30 -30
- birdnet_analyzer/analyze/core.py +268 -246
- birdnet_analyzer/analyze/utils.py +700 -694
- birdnet_analyzer/audio.py +368 -368
- birdnet_analyzer/cli.py +732 -732
- birdnet_analyzer/config.py +243 -243
- birdnet_analyzer/eBird_taxonomy_codes_2024E.json +13045 -13045
- birdnet_analyzer/embeddings/__init__.py +3 -3
- birdnet_analyzer/embeddings/__main__.py +3 -3
- birdnet_analyzer/embeddings/cli.py +12 -12
- birdnet_analyzer/embeddings/core.py +70 -70
- birdnet_analyzer/embeddings/utils.py +173 -220
- birdnet_analyzer/evaluation/__init__.py +189 -189
- birdnet_analyzer/evaluation/__main__.py +3 -3
- birdnet_analyzer/evaluation/assessment/metrics.py +388 -388
- birdnet_analyzer/evaluation/assessment/performance_assessor.py +364 -364
- birdnet_analyzer/evaluation/assessment/plotting.py +378 -378
- birdnet_analyzer/evaluation/preprocessing/data_processor.py +631 -631
- birdnet_analyzer/evaluation/preprocessing/utils.py +98 -98
- birdnet_analyzer/gui/__init__.py +19 -19
- birdnet_analyzer/gui/__main__.py +3 -3
- birdnet_analyzer/gui/analysis.py +179 -179
- birdnet_analyzer/gui/assets/arrow_down.svg +4 -4
- birdnet_analyzer/gui/assets/arrow_left.svg +4 -4
- birdnet_analyzer/gui/assets/arrow_right.svg +4 -4
- birdnet_analyzer/gui/assets/arrow_up.svg +4 -4
- birdnet_analyzer/gui/assets/gui.css +36 -36
- birdnet_analyzer/gui/assets/gui.js +89 -93
- birdnet_analyzer/gui/embeddings.py +638 -638
- birdnet_analyzer/gui/evaluation.py +801 -801
- birdnet_analyzer/gui/localization.py +75 -75
- birdnet_analyzer/gui/multi_file.py +265 -265
- birdnet_analyzer/gui/review.py +472 -472
- birdnet_analyzer/gui/segments.py +191 -191
- birdnet_analyzer/gui/settings.py +149 -149
- birdnet_analyzer/gui/single_file.py +264 -264
- birdnet_analyzer/gui/species.py +95 -95
- birdnet_analyzer/gui/train.py +687 -687
- birdnet_analyzer/gui/utils.py +803 -797
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_af.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_ar.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_bg.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_ca.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_cs.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_da.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_de.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_el.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_en_uk.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_es.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_fi.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_fr.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_he.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_hr.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_hu.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_in.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_is.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_it.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_ja.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_ko.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_lt.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_ml.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_nl.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_no.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_pl.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_pt_BR.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_pt_PT.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_ro.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_ru.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_sk.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_sl.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_sr.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_sv.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_th.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_tr.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_uk.txt +6522 -6522
- birdnet_analyzer/labels/V2.4/BirdNET_GLOBAL_6K_V2.4_Labels_zh.txt +6522 -6522
- birdnet_analyzer/lang/de.json +342 -341
- birdnet_analyzer/lang/en.json +342 -341
- birdnet_analyzer/lang/fi.json +342 -341
- birdnet_analyzer/lang/fr.json +342 -341
- birdnet_analyzer/lang/id.json +342 -341
- birdnet_analyzer/lang/pt-br.json +342 -341
- birdnet_analyzer/lang/ru.json +342 -341
- birdnet_analyzer/lang/se.json +342 -341
- birdnet_analyzer/lang/tlh.json +342 -341
- birdnet_analyzer/lang/zh_TW.json +342 -341
- birdnet_analyzer/model.py +1213 -1212
- birdnet_analyzer/search/__init__.py +3 -3
- birdnet_analyzer/search/__main__.py +3 -3
- birdnet_analyzer/search/cli.py +11 -11
- birdnet_analyzer/search/core.py +78 -78
- birdnet_analyzer/search/utils.py +104 -107
- birdnet_analyzer/segments/__init__.py +3 -3
- birdnet_analyzer/segments/__main__.py +3 -3
- birdnet_analyzer/segments/cli.py +13 -13
- birdnet_analyzer/segments/core.py +81 -81
- birdnet_analyzer/segments/utils.py +383 -383
- birdnet_analyzer/species/__init__.py +3 -3
- birdnet_analyzer/species/__main__.py +3 -3
- birdnet_analyzer/species/cli.py +13 -13
- birdnet_analyzer/species/core.py +35 -35
- birdnet_analyzer/species/utils.py +73 -74
- birdnet_analyzer/train/__init__.py +3 -3
- birdnet_analyzer/train/__main__.py +3 -3
- birdnet_analyzer/train/cli.py +13 -13
- birdnet_analyzer/train/core.py +113 -113
- birdnet_analyzer/train/utils.py +878 -877
- birdnet_analyzer/translate.py +132 -133
- birdnet_analyzer/utils.py +425 -425
- {birdnet_analyzer-2.1.0.dist-info → birdnet_analyzer-2.1.1.dist-info}/METADATA +147 -146
- birdnet_analyzer-2.1.1.dist-info/RECORD +124 -0
- {birdnet_analyzer-2.1.0.dist-info → birdnet_analyzer-2.1.1.dist-info}/licenses/LICENSE +18 -18
- birdnet_analyzer/playground.py +0 -5
- birdnet_analyzer-2.1.0.dist-info/RECORD +0 -125
- {birdnet_analyzer-2.1.0.dist-info → birdnet_analyzer-2.1.1.dist-info}/WHEEL +0 -0
- {birdnet_analyzer-2.1.0.dist-info → birdnet_analyzer-2.1.1.dist-info}/entry_points.txt +0 -0
- {birdnet_analyzer-2.1.0.dist-info → birdnet_analyzer-2.1.1.dist-info}/top_level.txt +0 -0
birdnet_analyzer/gui/species.py
CHANGED
@@ -1,95 +1,95 @@
|
|
1
|
-
import os
|
2
|
-
|
3
|
-
import gradio as gr
|
4
|
-
|
5
|
-
import birdnet_analyzer.config as cfg
|
6
|
-
import birdnet_analyzer.gui.localization as loc
|
7
|
-
import birdnet_analyzer.gui.utils as gu
|
8
|
-
from birdnet_analyzer.gui import settings
|
9
|
-
|
10
|
-
|
11
|
-
@gu.gui_runtime_error_handler
|
12
|
-
def run_species_list(out_path, filename, lat, lon, week, use_yearlong, sf_thresh, sortby):
|
13
|
-
from birdnet_analyzer.species.utils import run
|
14
|
-
|
15
|
-
gu.validate(out_path, loc.localize("validation-no-directory-selected"))
|
16
|
-
|
17
|
-
run(
|
18
|
-
os.path.join(out_path, filename if filename else "species_list.txt"),
|
19
|
-
lat,
|
20
|
-
lon,
|
21
|
-
-1 if use_yearlong else week,
|
22
|
-
sf_thresh,
|
23
|
-
sortby,
|
24
|
-
)
|
25
|
-
|
26
|
-
gr.Info(f"{loc.localize('species-tab-finish-info')} {cfg.OUTPUT_PATH}")
|
27
|
-
|
28
|
-
|
29
|
-
def build_species_tab():
|
30
|
-
with gr.Tab(loc.localize("species-tab-title")) as species_tab:
|
31
|
-
output_directory_state = gr.State()
|
32
|
-
select_directory_btn = gr.Button(loc.localize("species-tab-select-output-directory-button-label"))
|
33
|
-
classifier_name = gr.Textbox(
|
34
|
-
"species_list.txt",
|
35
|
-
visible=False,
|
36
|
-
info=loc.localize("species-tab-filename-textbox-label"),
|
37
|
-
)
|
38
|
-
|
39
|
-
def select_directory_and_update_tb(name_tb):
|
40
|
-
dir_name = gu.select_folder(state_key="species-output-dir")
|
41
|
-
|
42
|
-
if dir_name:
|
43
|
-
settings.set_state("species-output-dir", dir_name)
|
44
|
-
return (
|
45
|
-
dir_name,
|
46
|
-
gr.Textbox(label=dir_name, visible=True, value=name_tb),
|
47
|
-
)
|
48
|
-
|
49
|
-
return None, name_tb
|
50
|
-
|
51
|
-
select_directory_btn.click(
|
52
|
-
select_directory_and_update_tb,
|
53
|
-
inputs=classifier_name,
|
54
|
-
outputs=[output_directory_state, classifier_name],
|
55
|
-
show_progress=
|
56
|
-
)
|
57
|
-
|
58
|
-
lat_number, lon_number, week_number, sf_thresh_number, yearlong_checkbox, map_plot = (
|
59
|
-
gu.species_list_coordinates(show_map=True)
|
60
|
-
)
|
61
|
-
|
62
|
-
sortby = gr.Radio(
|
63
|
-
[
|
64
|
-
(loc.localize("species-tab-sort-radio-option-frequency"), "freq"),
|
65
|
-
(loc.localize("species-tab-sort-radio-option-alphabetically"), "alpha"),
|
66
|
-
],
|
67
|
-
value="freq",
|
68
|
-
label=loc.localize("species-tab-sort-radio-label"),
|
69
|
-
info=loc.localize("species-tab-sort-radio-info"),
|
70
|
-
)
|
71
|
-
|
72
|
-
start_btn = gr.Button(loc.localize("species-tab-start-button-label"), variant="huggingface")
|
73
|
-
start_btn.click(
|
74
|
-
run_species_list,
|
75
|
-
inputs=[
|
76
|
-
output_directory_state,
|
77
|
-
classifier_name,
|
78
|
-
lat_number,
|
79
|
-
lon_number,
|
80
|
-
week_number,
|
81
|
-
yearlong_checkbox,
|
82
|
-
sf_thresh_number,
|
83
|
-
sortby,
|
84
|
-
],
|
85
|
-
)
|
86
|
-
|
87
|
-
species_tab.select(
|
88
|
-
lambda lat, lon: gu.plot_map_scatter_mapbox(lat, lon, zoom=3), inputs=[lat_number, lon_number], outputs=map_plot
|
89
|
-
)
|
90
|
-
|
91
|
-
return lat_number, lon_number, map_plot
|
92
|
-
|
93
|
-
|
94
|
-
if __name__ == "__main__":
|
95
|
-
gu.open_window(build_species_tab)
|
1
|
+
import os
|
2
|
+
|
3
|
+
import gradio as gr
|
4
|
+
|
5
|
+
import birdnet_analyzer.config as cfg
|
6
|
+
import birdnet_analyzer.gui.localization as loc
|
7
|
+
import birdnet_analyzer.gui.utils as gu
|
8
|
+
from birdnet_analyzer.gui import settings
|
9
|
+
|
10
|
+
|
11
|
+
@gu.gui_runtime_error_handler
|
12
|
+
def run_species_list(out_path, filename, lat, lon, week, use_yearlong, sf_thresh, sortby):
|
13
|
+
from birdnet_analyzer.species.utils import run
|
14
|
+
|
15
|
+
gu.validate(out_path, loc.localize("validation-no-directory-selected"))
|
16
|
+
|
17
|
+
run(
|
18
|
+
os.path.join(out_path, filename if filename else "species_list.txt"),
|
19
|
+
lat,
|
20
|
+
lon,
|
21
|
+
-1 if use_yearlong else week,
|
22
|
+
sf_thresh,
|
23
|
+
sortby,
|
24
|
+
)
|
25
|
+
|
26
|
+
gr.Info(f"{loc.localize('species-tab-finish-info')} {cfg.OUTPUT_PATH}")
|
27
|
+
|
28
|
+
|
29
|
+
def build_species_tab():
|
30
|
+
with gr.Tab(loc.localize("species-tab-title")) as species_tab:
|
31
|
+
output_directory_state = gr.State()
|
32
|
+
select_directory_btn = gr.Button(loc.localize("species-tab-select-output-directory-button-label"))
|
33
|
+
classifier_name = gr.Textbox(
|
34
|
+
"species_list.txt",
|
35
|
+
visible=False,
|
36
|
+
info=loc.localize("species-tab-filename-textbox-label"),
|
37
|
+
)
|
38
|
+
|
39
|
+
def select_directory_and_update_tb(name_tb):
|
40
|
+
dir_name = gu.select_folder(state_key="species-output-dir")
|
41
|
+
|
42
|
+
if dir_name:
|
43
|
+
settings.set_state("species-output-dir", dir_name)
|
44
|
+
return (
|
45
|
+
dir_name,
|
46
|
+
gr.Textbox(label=dir_name, visible=True, value=name_tb),
|
47
|
+
)
|
48
|
+
|
49
|
+
return None, name_tb
|
50
|
+
|
51
|
+
select_directory_btn.click(
|
52
|
+
select_directory_and_update_tb,
|
53
|
+
inputs=classifier_name,
|
54
|
+
outputs=[output_directory_state, classifier_name],
|
55
|
+
show_progress="hidden",
|
56
|
+
)
|
57
|
+
|
58
|
+
lat_number, lon_number, week_number, sf_thresh_number, yearlong_checkbox, map_plot = (
|
59
|
+
gu.species_list_coordinates(show_map=True)
|
60
|
+
)
|
61
|
+
|
62
|
+
sortby = gr.Radio(
|
63
|
+
[
|
64
|
+
(loc.localize("species-tab-sort-radio-option-frequency"), "freq"),
|
65
|
+
(loc.localize("species-tab-sort-radio-option-alphabetically"), "alpha"),
|
66
|
+
],
|
67
|
+
value="freq",
|
68
|
+
label=loc.localize("species-tab-sort-radio-label"),
|
69
|
+
info=loc.localize("species-tab-sort-radio-info"),
|
70
|
+
)
|
71
|
+
|
72
|
+
start_btn = gr.Button(loc.localize("species-tab-start-button-label"), variant="huggingface")
|
73
|
+
start_btn.click(
|
74
|
+
run_species_list,
|
75
|
+
inputs=[
|
76
|
+
output_directory_state,
|
77
|
+
classifier_name,
|
78
|
+
lat_number,
|
79
|
+
lon_number,
|
80
|
+
week_number,
|
81
|
+
yearlong_checkbox,
|
82
|
+
sf_thresh_number,
|
83
|
+
sortby,
|
84
|
+
],
|
85
|
+
)
|
86
|
+
|
87
|
+
species_tab.select(
|
88
|
+
lambda lat, lon: gu.plot_map_scatter_mapbox(lat, lon, zoom=3), inputs=[lat_number, lon_number], outputs=map_plot
|
89
|
+
)
|
90
|
+
|
91
|
+
return lat_number, lon_number, map_plot
|
92
|
+
|
93
|
+
|
94
|
+
if __name__ == "__main__":
|
95
|
+
gu.open_window(build_species_tab)
|