Merge branch 'mcguirepr89:main' into main
This commit is contained in:
@@ -54,6 +54,7 @@ Currently listening in these countries . . . that I know of . . .
|
|||||||
- Estonia
|
- Estonia
|
||||||
- Tasmania
|
- Tasmania
|
||||||
- Luxembourgh
|
- Luxembourgh
|
||||||
|
- Crete
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* **24/7 recording and automatic identification** of bird songs, chirps, and peeps using BirdNET machine learning
|
* **24/7 recording and automatic identification** of bird songs, chirps, and peeps using BirdNET machine learning
|
||||||
|
|||||||
+6
-1
@@ -1,4 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/* Prevent XSS input */
|
||||||
|
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
|
||||||
|
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
|
||||||
|
|
||||||
$sys_timezone = "";
|
$sys_timezone = "";
|
||||||
// If we can get the timezome from the systems timezone file ust that
|
// If we can get the timezome from the systems timezone file ust that
|
||||||
if (file_exists('/etc/timezone')) {
|
if (file_exists('/etc/timezone')) {
|
||||||
@@ -99,4 +104,4 @@ echo "
|
|||||||
<iframe src=\"/views.php\"></iframe>
|
<iframe src=\"/views.php\"></iframe>
|
||||||
</div>";
|
</div>";
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
|||||||
+10
-4
@@ -1,4 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/* Prevent XSS input */
|
||||||
|
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
|
||||||
|
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
|
||||||
|
|
||||||
$sys_timezone = "";
|
$sys_timezone = "";
|
||||||
// If we can get the timezome from the systems timezone file ust that
|
// If we can get the timezome from the systems timezone file ust that
|
||||||
if (file_exists('/etc/timezone')) {
|
if (file_exists('/etc/timezone')) {
|
||||||
@@ -37,13 +42,14 @@ if(!isset($_SESSION['behind'])) {
|
|||||||
$sum = $num1 + $num2;
|
$sum = $num1 + $num2;
|
||||||
$_SESSION['behind'] = $sum;
|
$_SESSION['behind'] = $sum;
|
||||||
}
|
}
|
||||||
if(isset($_SESSION['behind'])&&intval($_SESSION['behind']) >= 99) {?>
|
}
|
||||||
|
if(isset($_SESSION['behind'])&&intval($_SESSION['behind']) >= 99) {?>
|
||||||
<style>
|
<style>
|
||||||
.updatenumber {
|
.updatenumber {
|
||||||
width:30px !important;
|
width:30px !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<?php }}
|
<?php }
|
||||||
|
|
||||||
if (file_exists('./scripts/thisrun.txt')) {
|
if (file_exists('./scripts/thisrun.txt')) {
|
||||||
$config = parse_ini_file('./scripts/thisrun.txt');
|
$config = parse_ini_file('./scripts/thisrun.txt');
|
||||||
@@ -73,7 +79,7 @@ body::-webkit-scrollbar {
|
|||||||
<button type="submit" name="view" value="Overview" form="views">Overview</button>
|
<button type="submit" name="view" value="Overview" form="views">Overview</button>
|
||||||
</form>
|
</form>
|
||||||
<form action="" method="GET" id="views">
|
<form action="" method="GET" id="views">
|
||||||
<button type="submit" name="view" value="Today's Detections" form="views">Today's Detections</button>
|
<button type="submit" name="view" value="Todays Detections" form="views">Today's Detections</button>
|
||||||
</form>
|
</form>
|
||||||
<form action="" method="GET" id="views">
|
<form action="" method="GET" id="views">
|
||||||
<button type="submit" name="view" value="Spectrogram" form="views">Spectrogram</button>
|
<button type="submit" name="view" value="Spectrogram" form="views">Spectrogram</button>
|
||||||
@@ -143,7 +149,7 @@ if(isset($_GET['view'])){
|
|||||||
if($_GET['view'] == "Spectrogram"){include('spectrogram.php');}
|
if($_GET['view'] == "Spectrogram"){include('spectrogram.php');}
|
||||||
if($_GET['view'] == "View Log"){echo "<body style=\"scroll:no;overflow-x:hidden;\"><iframe style=\"width:calc( 100% + 1em);\" src=\"/log\"></iframe></body>";}
|
if($_GET['view'] == "View Log"){echo "<body style=\"scroll:no;overflow-x:hidden;\"><iframe style=\"width:calc( 100% + 1em);\" src=\"/log\"></iframe></body>";}
|
||||||
if($_GET['view'] == "Overview"){include('overview.php');}
|
if($_GET['view'] == "Overview"){include('overview.php');}
|
||||||
if($_GET['view'] == "Today's Detections"){include('todays_detections.php');}
|
if($_GET['view'] == "Todays Detections"){include('todays_detections.php');}
|
||||||
if($_GET['view'] == "Kiosk"){$kiosk = true;include('todays_detections.php');}
|
if($_GET['view'] == "Kiosk"){$kiosk = true;include('todays_detections.php');}
|
||||||
if($_GET['view'] == "Species Stats"){include('stats.php');}
|
if($_GET['view'] == "Species Stats"){include('stats.php');}
|
||||||
if($_GET['view'] == "Weekly Report"){include('weekly_report.php');}
|
if($_GET['view'] == "Weekly Report"){include('weekly_report.php');}
|
||||||
|
|||||||
@@ -15,3 +15,4 @@ paho-mqtt
|
|||||||
pytest==7.1.2
|
pytest==7.1.2
|
||||||
pytest-mock==3.7.0
|
pytest-mock==3.7.0
|
||||||
suntime
|
suntime
|
||||||
|
altair<5
|
||||||
+26
-21
@@ -2,14 +2,14 @@
|
|||||||
error_reporting(E_ERROR);
|
error_reporting(E_ERROR);
|
||||||
ini_set('display_errors',1);
|
ini_set('display_errors',1);
|
||||||
|
|
||||||
if (file_exists('./scripts/thisrun.txt')) {
|
|
||||||
$config = parse_ini_file('./scripts/thisrun.txt');
|
|
||||||
} elseif (file_exists('./scripts/firstrun.ini')) {
|
|
||||||
$config = parse_ini_file('./scripts/firstrun.ini');
|
|
||||||
}
|
|
||||||
$user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd");
|
$user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd");
|
||||||
$home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd");
|
$home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd");
|
||||||
$home = trim($home);
|
$home = trim($home);
|
||||||
|
if (file_exists($home.'/BirdNET-Pi/scripts/thisrun.txt')) {
|
||||||
|
$config = parse_ini_file($home.'/BirdNET-Pi/scripts/thisrun.txt');
|
||||||
|
} elseif (file_exists($home.'/BirdNET-Pi/scripts/thisrun.ini')) {
|
||||||
|
$config = parse_ini_file($home.'/BirdNET-Pi/scripts/thisrun.ini');
|
||||||
|
}
|
||||||
if (file_exists($home."/BirdNET-Pi/apprise.txt")) {
|
if (file_exists($home."/BirdNET-Pi/apprise.txt")) {
|
||||||
$apprise_config = file_get_contents($home."/BirdNET-Pi/apprise.txt");
|
$apprise_config = file_get_contents($home."/BirdNET-Pi/apprise.txt");
|
||||||
} else {
|
} else {
|
||||||
@@ -136,11 +136,10 @@ if(isset($_GET["latitude"])){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update Language settings only if a change is requested
|
if (file_exists($home.'/BirdNET-Pi/scripts/thisrun.txt')) {
|
||||||
if (file_exists('./scripts/thisrun.txt')) {
|
$lang_config = parse_ini_file($home.'/BirdNET-Pi/scripts/thisrun.txt');
|
||||||
$lang_config = parse_ini_file('./scripts/thisrun.txt');
|
} elseif (file_exists($home.'/BirdNET-Pi/scripts/thisrun.ini')) {
|
||||||
} elseif (file_exists('./scripts/firstrun.ini')) {
|
$lang_config = parse_ini_file($home.'/BirdNET-Pi/scripts/thisrun.ini');
|
||||||
$lang_config = parse_ini_file('./scripts/firstrun.ini');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($model != $lang_config['MODEL'] || $language != $lang_config['DATABASE_LANG']){
|
if ($model != $lang_config['MODEL'] || $language != $lang_config['DATABASE_LANG']){
|
||||||
@@ -183,7 +182,7 @@ if(isset($_GET["latitude"])){
|
|||||||
$contents = preg_replace("/APPRISE_ONLY_NOTIFY_SPECIES_NAMES=.*/", "APPRISE_ONLY_NOTIFY_SPECIES_NAMES=\"$only_notify_species_names\"", $contents);
|
$contents = preg_replace("/APPRISE_ONLY_NOTIFY_SPECIES_NAMES=.*/", "APPRISE_ONLY_NOTIFY_SPECIES_NAMES=\"$only_notify_species_names\"", $contents);
|
||||||
$contents = preg_replace("/APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2=.*/", "APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2=\"$only_notify_species_names_2\"", $contents);
|
$contents = preg_replace("/APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2=.*/", "APPRISE_ONLY_NOTIFY_SPECIES_NAMES_2=\"$only_notify_species_names_2\"", $contents);
|
||||||
|
|
||||||
$contents2 = file_get_contents("./scripts/thisrun.txt");
|
$contents2 = file_get_contents($home."/BirdNET-Pi/scripts/thisrun.txt");
|
||||||
$contents2 = preg_replace("/SITE_NAME=.*/", "SITE_NAME=\"$site_name\"", $contents2);
|
$contents2 = preg_replace("/SITE_NAME=.*/", "SITE_NAME=\"$site_name\"", $contents2);
|
||||||
$contents2 = preg_replace("/LATITUDE=.*/", "LATITUDE=$latitude", $contents2);
|
$contents2 = preg_replace("/LATITUDE=.*/", "LATITUDE=$latitude", $contents2);
|
||||||
$contents2 = preg_replace("/LONGITUDE=.*/", "LONGITUDE=$longitude", $contents2);
|
$contents2 = preg_replace("/LONGITUDE=.*/", "LONGITUDE=$longitude", $contents2);
|
||||||
@@ -213,7 +212,7 @@ if(isset($_GET["latitude"])){
|
|||||||
}
|
}
|
||||||
|
|
||||||
$fh = fopen("/etc/birdnet/birdnet.conf", "w");
|
$fh = fopen("/etc/birdnet/birdnet.conf", "w");
|
||||||
$fh2 = fopen("./scripts/thisrun.txt", "w");
|
$fh2 = fopen($home."/BirdNET-Pi/scripts/thisrun.txt", "w");
|
||||||
fwrite($fh, $contents);
|
fwrite($fh, $contents);
|
||||||
fwrite($fh2, $contents2);
|
fwrite($fh2, $contents2);
|
||||||
|
|
||||||
@@ -231,18 +230,17 @@ if(isset($_GET["latitude"])){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_GET['sendtest']) && $_GET['sendtest'] == "true") {
|
if(isset($_GET['sendtest']) && $_GET['sendtest'] == "true") {
|
||||||
$db = new SQLite3('./birds.db', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
|
|
||||||
|
|
||||||
$user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd");
|
$user = shell_exec("awk -F: '/1000/{print $1}' /etc/passwd");
|
||||||
$home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd");
|
$home = shell_exec("awk -F: '/1000/{print $6}' /etc/passwd");
|
||||||
$home = trim($home);
|
$home = trim($home);
|
||||||
|
if (file_exists($home.'/BirdNET-Pi/scripts/thisrun.txt')) {
|
||||||
if (file_exists('./thisrun.txt')) {
|
$config = parse_ini_file($home.'/BirdNET-Pi/scripts/thisrun.txt');
|
||||||
$config = parse_ini_file('./thisrun.txt');
|
} elseif (file_exists($home.'/BirdNET-Pi/scripts/thisrun.ini')) {
|
||||||
} elseif (file_exists('./firstrun.ini')) {
|
$config = parse_ini_file($home.'/BirdNET-Pi/scripts/thisrun.ini');
|
||||||
$config = parse_ini_file('./firstrun.ini');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$db = new SQLite3($home."/BirdNET-Pi/scripts/birds.db", SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
|
||||||
|
|
||||||
$cf = explode("\n",$_GET['apprise_config']);
|
$cf = explode("\n",$_GET['apprise_config']);
|
||||||
$cf = "'".implode("' '", $cf)."'";
|
$cf = "'".implode("' '", $cf)."'";
|
||||||
|
|
||||||
@@ -315,6 +313,12 @@ if(isset($_GET['sendtest']) && $_GET['sendtest'] == "true") {
|
|||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// have to get the config again after we change the variables, so the UI reflects the changes too
|
||||||
|
if (file_exists($home.'/BirdNET-Pi/scripts/thisrun.txt')) {
|
||||||
|
$config = parse_ini_file($home.'/BirdNET-Pi/scripts/thisrun.txt');
|
||||||
|
} elseif (file_exists($home.'/BirdNET-Pi/scripts/thisrun.ini')) {
|
||||||
|
$config = parse_ini_file($home.'/BirdNET-Pi/scripts/thisrun.ini');
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<style>
|
<style>
|
||||||
@@ -375,7 +379,8 @@ function sendTestNotification(e) {
|
|||||||
<span <?php if($config['MODEL'] == "BirdNET_6K_GLOBAL_MODEL") { ?>style="display: none"<?php } ?> id="soft">
|
<span <?php if($config['MODEL'] == "BirdNET_6K_GLOBAL_MODEL") { ?>style="display: none"<?php } ?> id="soft">
|
||||||
<label for="sf_thresh">Species Occurence Frequency Threshold [0.0005, 0.99]: </label>
|
<label for="sf_thresh">Species Occurence Frequency Threshold [0.0005, 0.99]: </label>
|
||||||
<input name="sf_thresh" type="number" max="0.99" min="0.0005" step="any" value="<?php print($config['SF_THRESH']);?>"/> <span onclick="document.getElementById('sfhelp').style.display='unset'" style="text-decoration:underline;cursor:pointer">[more info]</span><br>
|
<input name="sf_thresh" type="number" max="0.99" min="0.0005" step="any" value="<?php print($config['SF_THRESH']);?>"/> <span onclick="document.getElementById('sfhelp').style.display='unset'" style="text-decoration:underline;cursor:pointer">[more info]</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.03 threshold means that for a species to be included in this list, it needs to, on average, be seen on at least 3% of historically submitted eBird checklists for your given lat/lon/current week of year. So, the lower the threshold, the rarer the species it will include.<br><br>If you'd like to tinker with this threshold value and see which species make it onto the list, <?php if($config['MODEL'] == "BirdNET_6K_GLOBAL_MODEL"){ ?>please click "Update Settings" at the very bottom of this page to install the appropriate label file, then come back here and you'll be able to use the Species List Tester.<?php } else { ?>you can use this tool: <button type="button" class="testbtn" id="openModal">Species List Tester</button><?php } ?></p>
|
<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.03 threshold means that for a species to be included in this list, it needs to, on average, be seen on at least 3% of historically submitted eBird checklists for your given lat/lon/current week of year. So, the lower the threshold, the rarer the species it will include.<br><img style='width:75%;padding-top:5px;padding-bottom:5px' alt="BirdNET-Pi new model detection flowchart" title="BirdNET-Pi new model detection flowchart" src="https://i.imgur.com/8YEAuSA.jpeg">
|
||||||
|
<br>If you'd like to tinker with this threshold value and see which species make it onto the list, <?php if($config['MODEL'] == "BirdNET_6K_GLOBAL_MODEL"){ ?>please click "Update Settings" at the very bottom of this page to install the appropriate label file, then come back here and you'll be able to use the Species List Tester.<?php } else { ?>you can use this tool: <button type="button" class="testbtn" id="openModal">Species List Tester</button><?php } ?></p>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<script src="static/dialog-polyfill.js"></script>
|
<script src="static/dialog-polyfill.js"></script>
|
||||||
@@ -496,7 +501,7 @@ function runProcess() {
|
|||||||
<h2>BirdWeather</h2>
|
<h2>BirdWeather</h2>
|
||||||
<label for="birdweather_id">BirdWeather ID: </label>
|
<label for="birdweather_id">BirdWeather ID: </label>
|
||||||
<input name="birdweather_id" type="text" value="<?php print($config['BIRDWEATHER_ID']);?>" /><br>
|
<input name="birdweather_id" type="text" value="<?php print($config['BIRDWEATHER_ID']);?>" /><br>
|
||||||
<p><a href="https://app.birdweather.com" target="_blank">BirdWeather.com</a> is a weather map for bird sounds. Stations around the world supply audio and video streams to BirdWeather where they are then analyzed by BirdNET and compared to eBird Grid data. BirdWeather catalogues the bird audio and spectrogram visualizations so that you can listen to, view, and read about birds throughout the world. <a href="mailto:tim@birdweather.com?subject=Request%20BirdWeather%20ID&body=<?php include('./scripts/birdweather_request.php'); ?>" target="_blank">Email Tim</a> to request a BirdWeather ID</p>
|
<p><a href="https://app.birdweather.com" target="_blank">BirdWeather.com</a> is a weather map for bird sounds. Stations around the world supply audio and video streams to BirdWeather where they are then analyzed by BirdNET and compared to eBird Grid data. BirdWeather catalogues the bird audio and spectrogram visualizations so that you can listen to, view, and read about birds throughout the world. <a href="mailto:tim@birdweather.com?subject=Request%20BirdWeather%20ID&body=<?php include($home.'/BirdNET-Pi/scripts/birdweather_request.php'); ?>" target="_blank">Email Tim</a> to request a BirdWeather ID</p>
|
||||||
</td></tr></table><br>
|
</td></tr></table><br>
|
||||||
<table class="settingstable" style="width:100%"><tr><td>
|
<table class="settingstable" style="width:100%"><tr><td>
|
||||||
<h2>Notifications</h2>
|
<h2>Notifications</h2>
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/* Prevent XSS input */
|
||||||
|
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
|
||||||
|
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
|
||||||
|
|
||||||
error_reporting(E_ALL);
|
error_reporting(E_ALL);
|
||||||
ini_set('display_errors',1);
|
ini_set('display_errors',1);
|
||||||
ini_set('display_startup_errors',1);
|
ini_set('display_startup_errors',1);
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/* Prevent XSS input */
|
||||||
|
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
|
||||||
|
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
|
||||||
|
|
||||||
error_reporting(E_ERROR);
|
error_reporting(E_ERROR);
|
||||||
ini_set('display_errors',1);
|
ini_set('display_errors',1);
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ def get_connection(path: str):
|
|||||||
return sqlite3.connect(path, check_same_thread=False)
|
return sqlite3.connect(path, check_same_thread=False)
|
||||||
|
|
||||||
|
|
||||||
def get_data(conn: Connection):
|
@st.cache_resource()
|
||||||
|
def get_data(_conn: Connection):
|
||||||
df1 = pd.read_sql("SELECT * FROM detections", con=conn)
|
df1 = pd.read_sql("SELECT * FROM detections", con=conn)
|
||||||
return df1
|
return df1
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/* Prevent XSS input */
|
||||||
|
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
|
||||||
|
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
|
||||||
|
|
||||||
ini_set('user_agent', 'PHP_Flickr/1.0');
|
ini_set('user_agent', 'PHP_Flickr/1.0');
|
||||||
error_reporting(0);
|
error_reporting(0);
|
||||||
ini_set('display_errors', 0);
|
ini_set('display_errors', 0);
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
/* Prevent XSS input */
|
||||||
|
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
|
||||||
|
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
|
||||||
|
|
||||||
ini_set('session.gc_maxlifetime', 7200);
|
ini_set('session.gc_maxlifetime', 7200);
|
||||||
ini_set('user_agent', 'PHP_Flickr/1.0');
|
ini_set('user_agent', 'PHP_Flickr/1.0');
|
||||||
session_set_cookie_params(7200);
|
session_set_cookie_params(7200);
|
||||||
|
|||||||
Reference in New Issue
Block a user