panns-inference
panns_inference: audio tagging and sound event detection inference toolbox
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-inferenceuv
uv add panns-inferencepoetry
poetry add panns-inferenceInstalling 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
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
resemble-perthEmbeds imperceptible watermarks into audio…
permissive · top 15,000 on PyPI
snacSNAC compresses audio into discrete…
unclear · top 15,000 on PyPI
laion-clapExtracts learned audio and text embeddings…
permissive · top 15,000 on PyPI
speechbrainSpeechBrain is a PyTorch-based toolkit for…
permissive · top 5,000 on PyPI
sherpa-onnx-coresherpa-onnx-core provides pre-built ONNX…
permissive · top 15,000 on PyPI
aubioaubio is a Python wrapper around a C library…
copyleft · top 15,000 on PyPI
encodecEnCodec is a neural audio codec that compresses…
noncommercial · top 15,000 on PyPI
torchcrepePyTorch implementation of the CREPE pitch…
permissive · top 15,000 on PyPI
pyacoustidProvides Python bindings for Chromaprint…
permissive · top 15,000 on PyPI
audio-separatorSeparates audio files into multiple stems…
permissive · top 15,000 on PyPI