From b1d6a5aca55af3414a8e65998c774a23da9f1105 Mon Sep 17 00:00:00 2001 From: ehpersonal38 <103586016+ehpersonal38@users.noreply.github.com> Date: Tue, 14 Feb 2023 21:57:33 -0500 Subject: [PATCH] species list tester --- scripts/config.php | 114 ++++++++++++++++++++++++++++++++++++++++++++- scripts/species.py | 2 +- 2 files changed, 113 insertions(+), 3 deletions(-) diff --git a/scripts/config.php b/scripts/config.php index cc17dde..03911b1 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -13,6 +13,23 @@ function syslog_shell_exec($cmd, $sudo_user = null) { } } +if(isset($_GET['threshold'])) { + $threshold = $_GET['threshold']; + if (!is_numeric($threshold) || $threshold < 0 || $threshold > 1) { + die('Invalid threshold value'); + } + + $user = trim(shell_exec("awk -F: '/1000/{print $1}' /etc/passwd")); + $home = trim(shell_exec("awk -F: '/1000/{print $6}' /etc/passwd")); + + $command = "sudo -u $user ".$home."/BirdNET-Pi/birdnet/bin/python3 ".$home."/BirdNET-Pi/scripts/species.py --threshold $threshold 2>&1"; + + $output = shell_exec($command); + + echo $output; + die(); +} + if(isset($_GET['restart_php']) && $_GET['restart_php'] == "true") { shell_exec("sudo service php7.4-fpm restart"); die(); @@ -357,10 +374,103 @@ function sendTestNotification(e) {
style="display: none" id="soft"> - [?]
- + [more info]
+
+ + + +
+ + + +
+

+  
+
+ + + + + +
BirdNET_6K_GLOBAL_MODEL (2020)

This model comes from BirdNET-Lite, with bird sound recognition for more than 6,000 species worldwide. This is the default option and will generally work very well for most use cases.
diff --git a/scripts/species.py b/scripts/species.py index 77da697..d277b78 100644 --- a/scripts/species.py +++ b/scripts/species.py @@ -132,7 +132,7 @@ if __name__ == '__main__': for x in range(len(species_list)): print(species_list[x][0] + " - "+ str(species_list[x][1])) - print("\nThe above species list describes all of the species that have been historically observed at the specified lat/long ("+lat+", "+lon+") for this week of the year. The frequency threshold is the percentage of submitted eBird checklists that the species appeared on, meaning a higher threshold means that the species is more common.") + print("\nThe above species list describes all the species that the model will attempt to detect. If you don't see a species you want detected on this list, decrease your threshold.") print("\nNOTE: no actual changes to your BirdNET-Pi species list were made by running this command. To set your desired frequency threshold, do it through the BirdNET-Pi web interface (Tools -> Settings -> Model)")