A live bird collage card for your Home Assistant dashboard.
fixes
ehpersonal38f03f69cc632f
diff --git a/scripts/config.php b/scripts/config.phpindex 58cb948a..d9c073f1 100644--- a/scripts/config.php+++ b/scripts/config.php@@ -356,8 +356,8 @@ function sendTestNotification(e) {</select><br><span <?php if($config['MODEL'] == "BirdNET_6K_GLOBAL_MODEL") { ?>style="display: none"<?php } ?> id="soft">- <label for="sf_thresh">Species Occurence Frequency Threshold: </label>- <input name="sf_thresh" type="number" max="0.99" min="0.01" step="0.01" value="<?php print($config['SF_THRESH']);?>"/> <span onclick="document.getElementById('sfhelp').style.display='unset'" style="text-decoration:underline;cursor:pointer">[?]</span><br>+ <label for="sf_thresh">Species Occurence Frequency Threshold [0.005, 0.99]: </label>+ <input name="sf_thresh" type="number" max="0.99" min="0.0005" step="0.01" value="<?php print($config['SF_THRESH']);?>"/> <span onclick="document.getElementById('sfhelp').style.display='unset'" style="text-decoration:underline;cursor:pointer">[?]</span><br><p id="sfhelp" style='display:none'>This value is used by the model to constrain the list of possible species that it will try to detect, given the minimum occurence frequency. A 0.05 threshold means that the species is seen on average at least 5% of the time, from historically collected data for your lat/lon.<br>If you'd like to tinker with this value and see the species list output, you can run the following command AFTER clicking 'Update Settings' at the very bottom of this page to install the appropriate labels file: <b>~/BirdNET-Pi/birdnet/bin/python3 ~/BirdNET-Pi/scripts/species.py --threshold 0.05</b></p></span>diff --git a/scripts/species.py b/scripts/species.pyindex 3426f61d..77da697d 100644--- a/scripts/species.py+++ b/scripts/species.py@@ -71,13 +71,13 @@ def predictFilter(lat, lon, week):return M_INTERPRETER.get_tensor(M_OUTPUT_LAYER_INDEX)[0]-def explore(lat, lon, week):+def explore(lat, lon, week, threshold):# Make filter predictionl_filter = predictFilter(lat, lon, week)# Apply threshold- l_filter = np.where(l_filter >= 0.03, l_filter, 0)+ l_filter = np.where(l_filter >= threshold, l_filter, 0)# Zip with labelsl_filter = list(zip(l_filter, CLASSES))@@ -92,7 +92,7 @@ def getSpeciesList(lat, lon, week, threshold=0.05, sort=False):print('Getting species list for {}/{}, Week {}...'.format(lat, lon, week), end='', flush=True)# Extract species from model- pred = explore(lat, lon, week)+ pred = explore(lat, lon, week, threshold)# Make species listslist = []