diff --git a/utils/synchronize_model_outputs_with_database.sh b/utils/synchronize_model_outputs_with_database.sh new file mode 100644 index 0000000..d2951d8 --- /dev/null +++ b/utils/synchronize_model_outputs_with_database.sh @@ -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 \ No newline at end of file