added support for a custom_species_list.txt file

Added confidence score to extraction file
This commit is contained in:
Patrick McGuire
2021-09-29 17:23:35 -04:00
parent 130901c680
commit 9c185d49a2
2 changed files with 18 additions and 3 deletions
+13 -2
View File
@@ -2,6 +2,7 @@
# Runs BirdNET in virtual environment
#set -x
source /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 1
for i in "${files[@]}";do
if [ -f ${1}/${i} ];then
if [ -f ${1}/${i} ] && [ ! -f ${CUSTOM_LIST} ];then
python3 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}"
fi
done
}
+5 -1
View File
@@ -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// /_}"