utils: Add a script replacing birdnet_miner in it work to update the database according to all files in CHUNK_FOLDER/out

This commit is contained in:
Samuel Ortion 2022-08-25 11:39:45 +02:00
parent 97c22977d0
commit 6f7c27d62e
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
#! /usr/bin/env bash
# Extract observations from a model output folder
#
set -e
# set -x
DEBUG=${DEBUG:-1}
debug() {
[[ $DEBUG -eq 1 ]] && echo "$@"
}
if [[ -f ./config/birdnet.conf ]]; then
source ./config/birdnet.conf
else
debug "./config/birdnet.conf does not exist"
exit 1
fi
if [[ ! -d ${CHUNK_FOLDER} ]]; then
debug "CHUNK_FOLDER ${CHUNK_FOLDER} does not exist"
exit 1
fi
model_outputs() {
ls ${CHUNK_FOLDER}/out/*/model.out.csv
}
main() {
# # Remove all junk observations
# ./daemon/birdnet_clean.sh
# Get model outputs
for model_output in $(model_outputs); do
./daemon/birdnet_output_to_sql.sh "$model_output"
done
}
main