BirdNET is great for analyzing files stored locally but we sometimes want to analyze files that are stored remotely. This repository aims to close that gap by using a modified version of BirdNET-Analyzer/analyze.py that leverages fsspec, a python library that help open files that are stored remotely.
This repository is made so that we can pull the changes made to the BirdNET repository without any conflict.
1- Clone this repository and install the dependancies
# Clone this repository:
git clone https://github.com/NINAnor/birdnetfs.git
cd birdnetfs
pip install requirements.txt
2- Clone the BirdNET repository:
git clone https://github.com/kahst/BirdNET-Analyzer.git
mv BirdNET-Analyzer birdnetsrc
3- Analyze
There is two options.
- First you can analyze a file of your chosing using:
export PYTHONPATH="${PYTHONPATH}:./birdnetsrc"
python analyse.py filecache::ssh://$USER:$PASSWORD@HOST:/PATH/TO/AUDIO/FILE1.mp3
- Or analyze multiple files in parallel (using GNU parallel):
In files_to_analyze.csv
list the files that you want to analyze
Then run:
sudo apt-get install parallel
time systemd-run --scope --user --property=CPUWeight=1 -- sh -c './analyse.sh'
Analyzing the files will return Birdnet.selection.table.txt
files in the OUTPUT_PATH_BIRDNET
.
1- Update the config_connection.yaml
2- Build a .parquet
database using:
python3 src/parse_results.py
⭐ Note that the database will contain $NUM_SEGMENT
at $THRESHOLD
. Both parameters saved in config_connection.yaml
.
3- Extract the detections!
python3 src/extract.py