Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
|
| 10 |
model_card = ModelCard(
|
| 11 |
name="S-KEY Detection",
|
| 12 |
description="Musical key detection using Self-supervised Key Detection.",
|
| 13 |
-
author="
|
| 14 |
tags=["key detection", "mir"],
|
| 15 |
)
|
| 16 |
|
|
@@ -18,7 +18,12 @@ model_card = ModelCard(
|
|
| 18 |
def process_fn(input_audio_path):
|
| 19 |
try:
|
| 20 |
ext = input_audio_path.split(".")[-1].lower()
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
if isinstance(detected_key, list):
|
| 24 |
detected_key = detected_key[0]
|
|
|
|
| 10 |
model_card = ModelCard(
|
| 11 |
name="S-KEY Detection",
|
| 12 |
description="Musical key detection using Self-supervised Key Detection.",
|
| 13 |
+
author="Yuexuan Kong et al.",
|
| 14 |
tags=["key detection", "mir"],
|
| 15 |
)
|
| 16 |
|
|
|
|
| 18 |
def process_fn(input_audio_path):
|
| 19 |
try:
|
| 20 |
ext = input_audio_path.split(".")[-1].lower()
|
| 21 |
+
|
| 22 |
+
detected_key = detect_key(
|
| 23 |
+
audio_dir=input_audio_path,
|
| 24 |
+
extension=ext,
|
| 25 |
+
device=DEVICE
|
| 26 |
+
)
|
| 27 |
|
| 28 |
if isinstance(detected_key, list):
|
| 29 |
detected_key = detected_key[0]
|