Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,52 +7,37 @@ def aura_separate_beta(audio_path):
|
|
| 7 |
return None, None
|
| 8 |
|
| 9 |
base_name = os.path.splitext(os.path.basename(audio_path))[0]
|
| 10 |
-
clean_name = base_name.split('-')[0] if '-' in base_name else base_name
|
| 11 |
|
| 12 |
-
separator = Separator()
|
| 13 |
|
| 14 |
try:
|
| 15 |
-
# 1. IL MODELLO
|
| 16 |
model_name = 'UVR-MDX-NET-Inst_HQ_3.onnx'
|
| 17 |
-
|
| 18 |
-
print(f"--- Caricamento Modello Professional: {model_name} ---")
|
| 19 |
separator.load_model(model_name)
|
| 20 |
|
| 21 |
-
# 2. SEPARAZIONE
|
| 22 |
output_files = separator.separate(audio_path)
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
i_final = f"{clean_name} (Instrumental) (Aura-V1-Beta).wav"
|
| 27 |
|
| 28 |
os.rename(output_files[0], v_final)
|
| 29 |
os.rename(output_files[1], i_final)
|
| 30 |
|
| 31 |
-
print(f"β
Separazione completata per: {clean_name}")
|
| 32 |
return v_final, i_final
|
| 33 |
-
|
| 34 |
except Exception as e:
|
| 35 |
-
print(f"β Errore
|
| 36 |
return None, None
|
| 37 |
|
| 38 |
with gr.Blocks() as demo:
|
| 39 |
-
gr.Markdown("# π Aura Engine
|
| 40 |
-
gr.Markdown("
|
| 41 |
-
|
| 42 |
-
with gr.Row():
|
| 43 |
-
input_audio = gr.Audio(label="Traccia Input", type="filepath")
|
| 44 |
|
| 45 |
-
|
|
|
|
| 46 |
|
| 47 |
with gr.Row():
|
| 48 |
v_out = gr.Audio(label="π€ Vocals")
|
| 49 |
i_out = gr.Audio(label="πΈ Instrumental")
|
| 50 |
|
| 51 |
-
btn.click(
|
| 52 |
-
fn=aura_separate_beta,
|
| 53 |
-
inputs=input_audio,
|
| 54 |
-
outputs=[v_out, i_out],
|
| 55 |
-
api_name="predict"
|
| 56 |
-
)
|
| 57 |
|
| 58 |
demo.launch(theme=gr.themes.Soft())
|
|
|
|
| 7 |
return None, None
|
| 8 |
|
| 9 |
base_name = os.path.splitext(os.path.basename(audio_path))[0]
|
|
|
|
| 10 |
|
| 11 |
+
separator = Separator(output_format='MP3')
|
| 12 |
|
| 13 |
try:
|
|
|
|
| 14 |
model_name = 'UVR-MDX-NET-Inst_HQ_3.onnx'
|
|
|
|
|
|
|
| 15 |
separator.load_model(model_name)
|
| 16 |
|
|
|
|
| 17 |
output_files = separator.separate(audio_path)
|
| 18 |
|
| 19 |
+
v_final = f"{base_name} (Vocals) (Aura-V1-Beta).mp3"
|
| 20 |
+
i_final = f"{base_name} (Instrumental) (Aura-V1-Beta).mp3"
|
|
|
|
| 21 |
|
| 22 |
os.rename(output_files[0], v_final)
|
| 23 |
os.rename(output_files[1], i_final)
|
| 24 |
|
|
|
|
| 25 |
return v_final, i_final
|
|
|
|
| 26 |
except Exception as e:
|
| 27 |
+
print(f"β Errore: {e}")
|
| 28 |
return None, None
|
| 29 |
|
| 30 |
with gr.Blocks() as demo:
|
| 31 |
+
gr.Markdown("# π Aura Engine v0.96 (BETA)")
|
| 32 |
+
gr.Markdown("Output: **MP3 High Quality** | Brand: **ALEeMAYAyt**")
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
+
input_audio = gr.Audio(label="Traccia Input", type="filepath")
|
| 35 |
+
btn = gr.Button("GENERA CON AURA", variant="primary")
|
| 36 |
|
| 37 |
with gr.Row():
|
| 38 |
v_out = gr.Audio(label="π€ Vocals")
|
| 39 |
i_out = gr.Audio(label="πΈ Instrumental")
|
| 40 |
|
| 41 |
+
btn.click(fn=aura_separate_beta, inputs=input_audio, outputs=[v_out, i_out], api_name="predict")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
demo.launch(theme=gr.themes.Soft())
|