Skip to main content

Detect (spider/howler) monkey calls using pretrained TF2 models from Hugging Face.

Project description

Monkey Call Detector

Detect spider monkey whinny calls (and howler monkey calls) in audio recordings using pre-trained TensorFlow models.

This package downloads a model from 🤗 Hugging Face and provides simple functions for ecologists and data scientists to run inference on short clips or entire recordings.


Installation

This has been tested with a fresh python 3.13 installation.

(Optional) Make a virtual environment (python -m venv /path/to/new/virtual/environment)

pip3 install monkeycall  # This will also install requirements.

Usage examples

You can now detect monkey calls. To detect spider monkeys try the following:

from monkeycall.spider_monkey import load_model, predict_recording

recording_path = "/path/to/sample.WAV"

repo_id = "georgiosrizos/spider-monkey-detector-SEResNet"

print("Reading pre-trained model.")
model = load_model(architecture=repo_id)

print("Reading long recording:", recording_path)
output_df = predict_recording(audio_path=recording_path,
                              model=model,
                              hop_size=1)

print("The recording has been clipped in 3 sec window clips. The whinny detection probabilities are:", output_df)

# You can save the pandas DataFrame to review later.
# output_df.to_csv("predictions.csv", index=False)

Or if you already have a 3 sec clip:

from monkeycall.spider_monkey import load_model, predict_3_sec_clip

recording_path = "/path/to/3sec.WAV"

repo_id = "georgiosrizos/spider-monkey-detector-SEResNet"

print("Reading pre-trained model.")
model = load_model(architecture=repo_id)

print("Reading clip:", negative)
output = predict_3_sec_clip(audio_path=recording_path,
                            model=model)

print("The probability this sample contains a whinny is:", output)

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

monkeycall-0.0.2.dev0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

monkeycall-0.0.2.dev0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file monkeycall-0.0.2.dev0.tar.gz.

File metadata

  • Download URL: monkeycall-0.0.2.dev0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for monkeycall-0.0.2.dev0.tar.gz
Algorithm Hash digest
SHA256 1c85ac0d448041f948ccc29368839ffa0bd083c6c3a981973ef248c6dbb60ca6
MD5 a2d2a0dd6c77be4c4f4998a0246d9e71
BLAKE2b-256 7a7c1e2e40c8ac583277d44a224d577cc709b813714c2018a0fd580a09c0de68

See more details on using hashes here.

File details

Details for the file monkeycall-0.0.2.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for monkeycall-0.0.2.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 0990c3062f5338737806c1a182cf21926bf754a6be74ee6e6f5fac8358574058
MD5 78081888aa6266fc28d35fc87133f1c0
BLAKE2b-256 f0bba627b027988280c11984b7d9ca9f878490d077304c0d33615b5916762f75

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