diff --git a/INSTALL.md b/INSTALL.md index 9ebb0fe..aa68621 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,24 +2,6 @@ This guide allow you to install BirdNET-stream step by step on your debian based system. -For a one-liner installation, you can use the following command: - -```bash -curl -sL https://raw.githubusercontent.com/UncleSamulus/BirdNET-stream/main/install.sh | bash -``` - -For debug purposes, you can use the following command, it will log the installation steps to the console: - -```bash -DEBUG=1 ./install.sh -``` - -If you need to use a specific branch (e.g. dev), you can use the following command: - -```bash -BRANCH=dev ./install.sh -``` - ## Requirements - git diff --git a/README.md b/README.md index 19a8905..32c55ca 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ On debian based systems (tested on Debian Bullseye), the following command shoul # Change to your installation directory here, /home/$USER/Documents/BirdNET-stream for instance, or /opt/birdnet-stream, or whatever cd /path/to/installation/directory # Download installation script -curl -0 https://raw.githubusercontent.com/UncleSamulus/BirdNET-stream/main/install.sh +curl -O https://raw.githubusercontent.com/UncleSamulus/BirdNET-stream/main/install.sh # Run installation script: chmod +x ./install.sh ./install.sh diff --git a/docker-compose.yml b/docker-compose.yml index 006b27f..794801f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,19 +1,19 @@ version: '3.9' services: - # recording: - # container_name: birdnet_recording - # build: - # context: . - # dockerfile: ./docker/recording/Dockerfile - # restart: unless-stopped - # environment: - # - CHUNK_FOLDER=${CHUNK_FOLDER:-/media/birdnet/records} - # volumes: - # - ${RECORDS_DIR:-/media/birdnet/records}:${RECORS_FOLDER:-/media/birdnet/records} - # # Allow container to access to the hosts microphone - # devices: - # - /dev/snd:/dev/snd + recording: + container_name: birdnet_recording + build: + context: . + dockerfile: ./docker/recording/Dockerfile + restart: unless-stopped + volumes: + - birdnet_app:${PROJECT_ROOT:-/opt/birdnet} + - birdnet_records:${RECORDS_DIR:-/media/birdnet/records} + # Allow container to access to the hosts microphone + devices: + - /dev/snd:/dev/snd + # analyzer: # container_name: birdnet_analyzer # build: diff --git a/docker/recording/Dockerfile b/docker/recording/Dockerfile index 83ebbf0..dc5754f 100644 --- a/docker/recording/Dockerfile +++ b/docker/recording/Dockerfile @@ -11,15 +11,9 @@ ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get upgrade -y \ && apt-get install -y \ --no-install-recommends \ - libasound2 \ - alsa-utils \ - libsndfile1-dev \ - && apt-get install -y ffmpeg \ + ffmpeg \ && apt-get clean -RUN mkdir -p /opt/birdnet/ -WORKDIR /opt/birdnet/ -COPY config ./config -COPY daemon/birdnet_recording.sh /usr/local/bin/birdnet_recording.sh +WORKDIR /opt/birdnet -ENTRYPOINT ["/usr/local/bin/birdnet_recording.sh"] \ No newline at end of file +ENTRYPOINT ["./daemon/birdnet_recording.sh"] \ No newline at end of file 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