A live bird collage card for your Home Assistant dashboard.
Model Update: V2.3
ehpersonal38c016427083fd
diff --git a/.gitignore b/.gitignoreindex 21161baa..af2b488e 100644--- a/.gitignore+++ b/.gitignore@@ -27,7 +27,7 @@*.pyc*.flac.vscode-model/*+datasets/birdnet.confIdentifiedSoFar.txtdiff --git a/model/BirdNET_GLOBAL_3K_V2.2_MData_Model_FP16.tflite b/model/BirdNET_GLOBAL_3K_V2.2_MData_Model_FP16.tflitedeleted file mode 100644index 6dc8b26c..00000000Binary files a/model/BirdNET_GLOBAL_3K_V2.2_MData_Model_FP16.tflite and /dev/null differdiff --git a/model/BirdNET_GLOBAL_3K_V2.2_Model_FP16.tflite b/model/BirdNET_GLOBAL_3K_V2.2_Model_FP16.tflitedeleted file mode 100644index c9b6ac46..00000000Binary files a/model/BirdNET_GLOBAL_3K_V2.2_Model_FP16.tflite and /dev/null differdiff --git a/model/BirdNET_GLOBAL_3K_V2.3_MData_Model_FP16.tflite b/model/BirdNET_GLOBAL_3K_V2.3_MData_Model_FP16.tflitenew file mode 100644index 00000000..097e1819Binary files /dev/null and b/model/BirdNET_GLOBAL_3K_V2.3_MData_Model_FP16.tflite differdiff --git a/model/BirdNET_GLOBAL_3K_V2.3_Model_FP16.tflite b/model/BirdNET_GLOBAL_3K_V2.3_Model_FP16.tflitenew file mode 100644index 00000000..4b0b022dBinary files /dev/null and b/model/BirdNET_GLOBAL_3K_V2.3_Model_FP16.tflite differdiff --git a/model/labels_nm.zip b/model/labels_nm.zipindex 72570ea9..7ae19f53 100644Binary files a/model/labels_nm.zip and b/model/labels_nm.zip differdiff --git a/scripts/config.php b/scripts/config.phpindex 042a866d..0a1ecf38 100644--- a/scripts/config.php+++ b/scripts/config.php@@ -120,7 +120,7 @@ if(isset($_GET["latitude"])){// Archive old language filesyslog_shell_exec("cp -f $home/BirdNET-Pi/model/labels.txt $home/BirdNET-Pi/model/labels.txt.old", $user);- if($model == "BirdNET_GLOBAL_3K_V2.2_Model_FP16"){+ if($model == "BirdNET_GLOBAL_3K_V2.3_Model_FP16"){// Install new language label filesyslog_shell_exec("sudo chmod +x $home/BirdNET-Pi/scripts/install_language_label_nm.sh && $home/BirdNET-Pi/scripts/install_language_label_nm.sh -l $language", $user);} else {@@ -325,7 +325,7 @@ if (!isset($_SERVER['PHP_AUTH_USER'])) {<script>document.addEventListener('DOMContentLoaded', function() {document.getElementById('modelsel').addEventListener('change', function() {- if(this.value == "BirdNET_GLOBAL_3K_V2.2_Model_FP16"){+ if(this.value == "BirdNET_GLOBAL_3K_V2.3_Model_FP16"){document.getElementById("soft").style.display="unset";} else {document.getElementById("soft").style.display="none";@@ -357,7 +357,7 @@ function sendTestNotification(e) {<label for="model">Select a Model: </label><select id="modelsel" name="model"><?php- $models = array("BirdNET_6K_GLOBAL_MODEL", "BirdNET_GLOBAL_3K_V2.2_Model_FP16");+ $models = array("BirdNET_6K_GLOBAL_MODEL", "BirdNET_GLOBAL_3K_V2.3_Model_FP16");foreach($models as $modelName){$isSelected = "";if($config['MODEL'] == $modelName){@@ -473,7 +473,7 @@ function runProcess() {<dt>BirdNET_6K_GLOBAL_MODEL (2020)</dt><br><dd id="ddnewline">This is the BirdNET-Lite model, with bird sound recognition for more than 6,000 species worldwide. This is the default option and will generally work very for people in most of the world.</dd><br>- <dt>BirdNET_GLOBAL_3K_V2.2_Model_FP16 (2022)</dt><br>+ <dt>BirdNET_GLOBAL_3K_V2.3_Model_FP16 (2022)</dt><br><dd id="ddnewline">This is the BirdNET-Analyzer model, a newer work-in-progress project with aims to improve on the BirdNET-Lite model. Currently it only supports about 3,500 species worldwide, meaning for some regions (North America, Europe, Australia) it will usually outperform the BirdNET-Lite model, but for other regions it will be worse.</dd><br><dt>[ In-depth technical write-up on the models <a target="_blank" href="https://github.com/mcguirepr89/BirdNET-Pi/wiki/BirdNET-Pi:-some-theory-on-classification-&-some-practical-hints">here</a> ]</dt></dl>diff --git a/scripts/server.py b/scripts/server.pyindex 2f2fe6b2..53054c84 100755--- a/scripts/server.py+++ b/scripts/server.py@@ -71,7 +71,7 @@ def loadModel():print('LOADING TF LITE MODEL...', end=' ')# Load TFLite model and allocate tensors.- # model will either be BirdNET_GLOBAL_3K_V2.2_Model_FP16 (new) or BirdNET_6K_GLOBAL_MODEL (old)+ # model will either be BirdNET_GLOBAL_3K_V2.3_Model_FP16 (new) or BirdNET_6K_GLOBAL_MODEL (old)modelpath = userDir + '/BirdNET-Pi/model/'+model+'.tflite'myinterpreter = tflite.Interpreter(model_path=modelpath, num_threads=2)myinterpreter.allocate_tensors()@@ -272,7 +272,7 @@ def analyzeAudioData(chunks, lat, lon, week, sensitivity, overlap,):start = time.time()print('ANALYZING AUDIO...', end=' ', flush=True)- if model == "BirdNET_GLOBAL_3K_V2.2_Model_FP16":+ if model == "BirdNET_GLOBAL_3K_V2.3_Model_FP16":if len(PREDICTED_SPECIES_LIST) == 0 or len(INCLUDE_LIST) != 0:predictSpeciesList(lat,lon,week)@@ -584,7 +584,7 @@ def handle_client(conn, addr):post_commonName = "\"commonName\": \"" + entry[0].split('_')[1].split("/")[0] + "\","post_scientificName = "\"scientificName\": \"" + entry[0].split('_')[0] + "\","- if model == "BirdNET_GLOBAL_3K_V2.2_Model_FP16":+ if model == "BirdNET_GLOBAL_3K_V2.3_Model_FP16":post_algorithm = "\"algorithm\": " + "\"2p2\"" + ","else:post_algorithm = "\"algorithm\": " + "\"alpha\"" + ","diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.shindex 2681ef38..0e54434e 100755--- a/scripts/update_birdnet_snippets.sh+++ b/scripts/update_birdnet_snippets.sh@@ -214,5 +214,13 @@ if ! grep LogLevel_SpectrogramViewerService /etc/birdnet/birdnet.conf &>/dev/nulsudo -u$USER echo "LogLevel_SpectrogramViewerService=\"error\"" >> /etc/birdnet/birdnet.conffi+if grep -q '^MODEL=BirdNET_GLOBAL_3K_V2.2_Model_FP16$' /etc/birdnet/birdnet.conf;then+ language=$(grep "^DATABASE_LANG=" /etc/birdnet/birdnet.conf | cut -d= -f2)+ sed -i 's/BirdNET_GLOBAL_3K_V2.2_Model_FP16/BirdNET_GLOBAL_3K_V2.3_Model_FP16/' /etc/birdnet/birdnet.conf+ cp -f $home/BirdNET-Pi/model/labels.txt $home/BirdNET-Pi/model/labels.txt.old+ sudo chmod +x $home/BirdNET-Pi/scripts/install_language_label_nm.sh && $home/BirdNET-Pi/scripts/install_language_label_nm.sh -l "$language"+fi++sudo systemctl daemon-reloadrestart_services.sh