Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
# Audio Feature Extraction Models
|
| 5 |
+
|
| 6 |
+
This repository contains pre-trained models for audio feature extraction, specifically:
|
| 7 |
+
|
| 8 |
+
- **Key Detection:** Classifies the musical key of an audio track into relative key classes.
|
| 9 |
+
|
| 10 |
+
## Model Details
|
| 11 |
+
|
| 12 |
+
### Tempo Model
|
| 13 |
+
- **Model Type:** Custom CNN architecture for tempo classification.
|
| 14 |
+
- **Input:** Audio segments converted to Mel spectrograms followed by autocorrelation.
|
| 15 |
+
- **Output:** Predicts Beats Per Minute (BPM) in a range from [85, 170].
|
| 16 |
+
|
| 17 |
+
### Key Detection Models
|
| 18 |
+
- **Key Class Model:** Classifies into 12 relative key classes.
|
| 19 |
+
- **Key Quality Model:** Determines if the key is Major or Minor.
|
| 20 |
+
- **Input:** Audio segments converted to Mel spectrograms.
|
| 21 |
+
- **Output:**
|
| 22 |
+
- Key Class: One of 12 key signatures.
|
| 23 |
+
- Key Quality: Binary classification (0 for Major, 1 for Minor).
|
| 24 |
+
|
| 25 |
+
## Usage
|
| 26 |
+
|
| 27 |
+
### Prerequisites
|
| 28 |
+
- Python 3.7+
|
| 29 |
+
- PyTorch
|
| 30 |
+
- torchaudio
|
| 31 |
+
- transformers
|
| 32 |
+
|
| 33 |
+
### Loading Models
|
| 34 |
+
|
| 35 |
+
To use these models with Hugging Face's transformers library:
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
from transformers import [AutoModelForAudioClassification](https://x.com/i/grok?text=AutoModelForAudioClassification)
|
| 39 |
+
|
| 40 |
+
# Load Tempo Model
|
| 41 |
+
tempo_model = AutoModelForAudioClassification.from_pretrained("your_username/tempo_model")
|
| 42 |
+
|
| 43 |
+
# Load Key Models
|
| 44 |
+
key_class_model = AutoModelForAudioClassification.from_pretrained("your_username/key_class_model")
|
| 45 |
+
key_quality_model = AutoModelForAudioClassification.from_pretrained("your_username/key_quality_model")
|