Skip to main content

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

Project description

🐒 Sauim 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 to 5; the default is 5. 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

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 --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.5.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.5-py3-none-any.whl (74.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sauim_detector-0.1.5.tar.gz
Algorithm Hash digest
SHA256 2b2d973f3117070826b75013ed21eec17168334c61bcafeee21e1fa0c818ea77
MD5 5d7384d95175b4cec64ab2a49ae1bc95
BLAKE2b-256 b3703f120685d78d76f7fdd1924f14bf0663a4e1529c6d33f8b6ba6485fd97a4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sauim_detector-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6192f85b6d5921abb8ab197d2d097cb27754a8b945da745518e3b307577304ed
MD5 78e15fe2b6894355c0010c73dee43471
BLAKE2b-256 3c22e9baf3a44e359449bc4532462fc179355992e426fea9b4d41de64710acd5

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