panns_AT_inference: audio tagging inference toolbox
Project description
PANNs AT (Audio Tagging) inference
panns_AT_inference provides an easy to use Python interface for audio tagging. The audio tagging models are trained from PANNs: Large-Scale Pretrained Audio Neural Networks for Audio Pattern Recognition: https://github.com/qiuqiangkong/audioset_tagging_cnn
This is a forked repository/project w. the Top-3 models (see References)
Installation
PyTorch>=1.0 is required.
$ pip install panns_AT_inference
Usage
$ python3 example.py
For example:
import librosa
import panns_AT_inference
from panns_AT_inference import AudioTagging, labels
audio_path = 'examples/R9_ZSCveAHg_7s.wav'
(audio, _) = librosa.core.load(audio_path, sr=32000, mono=True)
audio = audio[None, :] # (batch_size, segment_samples)
print('------ Audio tagging ------')
at = AudioTagging(model_name=None, device='cuda')
(clipwise_output, embedding) = at.inference(audio)
Results
------ Audio tagging ------ Checkpoint path: /root/panns_data/Cnn14_mAP=0.431.pth GPU number: 1 Speech: 0.893 Telephone bell ringing: 0.754 Inside, small room: 0.235 Telephone: 0.183 Music: 0.092 Ringtone: 0.047 Inside, large room or hall: 0.028 Alarm: 0.014 Animal: 0.009 Vehicle: 0.008
References
[1] Kong, Qiuqiang, Yin Cao, Turab Iqbal, Yuxuan Wang, Wenwu Wang, and Mark D. Plumbley. "PANNs: Large-Scale Pretrained Audio Neural Networks for Audio Pattern Recognition." arXiv preprint arXiv:1912.10211 (2019).
[2]
@article{9229505,
author={Kong, Qiuqiang and Cao, Yin and Iqbal, Turab and Wang, Yuxuan and Wang, Wenwu and Plumbley, Mark D.},
journal={IEEE/ACM Transactions on Audio, Speech, and Language Processing},
title={PANNs: Large-Scale Pretrained Audio Neural Networks for Audio Pattern Recognition},
year={2020},
volume={28},
number={},
pages={2880 -- 2894},
doi={10.1109/TASLP.2020.3030497}
}
[3] Official GitHub repository: https://github.com/qiuqiangkong/audioset_tagging_cnn , https://github.com/qiuqiangkong/panns_inference
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file panns_AT_inference-0.1.4.tar.gz
.
File metadata
- Download URL: panns_AT_inference-0.1.4.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b3520906647ac20c212208718645cd2f149e6b57200174a97e3d74599318c19 |
|
MD5 | 485c1c789cdef956efd614579344701c |
|
BLAKE2b-256 | 3332c401f6af87924ee6114ef44d9b1d1e797b3339d544acf3ff6187a54c49ba |
File details
Details for the file panns_AT_inference-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: panns_AT_inference-0.1.4-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 486c0f359cb4eada3a30faccd1528dfd585537bae9e0e66f240175d2812c7ca5 |
|
MD5 | 36be173e13c1fd363747dd8c73c27abc |
|
BLAKE2b-256 | 6692e5077b0120029e33d100489ac603a35548ddf99a57fa1a6751a45a171e8e |