A live bird collage card for your Home Assistant dashboard.
added support for a custom_species_list.txt file Added confidence score to extraction file
Patrick McGuire9c185d49a27c
diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.shindex 04001ca5..eedae8b2 100755--- a/scripts/birdnet_analysis.sh+++ b/scripts/birdnet_analysis.sh@@ -2,6 +2,7 @@# Runs BirdNET in virtual environment#set -xsource /etc/birdnet/birdnet.conf+CUSTOM_LIST="/home/pi/BirdNET-Lite/custom_species_list.txt"DAYS=("2 days ago""yesterday"@@ -47,7 +48,7 @@ run_analysis() {WEEK=$(date --date="${2}" +"%U")cd ${HOME}/BirdNET-Lite || exit 1for i in "${files[@]}";do- if [ -f ${1}/${i} ];then+ if [ -f ${1}/${i} ] && [ ! -f ${CUSTOM_LIST} ];thenpython3 analyze.py \--i "${1}/${i}" \--o "${1}/${i}.csv" \@@ -56,7 +57,17 @@ run_analysis() {--week "${WEEK}" \--overlap "${OVERLAP}" \--min_conf "${CONFIDENCE}"- fi+ elif [ -f ${1}/${i} ] && [ -f ${CUSTOM_LIST} ];then+ python3 analyze.py \+ --i "${1}/${i}" \+ --o "${1}/${i}.csv" \+ --lat "${LATITUDE}" \+ --lon "${LONGITUDE}" \+ --week "${WEEK}" \+ --overlap "${OVERLAP}" \+ --min_conf "${CONFIDENCE}" \+ --custom_list "${CUSTOM_LIST}"+ fidone}diff --git a/scripts/extract_new_birdsounds.sh b/scripts/extract_new_birdsounds.shindex c018d8e3..d9644ca9 100755--- a/scripts/extract_new_birdsounds.sh+++ b/scripts/extract_new_birdsounds.sh@@ -69,7 +69,11 @@ for h in "${SCAN_DIRS[@]}";do| awk -F\; '!/birdnet/{print $4}')""SCIENTIFIC_NAME=""$(echo ${line} \| awk -F\; '!/birdnet/{print $3}')""- NEWFILE="${COMMON_NAME// /_}-${OLDFILE}"+ CONFIDENCE=""$(echo ${line} \+ | awk -F\; '{print $5}' \+ | cut -d'.' -f2)""+ CONFIDENCE_SCORE="${CONFIDENCE:0:2}%"+ NEWFILE="${COMMON_NAME// /_}-${CONFIDENCE_SCORE}-${OLDFILE}"NEWSPECIES_BYDATE="${EXTRACTED}/By_Date/${DATE}/${COMMON_NAME// /_}"NEWSPECIES_BY_COMMON="${EXTRACTED}/By_Common_Name/${COMMON_NAME// /_}"NEWSPECIES_BY_SCIENCE="${EXTRACTED}/By_Scientific_Name/${SCIENTIFIC_NAME// /_}"