Spaces:
Running
Running
Bring the Space up to the pyharp example standard (taxonomy tags, __main__ guard, show_error, v0.4.0)
Browse files- README.md +1 -1
- app.py +18 -16
- requirements.txt +2 -1
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: π₯
|
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: cc-by-nc-4.0
|
|
|
|
| 4 |
colorFrom: red
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 6.24.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: cc-by-nc-4.0
|
app.py
CHANGED
|
@@ -14,6 +14,7 @@ from typing import Union, Tuple, Optional
|
|
| 14 |
from torch import Tensor
|
| 15 |
|
| 16 |
from pyharp import build_endpoint, ModelCard
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
# βββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -286,7 +287,7 @@ model_card = ModelCard(
|
|
| 286 |
name="LarsNet Drum Stem Separator",
|
| 287 |
description="Separates a drum mix into individual drum stems: Kick, Snare, Toms, Hi-Hat, and Cymbals.",
|
| 288 |
author="A. I. Mezza, et al.",
|
| 289 |
-
tags=[
|
| 290 |
)
|
| 291 |
|
| 292 |
MODEL = LarsNet(wiener_filter=False, device="cpu", config="config.yaml")
|
|
@@ -305,19 +306,20 @@ def process_fn(audio_path: str):
|
|
| 305 |
return tuple(output_paths)
|
| 306 |
|
| 307 |
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
|
|
|
| 322 |
|
| 323 |
-
demo.queue().launch(show_error=True)
|
|
|
|
| 14 |
from torch import Tensor
|
| 15 |
|
| 16 |
from pyharp import build_endpoint, ModelCard
|
| 17 |
+
from pyharp.tags import Subcategory
|
| 18 |
|
| 19 |
|
| 20 |
# βββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 287 |
name="LarsNet Drum Stem Separator",
|
| 288 |
description="Separates a drum mix into individual drum stems: Kick, Snare, Toms, Hi-Hat, and Cymbals.",
|
| 289 |
author="A. I. Mezza, et al.",
|
| 290 |
+
tags=[Subcategory.STEM_SEPARATION, 'drums', 'demucs', 'source-separation', 'pyharp', 'stems', 'multi-output'],
|
| 291 |
)
|
| 292 |
|
| 293 |
MODEL = LarsNet(wiener_filter=False, device="cpu", config="config.yaml")
|
|
|
|
| 306 |
return tuple(output_paths)
|
| 307 |
|
| 308 |
|
| 309 |
+
if __name__ == "__main__":
|
| 310 |
+
with gr.Blocks() as demo:
|
| 311 |
+
input_audio = gr.Audio(type="filepath", label="Drum Mix (Input)").harp_required(True)
|
| 312 |
+
output_kick = gr.Audio(type="filepath", label="Kick")
|
| 313 |
+
output_snare = gr.Audio(type="filepath", label="Snare")
|
| 314 |
+
output_toms = gr.Audio(type="filepath", label="Toms")
|
| 315 |
+
output_hihat = gr.Audio(type="filepath", label="Hi-Hat")
|
| 316 |
+
output_cymbals = gr.Audio(type="filepath", label="Cymbals")
|
| 317 |
+
|
| 318 |
+
app = build_endpoint(
|
| 319 |
+
model_card=model_card,
|
| 320 |
+
input_components=[input_audio],
|
| 321 |
+
output_components=[output_kick, output_snare, output_toms, output_hihat, output_cymbals],
|
| 322 |
+
process_fn=process_fn,
|
| 323 |
+
)
|
| 324 |
|
| 325 |
+
demo.queue().launch(pwa=True, share=True, show_error=True)
|
requirements.txt
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
# pip install -r requirements.txt
|
| 2 |
-
git+https://github.com/TEAMuP-dev/pyharp.git@v0.
|
| 3 |
torch==2.7
|
| 4 |
torchaudio==2.7
|
| 5 |
pyyaml
|
| 6 |
tqdm
|
| 7 |
soundfile
|
| 8 |
torchcodec==0.7
|
|
|
|
|
|
| 1 |
# pip install -r requirements.txt
|
| 2 |
+
git+https://github.com/TEAMuP-dev/pyharp.git@v0.4.0
|
| 3 |
torch==2.7
|
| 4 |
torchaudio==2.7
|
| 5 |
pyyaml
|
| 6 |
tqdm
|
| 7 |
soundfile
|
| 8 |
torchcodec==0.7
|
| 9 |
+
spaces>=0.51.1
|