birdnetlib
A python api for BirdNET-Analyzer and BirdNET-Lite
birdnetlib provides a common interface for BirdNET-Analyzer and BirdNET-Lite.
Documentation
Documentation is at https://joeweiss.github.io/birdnetlib.
See Getting Started for a quick introduction.
Installation
birdnetlib requires Python 3.9+ and prior installation of Tensorflow Lite, librosa and ffmpeg. See BirdNET-Analyzer for more details on installing the Tensorflow-related dependencies.
pip install birdnetlib
Basic usage
To use the latest BirdNET-Analyzer model, use the Analyzer class.
from birdnetlib import Recording
from birdnetlib.analyzer import Analyzer
from datetime import datetime
# Load and initialize the BirdNET-Analyzer models.
analyzer = Analyzer()
recording = Recording(
analyzer,
"sample.mp3",
lat=35.4244,
lon=-120.7463,
date=datetime(year=2022, month=5, day=10), # use date or week_48
min_conf=0.25,
)
recording.analyze()
print(recording.detections)
recording.detections contains a list of detected species, along with time ranges and confidence value.
[{'common_name': 'House Finch',
'confidence': 0.5744,
'end_time': 12.0,
'scientific_name': 'Haemorhous mexicanus',
'start_time': 9.0,
'label': 'Haemorhous mexicanus_House Finch'},
{'common_name': 'House Finch',
'confidence': 0.4496,
'end_time': 15.0,
'scientific_name': 'Haemorhous mexicanus',
'start_time': 12.0,
'label': 'Haemorhous mexicanus_House Finch'}]
The Recording class takes a file path as an argument. You can also use RecordingFileObject to analyze an in-memory object, or RecordingBuffer for handling an array buffer.
About BirdNET-Lite and BirdNET-Analyzer
birdnetlib uses models provided by BirdNET-Lite and BirdNET-Analyzer under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License.
BirdNET-Lite and BirdNET-Analyzer were developed by the K. Lisa Yang Center for Conservation Bioacoustics at the Cornell Lab of Ornithology.
For more information on BirdNET analyzers, please see the project repositories below:
birdnetlib is not associated with BirdNET-Lite, BirdNET-Analyzer or the K. Lisa Yang Center for Conservation Bioacoustics.
About birdnetlib
birdnetlib is maintained by Joe Weiss. Contributions are welcome.
Project Goals
- Establish a unified API for interacting with Tensorflow-based BirdNET analyzers
- Enable python-based test cases for BirdNET analyzers
- Make it easier to use BirdNET in python-based projects
- Make it easier to migrate to new BirdNET versions/models as they become available
Release files for birdnetlib 0.18.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| birdnetlib-0.18.1.tar.gz | 61.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| birdnetlib-0.18.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 122.2 MB
Release files / birdnetlib-0.18.1.tar.gz
| Download URL | birdnetlib-0.18.1.tar.gz |
|---|---|
| Size | 61.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40b65f1679c7d6c111d9a88978392936b6a4639720b9cf744534f21536d19c09
|
|
BLAKE2b-256 checksum How to use checksums |
62f7515cf733697f4125687b6aaab5609ae82dabedaab84bf35518af9599d33f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.20
|
Release files / birdnetlib-0.18.1-py3-none-any.whl
| Download URL | birdnetlib-0.18.1-py3-none-any.whl |
|---|---|
| Size | 61.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d2283e5f747ee181b90c41b88a247ee5570152b1ad0298242bda820871d33c49
|
|
BLAKE2b-256 checksum How to use checksums |
6a0e40f2109f86702e4da61eaf13d06a0af9ad38f8a614216d7f027ee0845c34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.20
|