A fast, accurate Tempo Predictor
Project description
DeepRhythm: High-Speed Tempo Prediction
Introduction
DeepRhythm is a Convolutional Neural Network (CNN) designed for rapid, precise tempo prediction, specifically on modern music.
The implementation is heavily inspired by [1].
Audio is batch-processed using a vectorized HCQM, drastically reducing computation time by avoiding the common bottlenecks encountered in feature extraction.
Benchmarks
Method | Acc1 (%) | Acc2 (%) | Avg. Time (s) | Total Time (s) |
---|---|---|---|---|
DeepRhythm (cuda) | 95.91 | 96.54 | 0.021 | 20.11 |
DeepRhythm (cpu) | 95.91 | 96.54 | 0.12 | 115.02 |
TempoCNN (cnn) | 84.78 | 97.69 | 1.21 | 1150.43 |
TempoCNN (fcn) | 83.53 | 96.54 | 1.19 | 1131.51 |
Essentia (multifeature) | 87.93 | 97.48 | 2.72 | 2595.64 |
Essentia (percival) | 85.83 | 95.07 | 1.35 | 1289.62 |
Essentia (degara) | 86.46 | 97.17 | 1.38 | 1310.69 |
Librosa | 66.84 | 75.13 | 0.48 | 460.52 |
- Test done on 953 songs, mostly Electronic, Hip Hop, Pop, and Rock
- Acc1 = Prediction within +/- 2% of actual bpm
- Acc2 = Prediction within +/- 2% of actual bpm or a multiple (e.g. 120 ~= 60)
- Timed from filepath in to bpm out (audio loading, feature extraction, model inference)
- I could only get TempoCNN to run on cpu (it requires Cuda 10 and I'm not downgrading my Cuda install for curiosity's sake)
Installation
To install DeepRhythm, ensure you have Python and pip installed. Then run:
pip install deeprhythm
Usage
To predict the tempo of a song with DeepRhythm:
from deeprhythm import DeepRhythmPredictor
model = DeepRhythmPredictor()
tempo = model.predict('path/to/song.mp3')
print(f"Predicted Tempo: {tempo} BPM")
References
[1] Hadrien Foroughmand and Geoffroy Peeters, “Deep-Rhythm for Global Tempo Estimation in Music”, in Proceedings of the 20th International Society for Music Information Retrieval Conference, Delft, The Netherlands, Nov. 2019, pp. 636–643. doi: 10.5281/zenodo.3527890.
[2] K. W. Cheuk, H. Anderson, K. Agres and D. Herremans, "nnAudio: An on-the-Fly GPU Audio to Spectrogram Conversion Toolbox Using 1D Convolutional Neural Networks," in IEEE Access, vol. 8, pp. 161981-162003, 2020, doi: 10.1109/ACCESS.2020.3019084.
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 deeprhythm-0.0.9.tar.gz
.
File metadata
- Download URL: deeprhythm-0.0.9.tar.gz
- Upload date:
- Size: 10.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0129d56e379d1e168bd99b84a44e071ae1a07a301b62f2eced99e797d96e329c |
|
MD5 | 2e9fbe4af84b87d43951fc6077f0393b |
|
BLAKE2b-256 | 76b9fd97c071fdb872ef97f178eb699b02a46a41e4c953a1b9676c1a8b3d1475 |
File details
Details for the file deeprhythm-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: deeprhythm-0.0.9-py3-none-any.whl
- Upload date:
- Size: 27.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79972127864747f8e83cb60197fa5512759a710e6be438b20b798951b92ce22c |
|
MD5 | 355fa4252bf27e5ac06a1eb1417b6fbc |
|
BLAKE2b-256 | b5b288f6083be8fee80cd57c7f5dad8ff482e6b908471d097a8aa7b2a311e277 |