-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0c877b9
Showing
12 changed files
with
7,408 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Go-BirdNet | ||
|
||
Golang implementation of Birdnet Analyzer. | ||
|
||
Go-BirdNet is an application inspired by BirdNet Analyzer, developed by the K. Lisa Yang Center for Conservation Bioacoustics at the Cornell Lab of Ornithology and Chemnitz University of Technology. While the original BirdNet is based on Python, Go-BirdNet is built using Golang, aiming for simplified deployment across multiple platforms, from Windows PCs to single board computers like Raspberry Pi. | ||
|
||
Currently, Go-BirdNet supports the analysis of WAV files only, support for other audio file formats is planned. Use of metadata model for location-based filtering is not yet implemented. This is very much of work in progress, and contributions and feedback are welcome. | ||
|
||
## Dependencies | ||
|
||
Go-BirdNet primarily relies on go-tflite by Yasuhiro Matsumoto (a.k.a. mattn). Go-tflite provides a Go binding for the TensorFlow Lite C API. Although go-tflite is documented to support only TensorFlow Lite version 2.2.0-rc3, I have successfully compiled it against version 2.14.0. As go-tflite is a C API binding compiled binary is not statically linked one, it is depending on libtensorflowlite_c.so to be present on deployment target system. | ||
|
||
A crucial component is the BirdNet tflite model. After all, Go-BirdNet essentially serves as an interface to this model, with the core detection functionality residing within the BirdNet tflite model itself. | ||
|
||
## Compiling | ||
|
||
### Building TensorFlow Lite | ||
|
||
Build tflite with cmake | ||
``` | ||
sudo apt-get install cmake | ||
``` | ||
|
||
Clone tensorflow repository | ||
``` | ||
git clone https://github.com/tensorflow/tensorflow.git tensorflow_src | ||
``` | ||
|
||
Create cmake build directory | ||
``` | ||
mkdir tflite_build | ||
cd tflite_build | ||
``` | ||
|
||
Run cmake | ||
``` | ||
cmake ../tensorflow_src/tensorflow/lite | ||
``` | ||
|
||
Build tflite, In the tflite_build directory do | ||
``` | ||
cmake --build . -j | ||
``` | ||
|
||
Copy compiled libtensorflowlite_c.so to /usr/local/lib | ||
|
||
### Building Go-BirdNet | ||
|
||
Clone go-birdnet repository | ||
``` | ||
https://github.com/tphakala/go-birdnet.git | ||
``` | ||
|
||
Add CGO_CFLAGS and point it to directory you cloned tensorflow source in | ||
``` | ||
export CGO_CFLAGS=-I$HOME/src/tensorflow/tensorflow_src | ||
``` | ||
|
||
Build Go-BirdNet | ||
``` | ||
cd go-birdnet | ||
go build birdnet.go | ||
``` | ||
|
||
## Usage | ||
|
||
``` | ||
$ ./birdnet -h | ||
Usage of ./birdnet: | ||
-input string | ||
Path to the input audio file (WAV) | ||
-model string | ||
Path to the model file (default "BirdNET_GLOBAL_6K_V2.4_Model_FP32.tflite") | ||
-overlap float | ||
Overlap value between 0.0 and 2.9 | ||
-sensitivity float | ||
Sigmoid sensitivity value between 0.0 and 1.5 (default 1) | ||
``` | ||
|
||
## License | ||
|
||
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International |
Oops, something went wrong.