Skip to main content

Bioacoustic processing and Pied tamarin (Saguinus bicolor) vocalization detector.

Project description

🐒 Sauim Bioacoustic Detector

sauim-detector is a Python command-line tool for bioacoustic processing and automatic detection of Pied tamarin (Saguinus bicolor) vocalizations. It uses a pre-trained bird vocalization embedding model and a custom One-Class SVM classifier trained to detect the target species.

Quick tutorial: Watch on YouTube

Installation

Create and activate a Python 3.12 environment. This step is recommended to keep dependencies isolated; the environment name can be anything:

conda create -n sauim python=3.12 pip
conda activate sauim
python -m pip install --upgrade pip

Install the released package from PyPI:

python -m pip install sauim-detector

For local development, clone the repository and install the package in editable mode:

git clone https://github.com/juancolonna/Sauim.git
cd Sauim
python -m pip install -e ./sauim-detector

The package requires Python >=3.12,<3.13. TensorFlow and TensorFlow Hub compatibility is sensitive to Python and setuptools versions, so the project pins setuptools<82.

Usage

Run the detector with a path to a .wav file:

sauim-detector records/Mindu_Saguinus_bicolor_02.02.19-000.wav

The --stride argument sets the hop length, in seconds, between consecutive analysis windows. It accepts values from 1.0 to 5.0; the default is 5.0. Lower values use more overlap between windows and may improve coverage of short vocalizations, but increase processing time. Example:

sauim-detector records/Mindu_Saguinus_bicolor_02.02.19-000.wav --stride 2.5

By default, detections are printed to the terminal in JSON format. To save detections as an Audacity label file use:

sauim-detector records/Mindu_Saguinus_bicolor_02.02.19-000.wav --save-detections

Save the band-pass filtered audio used by the detector:

sauim-detector records/Mindu_Saguinus_bicolor_02.02.19-000.wav --save-audio

Use all three options together:

sauim-detector records/Mindu_Saguinus_bicolor_02.02.19-000.wav --stride 2.5 --save-detections --save-audio

Outputs

With --save-detections, the CLI writes an Audacity-compatible label file named <input>_detections.txt next to the input audio:

start_time    end_time    label
0.00          7.20        Pied tamarin
10.00         15.50       Pied tamarin
20.00         30.80       Pied tamarin

These labels can be imported into Audacity with File > Import > Labels....

Without --save-detections, the CLI prints JSON detections to stdout. Each detection includes:

  • species: common name
  • scientific: scientific name
  • confidence: One-Class SVM decision score, not a calibrated probability
  • start_time: detection start time in seconds
  • end_time: detection end time in seconds

Example:

[
  {
    "species": "Pied tamarin",
    "scientific": "Saguinus bicolor",
    "confidence": 0.003421,
    "start_time": 12.0,
    "end_time": 17.0
  }
]

Notes

  • Input files must be .wav files.
  • Audio is loaded at 32 kHz.
  • The classifier only detects the target species, Pied tamarin (Saguinus bicolor).
  • The confidence field is the raw OCSVM decision score. Positive scores are detections; negative scores are rejected before output.
  • Labels should be manually validated in Audacity.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sauim_detector-0.1.6.tar.gz (75.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sauim_detector-0.1.6-py3-none-any.whl (74.9 kB view details)

Uploaded Python 3

File details

Details for the file sauim_detector-0.1.6.tar.gz.

File metadata

  • Download URL: sauim_detector-0.1.6.tar.gz
  • Upload date:
  • Size: 75.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for sauim_detector-0.1.6.tar.gz
Algorithm Hash digest
SHA256 cb51111d2c9d468343505233a7bd85113a70cf996dea03017b86ed68121f89af
MD5 b61868db7f738a8506b28650dc9ed4c7
BLAKE2b-256 6b2076536fa500a173e6898e8528a3b4de95d25ff6807f06368bb1e33a2b7298

See more details on using hashes here.

File details

Details for the file sauim_detector-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: sauim_detector-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 74.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for sauim_detector-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 475325ceb49eb9f2728d2ac624ec80de6b8c1e0aa812952e700cd498cba51e7e
MD5 82a066d92fbd8ba2ea9f6940a04c15c6
BLAKE2b-256 45364781ef7dc6d442ec5a8ac27f1f85e27cf64c1fe67bda55816f5719d7e460

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page