Skip to main content

A Python package providing a common interface for running machine learning models for audio classification tasks.

Project description

audioclass

A Python library that simplifies the process of using machine learning models for audio classification.

Description

Audioclass provides a unified interface for working with various audio classification models, making it easier to load, preprocess, batch process, and analyze audio data. It offers:

  • Standardized Model Interface: Easily swap between different model implementations (TensorFlow, TensorFlow Lite, etc.) without changing your code.
  • Flexible Data Loading: Load audio data from files, directories, or pandas DataFrames with a few simple commands.
  • Efficient Batch Processing: Effortlessly process large datasets in batches for faster inference.
  • Unified Postprocessing: Convert model outputs into easy-to-use formats like xarray datasets or soundevent objects.
  • Pre-trained Models: Get started quickly with built-in support for popular models like BirdNET and Perch.

Installation

Get started with audioclass in a snap:

pip install audioclass

Optional Dependencies:

  • For BirdNET: Install additional dependencies using pip install "audioclass[birdnet]".
  • For Perch: Install additional dependencies using pip install "audioclass[perch]".

How to Use It

Here's a quick example of how to load the BirdNET model, preprocess an audio file, and get predictions:

from audioclass.models.birdnet import BirdNET

# Load the model
model = BirdNET.load()

# Get predictions
predictions = model.process_file("path/to/audio/file.wav")

print(predictions)

For more detailed examples, tutorials, and complete API documentation, visit our documentation website.

Contributing

We welcome contributions to audioclass! If you'd like to get involved, please check out our Contributing Guidelines.

Attribution

  • The BirdNET model was developed by the K. Lisa Yang Center for Conservation Bioacoustics at the Cornell Lab of Ornithology, in collaboration with Chemnitz University of Technology. This package is not affiliated with the BirdNET project. If you use the BirdNET model, please cite the relevant paper (see the audioclass.models.birdnet module docstring for details).

  • The Perch model is a research product by Google Research. This package is not affiliated with Google Research.

Audioclass is an independent project and is not affiliated with either the BirdNET or Perch projects.

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

audioclass-0.2.4.tar.gz (48.3 MB view details)

Uploaded Source

Built Distribution

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

audioclass-0.2.4-py3-none-any.whl (48.3 MB view details)

Uploaded Python 3

File details

Details for the file audioclass-0.2.4.tar.gz.

File metadata

  • Download URL: audioclass-0.2.4.tar.gz
  • Upload date:
  • Size: 48.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for audioclass-0.2.4.tar.gz
Algorithm Hash digest
SHA256 46948e8695c6872005d13b7b9bf3c7a80f871417fca01bc8175dfd62ff5dc1fe
MD5 6b07cd3e11d32b9c31bb9dfe73881ce9
BLAKE2b-256 718c9f55fca443705d2c0f41a018eb0b521f70d4262ab03f4a8df4565e7718a0

See more details on using hashes here.

File details

Details for the file audioclass-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: audioclass-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 48.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for audioclass-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f45c66f50a3ec4de13b113d7f895d3e8bdf516b320ba071e3cbc7a2f47b11421
MD5 e8e796c66d6e9866ed9a762f8d4fcede
BLAKE2b-256 e743f83d77548205573a30eee41b8cc303e889e9598fbd8a689d6dd3ebb361e0

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