Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Music Detection with WavLM
|
| 2 |
+
|
| 3 |
+
Detects if audio contains music.
|
| 4 |
+
**EER: 2.5–3%** | Based on `microsoft/wavlm-base-plus`
|
| 5 |
+
*the best threshold value* `0.2442`
|
| 6 |
+
---
|
| 7 |
+
## Quick Start
|
| 8 |
+
```
|
| 9 |
+
git clone https://huggingface.co/MTUCI/MusicDetection
|
| 10 |
+
cd MusicDetection
|
| 11 |
+
pip install -r requirements.txt
|
| 12 |
+
```
|
| 13 |
+
## ▶ Usage
|
| 14 |
+
|
| 15 |
+
```python
|
| 16 |
+
from model import WavLMForMusicDetection
|
| 17 |
+
from safetensors import safe_open
|
| 18 |
+
|
| 19 |
+
model = WavLMForMusicDetection(batch_size=32, device='cuda')
|
| 20 |
+
with safe_open('music_detection.safetensors', framework="pt") as f:
|
| 21 |
+
model.load_state_dict({k: f.get_tensor(k) for k in f.keys()})
|
| 22 |
+
|
| 23 |
+
probs = model.predict_proba(['audio1.mp3', 'audio2.wav']) # → tensor([0.88, 0.11])
|
| 24 |
+
|
| 25 |
+
|