Commit
·
52d8718
1
Parent(s):
36af447
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,18 @@
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
from scipy.io.wavfile import write
|
|
|
|
| 4 |
|
| 5 |
def inference(audio, progress=gr.Progress()):
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
title = "Ilaria UVR 💖"
|
| 16 |
description = "Drag and drop an audio file to easily separate it! Join AI Hub Discord Server.</p>"
|
|
@@ -25,4 +27,4 @@ gr.Interface(
|
|
| 25 |
description=description,
|
| 26 |
article=article,
|
| 27 |
examples=examples
|
| 28 |
-
).launch()
|
|
|
|
| 1 |
import os
|
| 2 |
import gradio as gr
|
| 3 |
from scipy.io.wavfile import write
|
| 4 |
+
import time
|
| 5 |
|
| 6 |
def inference(audio, progress=gr.Progress()):
|
| 7 |
+
os.makedirs("out", exist_ok=True)
|
| 8 |
+
write('test.wav', audio[0], audio[1])
|
| 9 |
+
|
| 10 |
+
# Aggiungi il tuo codice per aggiornare la barra di progresso qui
|
| 11 |
+
for i in progress.tqdm(range(10), desc="Rendering..."):
|
| 12 |
+
time.sleep(0.1)
|
| 13 |
+
|
| 14 |
+
os.system("python3 -m demucs.separate -n htdemucs --two-stems=vocals -d cpu test.wav -o out")
|
| 15 |
+
return "./out/htdemucs/test/vocals.wav","./out/htdemucs/test/no_vocals.wav"
|
| 16 |
|
| 17 |
title = "Ilaria UVR 💖"
|
| 18 |
description = "Drag and drop an audio file to easily separate it! Join AI Hub Discord Server.</p>"
|
|
|
|
| 27 |
description=description,
|
| 28 |
article=article,
|
| 29 |
examples=examples
|
| 30 |
+
).launch(enable_queue=True)
|