skillfed

panns-inference

panns_inference: audio tagging and sound event detection inference toolbox

panns-inference v0.1.1 81.8K downloads/30d#14,200 on PyPI268
Permissive license DORMANT released

What it is and what it does

panns_inference wraps pretrained audio neural networks from the PANNs project to perform two main tasks: audio tagging (labeling what sounds are present in an audio clip with confidence scores) and sound event detection (identifying when specific sounds occur within an audio file). It loads audio via librosa, feeds it through pretrained convolutional neural network models, and returns either clip-level tags with probabilities or frame-level event predictions. The package is designed for researchers and developers who want to apply pretrained audio understanding without training their own models.

The package depends on librosa for audio loading and preprocessing, matplotlib for visualization, and torchlibrosa for PyTorch-compatible audio feature extraction. It requires PyTorch >= 1.0 and Python >= 3.6. Since the last release was in March 2023 and the repository shows no recent commits, the package is in maintenance limbo—it will work with existing code but should not be expected to receive updates for compatibility with newer dependencies.

Use it for:

  • Classify audio clips into semantic categories (speech, music, vehicle sounds, etc.) with confidence scores for content moderation or audio organization.
  • Detect and timestamp specific sound events within longer audio recordings for audio annotation or event-based analysis.
  • Extract audio embeddings from pretrained models for downstream machine learning tasks like clustering or similarity search.
  • Prototype audio understanding features in applications without the overhead of training custom models from scratch.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides pretrained neural network models for audio tagging and sound event detection on audio files using PANNs (Pretrained Audio Neural Networks).

Yes, if you need audio tagging or sound event detection and can tolerate dormant maintenance. The package is stable, has no known vulnerabilities, and low install friction. However, do not expect bug fixes or updates—verify that the pretrained models and PyTorch compatibility meet your production requirements before committing to it for critical systems.

Install

panns-inference on PyPI

pip

pip install panns-inference

uv

uv add panns-inference

poetry

poetry add panns-inference

Installing panns-inference

Before you install

Low install friction with a pure-Python wheel. Maintenance is dormant—last commit was 2024-03-05 and no releases since 2023-03-26—so expect no active bug fixes or updates, though the codebase remains archived and available.

License in practice

MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, provided you retain the license notice.

Quickstart

import librosa
from panns_inference import AudioTagging, SoundEventDetection

audio_path = 'examples/audio.wav'
audio, _ = librosa.core.load(audio_path, sr=32000, mono=True)
audio = audio[None, :]

at = AudioTagging(checkpoint_path=None, device='cuda')
clipwise_output, embedding = at.inference(audio)

PyTorch >= 1.0 is required; GPU device support (cuda) is optional but models run on CPU if device='cpu' is specified.

Verify before relying

  • Whether pretrained checkpoint files are automatically downloaded or must be manually provided.
  • Current accuracy/performance metrics for the bundled models on modern audio datasets.
  • Compatibility with recent PyTorch and librosa versions beyond the minimum requirements.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 3 — matplotlib, librosa, torchlibrosa
Maintenance dormant — 1,237 days since the last release
Last repo commit
First released
Downloads 81,794/month — #14,200 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: panns_inference-0.1.1-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

audio tagging inferencesound event detectionaudio classificationpretrained audio modelsaudio pattern recognitionneural audio analysis
audio-analysispretrained-modelssound-detection

More Artificial Intelligence packages

Further reading