Skip to content

Commit

Permalink
Update to BirdNET Species Range Model V2.4 - V2 (#104)
Browse files Browse the repository at this point in the history
* Update species model to BirdNET Species Range Model V2.4 - V2

* Update tests to match results of updated species range model
  • Loading branch information
spohlenz authored Jan 22, 2024
1 parent 372d811 commit a60e462
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion src/birdnetlib/species.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

SPECIES_MODEL_PATH = os.path.join(
os.path.dirname(__file__),
"models/analyzer/BirdNET_GLOBAL_6K_V2.4_MData_Model_FP16.tflite",
"models/analyzer/BirdNET_GLOBAL_6K_V2.4_MData_Model_V2_FP16.tflite",
)
LABEL_PATH = os.path.join(
os.path.dirname(__file__), "models/analyzer/BirdNET_GLOBAL_6K_V2.4_Labels.txt"
Expand Down
2 changes: 1 addition & 1 deletion tests/BirdNET-Analyzer
Submodule BirdNET-Analyzer updated 57 files
+15 −0 .gitignore
+5 −1 BirdNET-Analyzer-full.spec
+51 −0 BirdNET-Anaylzer-setup.iss
+68 −6 README.adoc
+60 −50 analyze.py
+12 −1 audio.py
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_MData_Model_FP16.tflite
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_MData_Model_V2_FP16.tflite
+10 −0 checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/app.py
+181 −0 checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/main.js
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard10of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard11of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard12of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard13of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard1of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard2of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard3of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard4of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard5of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard6of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard7of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard8of13.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/group1-shard9of13.bin
+6,524 −0 checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/labels.json
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/mdata/group1-shard1of8.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/mdata/group1-shard2of8.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/mdata/group1-shard3of8.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/mdata/group1-shard4of8.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/mdata/group1-shard5of8.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/mdata/group1-shard6of8.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/mdata/group1-shard7of8.bin
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/mdata/group1-shard8of8.bin
+1 −0 checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/mdata/model.json
+1 −0 checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/model/model.json
+ checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/static/sample.wav
+16 −0 checkpoints/V2.4/BirdNET_GLOBAL_6K_V2.4_Model_TFJS/templates/index.html
+141 −20 config.py
+6 −0 docs/_config.yml
+9 −0 docs/_includes/head-custom.html
+8 −0 docs/assets/css/style.scss
+ docs/assets/img/birdnet_logo.png
+ docs/assets/img/dummy_birds_image.png
+ docs/assets/img/dummy_frogs_image.png
+ docs/assets/img/dummy_project_image.png
+684 −0 docs/assets/js/projects_data.js
+ docs/favicon.ico
+57 −0 docs/index.html
+170 −0 docs/projects.html
+37 −46 embeddings.py
+3 −0 extra-hooks/hook-gradio_client.py
+396 −80 gui.py
+ gui/img/birdnet_logo.png
+262 −34 model.py
+2 −2 segments.py
+35 −30 species.py
+202 −27 train.py
+347 −0 utils.py
2 changes: 1 addition & 1 deletion tests/test_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def test_without_species_list():
# Check that birdnetlib results match command line results.
assert len(recording.detections) == len(commandline_results)
assert (
len(analyzer.custom_species_list) == 141
len(analyzer.custom_species_list) == 195
) # Check that this matches the number printed by the cli version.

# Check that detection confidence is float.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_buffer_analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_without_species_list():
# Check that birdnetlib results match command line results.
assert len(recording.detections) == len(commandline_results)
assert (
len(analyzer.custom_species_list) == 141
len(analyzer.custom_species_list) == 195
) # Check that this matches the number printed by the cli version.

# Check that detection confidence is float.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_large_recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def test_large_with_analyzer(filepath, cls_type):
# Check that birdnetlib results match command line results.
assert len(recording.detections) == len(commandline_results)
assert (
len(analyzer.custom_species_list) == 141
len(analyzer.custom_species_list) == 195
) # Check that this matches the number printed by the cli version.

# Check that detection confidence is float.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_overlap_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_without_species_list():
# Check that birdnetlib results match command line results.
assert len(recording.detections) == len(commandline_results)
assert (
len(analyzer.custom_species_list) == 141
len(analyzer.custom_species_list) == 195
) # Check that this matches the number printed by the cli version.

# Check that detection confidence is float.
Expand Down
14 changes: 7 additions & 7 deletions tests/test_species_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@ def test_species_list_for_analyzers():
species_list = species.return_list_for_analyzer(
lon=lon, lat=lat, week_48=week_48, threshold=filter_threshold
)
assert len(species_list) == 141
assert len(species_list) == 195

# Using datetime
date = datetime(year=2022, month=5, day=10)

species_list = species.return_list_for_analyzer(
lon=lon, lat=lat, date=date, threshold=filter_threshold
)
assert len(species_list) == 141
assert len(species_list) == 195

# Using no date or week_48
species_list = species.return_list_for_analyzer(
lon=lon, lat=lat, threshold=filter_threshold
)
assert len(species_list) == 216
assert len(species_list) == 269

# Adjust time threshold
date = datetime(year=2022, month=5, day=10)
filter_threshold = 0.1
species_list = species.return_list_for_analyzer(
lon=lon, lat=lat, date=date, threshold=filter_threshold
)
assert len(species_list) == 80
assert len(species_list) == 110


def test_species_list():
Expand All @@ -47,7 +47,7 @@ def test_species_list():
species_list = species.return_list(
lon=lon, lat=lat, week_48=week_48, threshold=filter_threshold
)
assert len(species_list) == 141
assert len(species_list) == 195
print(species_list[0])
assert species_list[0]["scientific_name"] == "Haemorhous mexicanus"
assert species_list[0]["common_name"] == "House Finch"
assert species_list[0]["scientific_name"] == "Cathartes aura"
assert species_list[0]["common_name"] == "Turkey Vulture"

0 comments on commit a60e462

Please sign in to comment.