Skip to content

Analysis and identification of bird sounds with Python.

Notifications You must be signed in to change notification settings

marmelab/Peupleute

Repository files navigation

Peupleute

Analysis and identification of bird sounds with Python.

Requirements

  • Python 3.9.x

Installing Dependencies

Installation is as simple as:

    pip install -r requirements.txt

Notebook

To browse the notebook just run the following command:

    jupyter notebook

Then open your browser at http://localhost:8888/notebooks/notebooks/birdnet.ipynb

Identification

To identify birds in a record, you can use the birdnet model using:

    cd birdnet && python analyze.py --i '../notebooks/songs/pic-vert.wav'

And then read the result in the generated result.csv file.

Test model

You can test the birdnet model against a bunch of recording of bird songs by following these steps.

First, you have to download some bird songs, you can use the dowload_bird_songs.py for it. Feel free to update the list of birds you want to get records from.

    python dowload_bird_songs.py

Otherwise you can just add manually new songs, following this directory structure:

- dataset
    - audio
        - HouseSparrow
            - song1.mp3
            - song2.mp3
        - CommonStarling
            - song1.mp3
            - song2.mp3

And then test the model against the recordings:

    python test_model.py

NOTE: You should name the bird using the vernacular name or scientific name used in the birdnet/model/labels.txt file.

REST API

To start the server that allows bird songs identification throught a REST API, you have to start the server using:

    fastapi dev ./api/main.py

And then make a POST request on the http://localhost:8080/identify/ passing a record file. You can use http://localhost:8080/docs or Bruno to make the request using an interface.

TODO

About

Analysis and identification of bird sounds with Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published