Merge pull request #25 from mcguirepr89/testing
Added tflite wheel and placed installation in python venv
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
my_dir=${HOME}/BirdNET-Pi
|
my_dir=${HOME}/BirdNET-Pi
|
||||||
|
branch=main
|
||||||
trap '${my_dir}/scripts/dump_logs.sh && exit' EXIT SIGHUP SIGINT
|
trap '${my_dir}/scripts/dump_logs.sh && exit' EXIT SIGHUP SIGINT
|
||||||
|
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ EOF
|
|||||||
echo
|
echo
|
||||||
echo "Installing stage 2 installation script now."
|
echo "Installing stage 2 installation script now."
|
||||||
cd ~
|
cd ~
|
||||||
curl -s -O "https://raw.githubusercontent.com/mcguirepr89/BirdNET-Pi/main/Birders_Guide_Installer.sh"
|
curl -s -O "https://raw.githubusercontent.com/mcguirepr89/BirdNET-Pi/${branch}/Birders_Guide_Installer.sh"
|
||||||
chmod +x Birders_Guide_Installer.sh
|
chmod +x Birders_Guide_Installer.sh
|
||||||
cat << EOF | sudo tee /etc/systemd/user/birdnet-system-installer.service &> /dev/null
|
cat << EOF | sudo tee /etc/systemd/user/birdnet-system-installer.service &> /dev/null
|
||||||
[Unit]
|
[Unit]
|
||||||
@@ -106,9 +107,10 @@ stage_2() {
|
|||||||
echo
|
echo
|
||||||
if [ ! -d ${my_dir} ];then
|
if [ ! -d ${my_dir} ];then
|
||||||
cd ~ || exit 1
|
cd ~ || exit 1
|
||||||
echo "Cloning the BirdNET-Pi repository in your home directory"
|
echo "Cloning the BirdNET-Pi repository $branch branch into your home directory"
|
||||||
git clone https://github.com/mcguirepr89/BirdNET-Pi.git ~/BirdNET-Pi
|
git clone -b ${branch} https://github.com/mcguirepr89/BirdNET-Pi.git ~/BirdNET-Pi
|
||||||
cd BirdNET-Pi && git checkout main
|
else
|
||||||
|
cd ${my_dir} && git checkout ${branch}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ${my_dir}/Birders_Guide_Installer_Configuration.txt ];then
|
if [ -f ${my_dir}/Birders_Guide_Installer_Configuration.txt ];then
|
||||||
@@ -122,7 +124,7 @@ and then close the Mouse Pad editing window to continue."
|
|||||||
else
|
else
|
||||||
editor=mousepad
|
editor=mousepad
|
||||||
fi
|
fi
|
||||||
$editor ${my_dir}/Birders_Guide_Installer_Configuration.txt &> /dev/null
|
$editor ${my_dir}/Birders_Guide_Installer_Configuration.txt
|
||||||
while pgrep $editor &> /dev/null;do
|
while pgrep $editor &> /dev/null;do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
@@ -410,7 +412,7 @@ SYSTEMD_MOUNT=$(echo ${RECS_DIR#/} | tr / -).mount
|
|||||||
## VENV is the virtual environment where the the BirdNET python build is found,
|
## VENV is the virtual environment where the the BirdNET python build is found,
|
||||||
## i.e, VENV is the virtual environment miniforge built for BirdNET.
|
## i.e, VENV is the virtual environment miniforge built for BirdNET.
|
||||||
|
|
||||||
VENV=${my_dir}/miniforge/envs/birdnet
|
VENV=${my_dir}/birdnet
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#---------------------------------- Testing -----------------------------------#
|
#---------------------------------- Testing -----------------------------------#
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1,3 +0,0 @@
|
|||||||
Poecile atricapillus_Black-capped Chickadee
|
|
||||||
Junco hyemalis_Dark-eyed Junco
|
|
||||||
Pipilo maculatus_Spotted Towhee
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Start (s);End (s);Scientific name;Common name;Confidence
|
|
||||||
0.0;3.0;Columba livia;Rock Pigeon;0.18658808
|
|
||||||
|
@@ -108,7 +108,7 @@ run_analysis() {
|
|||||||
--overlap "${OVERLAP}" \
|
--overlap "${OVERLAP}" \
|
||||||
--sensitivity "${SENSITIVITY}" \
|
--sensitivity "${SENSITIVITY}" \
|
||||||
--min_conf "${CONFIDENCE}""
|
--min_conf "${CONFIDENCE}""
|
||||||
python3 analyze.py \
|
"${VENV}"/bin/python analyze.py \
|
||||||
--i "${1}/${i}" \
|
--i "${1}/${i}" \
|
||||||
--o "${1}/${i}.csv" \
|
--o "${1}/${i}.csv" \
|
||||||
--lat "${LATITUDE}" \
|
--lat "${LATITUDE}" \
|
||||||
@@ -128,7 +128,7 @@ run_analysis() {
|
|||||||
--sensitivity "${SENSITIVITY}" \
|
--sensitivity "${SENSITIVITY}" \
|
||||||
--min_conf "${CONFIDENCE}" \
|
--min_conf "${CONFIDENCE}" \
|
||||||
--custom_list "${CUSTOM_LIST}""
|
--custom_list "${CUSTOM_LIST}""
|
||||||
python3 analyze.py \
|
"${VENV}"/bin/python analyze.py \
|
||||||
--i "${1}/${i}" \
|
--i "${1}/${i}" \
|
||||||
--o "${1}/${i}.csv" \
|
--o "${1}/${i}.csv" \
|
||||||
--lat "${LATITUDE}" \
|
--lat "${LATITUDE}" \
|
||||||
|
|||||||
+17
-12
@@ -47,22 +47,27 @@ install_deps() {
|
|||||||
|
|
||||||
install_birdnet() {
|
install_birdnet() {
|
||||||
cd ~/BirdNET-Pi || exit 1
|
cd ~/BirdNET-Pi || exit 1
|
||||||
|
echo "Establishing a python virtual environment"
|
||||||
|
python3 -m venv birdnet
|
||||||
|
source ./birdnet/bin/activate
|
||||||
echo "Upgrading pip, wheel, and setuptools"
|
echo "Upgrading pip, wheel, and setuptools"
|
||||||
sudo pip3 install --upgrade pip wheel setuptools
|
pip3 install --upgrade pip wheel setuptools
|
||||||
echo "Fetching the TFLite pre-built binaries"
|
if [ ! -f $(dirname ${my_dir})/tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl ];then
|
||||||
TFLITE_URL="https://drive.google.com/uc?export=download&id=1dlEbugFDJXs-YDBCUC6WjADVtIttWxZA"
|
echo "Fetching the TFLite pre-built binaries"
|
||||||
curl -c /tmp/cookie ${TFLITE_URL}
|
TFLITE_URL="https://drive.google.com/uc?export=download&id=1dlEbugFDJXs-YDBCUC6WjADVtIttWxZA"
|
||||||
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
|
curl -c /tmp/cookie ${TFLITE_URL}
|
||||||
TF_COOKIE="https://drive.google.com/uc?export=download&confirm=${CODE}&id=1dlEbugFDJXs-YDBCUC6WjADVtIttWxZA"
|
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
|
||||||
curl -Lb /tmp/cookie ${TF_COOKIE} -o tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl
|
TF_COOKIE="https://drive.google.com/uc?export=download&confirm=${CODE}&id=1dlEbugFDJXs-YDBCUC6WjADVtIttWxZA"
|
||||||
echo "Installing the new TFLite bin wheel"
|
curl -Lb /tmp/cookie ${TF_COOKIE} -o tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl
|
||||||
sudo pip3 install --upgrade tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl
|
fi
|
||||||
|
echo "Installing the TFLite bin wheel"
|
||||||
|
pip3 install --upgrade tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl
|
||||||
echo "Installing colorama==0.4.4"
|
echo "Installing colorama==0.4.4"
|
||||||
sudo pip3 install colorama==0.4.4
|
pip3 install colorama==0.4.4
|
||||||
echo "Installing librosa"
|
echo "Installing librosa"
|
||||||
sudo pip3 install librosa
|
pip3 install librosa
|
||||||
echo "Installing mysql-connector-python"
|
echo "Installing mysql-connector-python"
|
||||||
sudo pip3 install mysql-connector-python
|
pip3 install mysql-connector-python
|
||||||
}
|
}
|
||||||
|
|
||||||
read -sp "\
|
read -sp "\
|
||||||
|
|||||||
@@ -435,7 +435,7 @@ SYSTEMD_MOUNT=$(echo ${RECS_DIR#/} | tr / -).mount
|
|||||||
## VENV is the virtual environment where the the BirdNET python build is found,
|
## VENV is the virtual environment where the the BirdNET python build is found,
|
||||||
## i.e, VENV is the virtual environment miniforge built for BirdNET.
|
## i.e, VENV is the virtual environment miniforge built for BirdNET.
|
||||||
|
|
||||||
VENV=$(dirname ${my_dir})/miniforge/envs/birdnet
|
VENV=$(dirname ${my_dir})/birdnet
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#---------------------------------- Testing -----------------------------------#
|
#---------------------------------- Testing -----------------------------------#
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user