Adding pythond3 virtualenv to birdnet analysis python call

This commit is contained in:
Jake Herbst
2022-05-16 21:46:24 -04:00
parent 670d3f90ca
commit dad5868f22
+9 -7
View File
@@ -29,8 +29,8 @@ fi
INCLUDE_LIST="$HOME/BirdNET-Pi/include_species_list.txt" INCLUDE_LIST="$HOME/BirdNET-Pi/include_species_list.txt"
EXCLUDE_LIST="$HOME/BirdNET-Pi/exclude_species_list.txt" EXCLUDE_LIST="$HOME/BirdNET-Pi/exclude_species_list.txt"
if [ ! -f ${INCLUDE_LIST} ];then if [ ! -f ${INCLUDE_LIST} ];then
touch ${INCLUDE_LIST} && touch ${INCLUDE_LIST} &&
chmod g+rw ${INCLUDE_LIST} chmod g+rw ${INCLUDE_LIST}
fi fi
if [ ! -f ${EXCLUDE_LIST} ];then if [ ! -f ${EXCLUDE_LIST} ];then
@@ -59,8 +59,8 @@ get_files() {
# Takes one argument: # Takes one argument:
# - {DIRECTORY} # - {DIRECTORY}
move_analyzed() { move_analyzed() {
for i in "${files[@]}";do for i in "${files[@]}";do
j="${i}.csv" j="${i}.csv"
if [ -f "${1}/${j}" ];then if [ -f "${1}/${j}" ];then
if [ ! -d "${1}-Analyzed" ];then if [ ! -d "${1}-Analyzed" ];then
mkdir -p "${1}-Analyzed" && echo "'Analyzed' directory created" mkdir -p "${1}-Analyzed" && echo "'Analyzed' directory created"
@@ -75,7 +75,9 @@ move_analyzed() {
# Uses one argument: # Uses one argument:
# - {DIRECTORY} # - {DIRECTORY}
run_analysis() { run_analysis() {
sleep .5 PYTHON_VIRTUAL_ENV="$HOME/BirdNET-Pi/birdnet/bin/python3"
sleep .5
### TESTING NEW WEEK CALCULATION ### TESTING NEW WEEK CALCULATION
WEEK_OF_YEAR="$(echo "($(date +%m)-1) * 4" | bc -l)" WEEK_OF_YEAR="$(echo "($(date +%m)-1) * 4" | bc -l)"
@@ -123,7 +125,7 @@ run_analysis() {
BIRDWEATHER_ID_PARAM="" BIRDWEATHER_ID_PARAM=""
BIRDWEATHER_ID_LOG="" BIRDWEATHER_ID_LOG=""
fi fi
echo analyze.py \ echo $PYTHON_VIRTUAL_ENV analyze.py \
--i "${1}/${i}" \ --i "${1}/${i}" \
--o "${1}/${i}.csv" \ --o "${1}/${i}.csv" \
--lat "${LATITUDE}" \ --lat "${LATITUDE}" \
@@ -135,7 +137,7 @@ run_analysis() {
${INCLUDEPARAM} \ ${INCLUDEPARAM} \
${EXCLUDEPARAM} \ ${EXCLUDEPARAM} \
${BIRDWEATHER_ID_LOG} ${BIRDWEATHER_ID_LOG}
analyze.py \ $PYTHON_VIRTUAL_ENV analyze.py \
--i "${1}/${i}" \ --i "${1}/${i}" \
--o "${1}/${i}.csv" \ --o "${1}/${i}.csv" \
--lat "${LATITUDE}" \ --lat "${LATITUDE}" \