Skip to main content

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.

Release files for audioclass 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for audioclass 0.2.5
File Size Uploaded
audioclass-0.2.5.tar.gz 48.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for audioclass 0.2.5
File Interpreter ABI Platform
audioclass-0.2.5-py3-none-any.whl Python 3 none any Details

Total release size: 96.6 MB

Release files / audioclass-0.2.5.tar.gz

Download URL audioclass-0.2.5.tar.gz
Size 48.3 MB
Tags Source
SHA-256 checksum
How to use checksums
b3ead8d835ffd334ed1be5dc6c550f1629684b8f2c2c1a0cc01fd35bbc3c89c4
BLAKE2b-256 checksum
How to use checksums
c838228a88a0b81baf15cfdca1ce8cd09c01116a189f143b4ef7793df7ed9daa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / audioclass-0.2.5-py3-none-any.whl

Download URL audioclass-0.2.5-py3-none-any.whl
Size 48.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8b5a1da0af7603eb741a7102c6e362b983656d686f988cc20936ab4abc3d4713
BLAKE2b-256 checksum
How to use checksums
bb0698c07a5e3f08c0de71da2370a89ccc9ebee93bc69ef784965f13bc345d08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

0.2.5 This release

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page