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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import glob
|
3 |
+
from pathlib import Path
|
4 |
+
import gradio as gr
|
5 |
+
|
6 |
+
roformer_models = [
|
7 |
+
'BS-Roformer-Viperx-1297.ckpt',
|
8 |
+
'BS-Roformer-Viperx-1296.ckpt',
|
9 |
+
'BS-Roformer-Viperx-1053.ckpt',
|
10 |
+
'Mel-Roformer-Viperx-1143.ckpt',
|
11 |
+
]
|
12 |
+
|
13 |
+
mdx23c_models = [
|
14 |
+
'MDX23C_D1581.ckpt',
|
15 |
+
'MDX23C-8KFFT-InstVoc_HQ.ckpt',
|
16 |
+
'MDX23C-8KFFT-InstVoc_HQ_2.ckpt',
|
17 |
+
]
|
18 |
+
|
19 |
+
mdxnet_models = [
|
20 |
+
'UVR-MDX-NET-Inst_full_292.onnx',
|
21 |
+
'UVR-MDX-NET_Inst_187_beta.onnx',
|
22 |
+
'UVR-MDX-NET_Inst_82_beta.onnx',
|
23 |
+
'UVR-MDX-NET_Inst_90_beta.onnx',
|
24 |
+
'UVR-MDX-NET_Main_340.onnx',
|
25 |
+
'UVR-MDX-NET_Main_390.onnx',
|
26 |
+
'UVR-MDX-NET_Main_406.onnx',
|
27 |
+
'UVR-MDX-NET_Main_427.onnx',
|
28 |
+
'UVR-MDX-NET_Main_438.onnx',
|
29 |
+
'UVR-MDX-NET-Inst_HQ_1.onnx',
|
30 |
+
'UVR-MDX-NET-Inst_HQ_2.onnx',
|
31 |
+
'UVR-MDX-NET-Inst_HQ_3.onnx',
|
32 |
+
'UVR-MDX-NET-Inst_HQ_4.onnx',
|
33 |
+
'UVR_MDXNET_Main.onnx',
|
34 |
+
'UVR-MDX-NET-Inst_Main.onnx',
|
35 |
+
'UVR_MDXNET_1_9703.onnx',
|
36 |
+
'UVR_MDXNET_2_9682.onnx',
|
37 |
+
'UVR_MDXNET_3_9662.onnx',
|
38 |
+
'UVR-MDX-NET-Inst_1.onnx',
|
39 |
+
'UVR-MDX-NET-Inst_2.onnx',
|
40 |
+
'UVR-MDX-NET-Inst_3.onnx',
|
41 |
+
'UVR_MDXNET_KARA.onnx',
|
42 |
+
'UVR_MDXNET_KARA_2.onnx',
|
43 |
+
'UVR_MDXNET_9482.onnx',
|
44 |
+
'UVR-MDX-NET-Voc_FT.onnx',
|
45 |
+
'Kim_Vocal_1.onnx',
|
46 |
+
'Kim_Vocal_2.onnx',
|
47 |
+
'Kim_Inst.onnx',
|
48 |
+
'Reverb_HQ_By_FoxJoy.onnx',
|
49 |
+
'UVR-MDX-NET_Crowd_HQ_1.onnx',
|
50 |
+
'kuielab_a_vocals.onnx',
|
51 |
+
'kuielab_a_other.onnx',
|
52 |
+
'kuielab_a_bass.onnx',
|
53 |
+
'kuielab_a_drums.onnx',
|
54 |
+
'kuielab_b_vocals.onnx',
|
55 |
+
'kuielab_b_other.onnx',
|
56 |
+
'kuielab_b_bass.onnx',
|
57 |
+
'kuielab_b_drums.onnx',
|
58 |
+
]
|
59 |
+
|
60 |
+
vrarch_models = [
|
61 |
+
'1_HP-UVR.pth',
|
62 |
+
'2_HP-UVR.pth',
|
63 |
+
'3_HP-Vocal-UVR.pth',
|
64 |
+
'4_HP-Vocal-UVR.pth',
|
65 |
+
'5_HP-Karaoke-UVR.pth',
|
66 |
+
'6_HP-Karaoke-UVR.pth',
|
67 |
+
'7_HP2-UVR.pth',
|
68 |
+
'8_HP2-UVR.pth',
|
69 |
+
'9_HP2-UVR.pth',
|
70 |
+
'10_SP-UVR-2B-32000-1.pth',
|
71 |
+
'11_SP-UVR-2B-32000-2.pth',
|
72 |
+
'12_SP-UVR-3B-44100.pth',
|
73 |
+
'13_SP-UVR-4B-44100-1.pth',
|
74 |
+
'14_SP-UVR-4B-44100-2.pth',
|
75 |
+
'15_SP-UVR-MID-44100-1.pth',
|
76 |
+
'16_SP-UVR-MID-44100-2.pth',
|
77 |
+
'17_HP-Wind_Inst-UVR.pth',
|
78 |
+
'UVR-De-Echo-Aggressive.pth',
|
79 |
+
'UVR-De-Echo-Normal.pth',
|
80 |
+
'UVR-DeEcho-DeReverb.pth',
|
81 |
+
'UVR-DeNoise-Lite.pth',
|
82 |
+
'UVR-DeNoise.pth',
|
83 |
+
'UVR-BVE-4B_SN-44100-1.pth',
|
84 |
+
'MGM_HIGHEND_v4.pth',
|
85 |
+
'MGM_LOWEND_A_v4.pth',
|
86 |
+
'MGM_LOWEND_B_v4.pth',
|
87 |
+
'MGM_MAIN_v4.pth',
|
88 |
+
]
|
89 |
+
|
90 |
+
demucs_models = [
|
91 |
+
'htdemucs_ft.yaml',
|
92 |
+
'htdemucs.yaml',
|
93 |
+
'hdemucs_mmi.yaml',
|
94 |
+
'htdemucs_6s.yaml',
|
95 |
+
]
|
96 |
+
|
97 |
+
output_format = [
|
98 |
+
'wav',
|
99 |
+
'flac',
|
100 |
+
'mp3',
|
101 |
+
]
|
102 |
+
|
103 |
+
mdxnet_overlap_values = [
|
104 |
+
'0.25',
|
105 |
+
'0.5',
|
106 |
+
'0.75',
|
107 |
+
'0.99',
|
108 |
+
]
|
109 |
+
|
110 |
+
vrarch_window_size_values = [
|
111 |
+
'320',
|
112 |
+
'512',
|
113 |
+
'1024',
|
114 |
+
]
|
115 |
+
|
116 |
+
with gr.Blocks(title="🎵 UVR5 UI 🎵") as app:
|
117 |
+
gr.Markdown("<h1> 🎵 UVR5 UI 🎵 </h1>")
|
118 |
+
with gr.Tabs():
|
119 |
+
with gr.TabItem("BS-Roformer"):
|
120 |
+
with gr.Row():
|
121 |
+
roformer_model = gr.Dropdown(
|
122 |
+
label = "Select the Model",
|
123 |
+
choices = roformer_models,
|
124 |
+
interactive = True
|
125 |
+
)
|
126 |
+
roformer_output_format = gr.Dropdown(
|
127 |
+
label = "Select the Output Format",
|
128 |
+
choices = output_format,
|
129 |
+
interactive = True
|
130 |
+
)
|
131 |
+
with gr.Row():
|
132 |
+
roformer_overlap = gr.Slider(
|
133 |
+
minimum = 2,
|
134 |
+
maximum = 4,
|
135 |
+
step = 1,
|
136 |
+
label = "Overlap",
|
137 |
+
info = "Amount of overlap between prediction windows.",
|
138 |
+
value = 4,
|
139 |
+
interactive = True
|
140 |
+
)
|
141 |
+
with gr.Row():
|
142 |
+
roformer_audio = gr.Audio(
|
143 |
+
label = "Input Audio",
|
144 |
+
interactive = True
|
145 |
+
)
|
146 |
+
with gr.Row():
|
147 |
+
roformer_button = gr.Button("Separate", variant = "primary") #revisar esto
|
148 |
+
#resto del codigo de lo que hace el boton
|
149 |
+
with gr.Row():
|
150 |
+
roformer_stem_1 = gr.Audio(
|
151 |
+
show_download_button = True,
|
152 |
+
interactive = False,
|
153 |
+
label = "Stem 1"
|
154 |
+
)
|
155 |
+
roformer_stem_2 = gr.Audio(
|
156 |
+
show_download_button = True,
|
157 |
+
interactive = False,
|
158 |
+
label = "Stem 2"
|
159 |
+
)
|
160 |
+
with gr.Row():
|
161 |
+
roformer_status = gr.Textbox(
|
162 |
+
label = "Output Information",
|
163 |
+
interactive = False
|
164 |
+
#añadir algo que muestre aqui todo
|
165 |
+
)
|
166 |
+
with gr.TabItem("MDX23C"):
|
167 |
+
with gr.Row():
|
168 |
+
mdx23c_model = gr.Dropdown(
|
169 |
+
label = "Select the Model",
|
170 |
+
choices = mdx23c_models,
|
171 |
+
interactive = True
|
172 |
+
)
|
173 |
+
mdx23c_output_format = gr.Dropdown(
|
174 |
+
label = "Select the Output Format",
|
175 |
+
choices = output_format,
|
176 |
+
interactive = True
|
177 |
+
)
|
178 |
+
with gr.Row():
|
179 |
+
mdx23c_segment_size = gr.Slider(
|
180 |
+
minimum = 32,
|
181 |
+
maximum = 4000,
|
182 |
+
step = 32,
|
183 |
+
label = "Segment Size",
|
184 |
+
info = "Larger consumes more resources, but may give better results.",
|
185 |
+
value = 256,
|
186 |
+
interactive = True
|
187 |
+
)
|
188 |
+
mdx23c_overlap = gr.Slider(
|
189 |
+
minimum = 2,
|
190 |
+
maximum = 50,
|
191 |
+
step = 1,
|
192 |
+
label = "Overlap",
|
193 |
+
info = "Amount of overlap between prediction windows.",
|
194 |
+
value = 8,
|
195 |
+
interactive = True
|
196 |
+
)
|
197 |
+
with gr.Row():
|
198 |
+
mdx23c_audio = gr.Audio(
|
199 |
+
label = "Input Audio",
|
200 |
+
interactive = True
|
201 |
+
)
|
202 |
+
with gr.Row():
|
203 |
+
mdx23c_button = gr.Button("Separate", variant = "primary") #revisar esto
|
204 |
+
#resto del codigo de lo que hace el boton
|
205 |
+
with gr.Row():
|
206 |
+
mdx23c_stem_1 = gr.Audio(
|
207 |
+
show_download_button = True,
|
208 |
+
interactive = False,
|
209 |
+
label = "Stem 1"
|
210 |
+
)
|
211 |
+
mdx23c_stem_2 = gr.Audio(
|
212 |
+
show_download_button = True,
|
213 |
+
interactive = False,
|
214 |
+
label = "Stem 2"
|
215 |
+
)
|
216 |
+
with gr.Row():
|
217 |
+
mdx23c_status = gr.Textbox(
|
218 |
+
label = "Output Information",
|
219 |
+
interactive = False
|
220 |
+
#añadir algo que muestre aqui todo
|
221 |
+
)
|
222 |
+
with gr.TabItem("MDX-NET"):
|
223 |
+
with gr.Row():
|
224 |
+
mdxnet_model = gr.Dropdown(
|
225 |
+
label = "Select the Model",
|
226 |
+
choices = mdxnet_models,
|
227 |
+
interactive = True
|
228 |
+
)
|
229 |
+
mdxnet_output_format = gr.Dropdown(
|
230 |
+
label = "Select the Output Format",
|
231 |
+
choices = output_format,
|
232 |
+
interactive = True
|
233 |
+
)
|
234 |
+
with gr.Row():
|
235 |
+
mdxnet_segment_size = gr.Slider(
|
236 |
+
minimum = 32,
|
237 |
+
maximum = 4000,
|
238 |
+
step = 32,
|
239 |
+
label = "Segment Size",
|
240 |
+
info = "Larger consumes more resources, but may give better results.",
|
241 |
+
value = 256,
|
242 |
+
interactive = True
|
243 |
+
)
|
244 |
+
mdxnet_overlap = gr.Dropdown(
|
245 |
+
label = "Overlap",
|
246 |
+
choices = mdxnet_overlap_values,
|
247 |
+
value = mdxnet_overlap_values[0],
|
248 |
+
interactive = True
|
249 |
+
)
|
250 |
+
mdxnet_denoise = gr.Checkbox(
|
251 |
+
label = "Denoise",
|
252 |
+
info = "Enable denoising during separation.",
|
253 |
+
value = True,
|
254 |
+
interactive = True
|
255 |
+
)
|
256 |
+
with gr.Row():
|
257 |
+
mdxnet_audio = gr.Audio(
|
258 |
+
label = "Input Audio",
|
259 |
+
interactive = True
|
260 |
+
)
|
261 |
+
with gr.Row():
|
262 |
+
mdxnet_button = gr.Button("Separate", variant = "primary") #revisar esto
|
263 |
+
#resto del codigo de lo que hace el boton
|
264 |
+
with gr.Row():
|
265 |
+
mdxnet_stem_1 = gr.Audio(
|
266 |
+
show_download_button = True,
|
267 |
+
interactive = False,
|
268 |
+
label = "Stem 1"
|
269 |
+
)
|
270 |
+
mdxnet_stem_2 = gr.Audio(
|
271 |
+
show_download_button = True,
|
272 |
+
interactive = False,
|
273 |
+
label = "Stem 2"
|
274 |
+
)
|
275 |
+
with gr.Row():
|
276 |
+
mdxnet_status = gr.Textbox(
|
277 |
+
label = "Output Information",
|
278 |
+
interactive = False
|
279 |
+
#añadir algo que muestre aqui todo
|
280 |
+
)
|
281 |
+
with gr.TabItem("VR ARCH"):
|
282 |
+
with gr.Row():
|
283 |
+
vrarch_model = gr.Dropdown(
|
284 |
+
label = "Select the Model",
|
285 |
+
choices = vrarch_models,
|
286 |
+
interactive = True
|
287 |
+
)
|
288 |
+
vrarch_output_format = gr.Dropdown(
|
289 |
+
label = "Select the Output Format",
|
290 |
+
choices = output_format,
|
291 |
+
interactive = True
|
292 |
+
)
|
293 |
+
with gr.Row():
|
294 |
+
vrarch_window_size = gr.Dropdown(
|
295 |
+
label = "Window Size",
|
296 |
+
choices = vrarch_window_size_values,
|
297 |
+
value = vrarch_window_size_values[0],
|
298 |
+
interactive = True
|
299 |
+
)
|
300 |
+
vrarch_agression = gr.Slider(
|
301 |
+
minimum = 1,
|
302 |
+
maximum = 50,
|
303 |
+
step = 1,
|
304 |
+
label = "Agression",
|
305 |
+
info = "Intensity of primary stem extraction.",
|
306 |
+
value = 5,
|
307 |
+
interactive = True
|
308 |
+
)
|
309 |
+
vrarch_tta = gr.Checkbox(
|
310 |
+
label = "TTA",
|
311 |
+
info = "Enable Test-Time-Augmentation; slow but improves quality.",
|
312 |
+
value = True,
|
313 |
+
interactive = True
|
314 |
+
)
|
315 |
+
vrarch_high_end_process = gr.Checkbox(
|
316 |
+
label = "High End Process",
|
317 |
+
info = "Mirror the missing frequency range of the output.",
|
318 |
+
value = False,
|
319 |
+
interactive = True
|
320 |
+
)
|
321 |
+
with gr.Row():
|
322 |
+
vrarch_audio = gr.Audio(
|
323 |
+
label = "Input Audio",
|
324 |
+
interactive = True
|
325 |
+
)
|
326 |
+
with gr.Row():
|
327 |
+
vrarch_button = gr.Button("Separate", variant = "primary") #revisar esto
|
328 |
+
#resto del codigo de lo que hace el boton
|
329 |
+
with gr.Row():
|
330 |
+
vrarch_stem_1 = gr.Audio(
|
331 |
+
show_download_button = True,
|
332 |
+
interactive = False,
|
333 |
+
label = "Stem 1"
|
334 |
+
)
|
335 |
+
vrarch_stem_2 = gr.Audio(
|
336 |
+
show_download_button = True,
|
337 |
+
interactive = False,
|
338 |
+
label = "Stem 2"
|
339 |
+
)
|
340 |
+
with gr.Row():
|
341 |
+
vrarch_status = gr.Textbox(
|
342 |
+
label = "Output Information",
|
343 |
+
interactive = False
|
344 |
+
#añadir algo que muestre aqui todo
|
345 |
+
)
|
346 |
+
with gr.TabItem("Demucs"):
|
347 |
+
with gr.Row():
|
348 |
+
demucs_model = gr.Dropdown(
|
349 |
+
label = "Select the Model",
|
350 |
+
choices = demucs_models,
|
351 |
+
interactive = True
|
352 |
+
)
|
353 |
+
demucs_output_format = gr.Dropdown(
|
354 |
+
label = "Select the Output Format",
|
355 |
+
choices = output_format,
|
356 |
+
interactive = True
|
357 |
+
)
|
358 |
+
with gr.Row():
|
359 |
+
demucs_shifts = gr.Slider(
|
360 |
+
minimum = 1,
|
361 |
+
maximum = 20,
|
362 |
+
step = 1,
|
363 |
+
label = "Shifts",
|
364 |
+
info = "Number of predictions with random shifts, higher = slower but better quality.",
|
365 |
+
value = 2,
|
366 |
+
interactive = True
|
367 |
+
)
|
368 |
+
demucs_overlap = gr.Slider(
|
369 |
+
minimum = 0.001,
|
370 |
+
maximum = 0.999,
|
371 |
+
step = 0.001,
|
372 |
+
label = "Overlap",
|
373 |
+
info = "Amount of overlap between prediction windows.",
|
374 |
+
value = 0.025,
|
375 |
+
interactive = True
|
376 |
+
)
|
377 |
+
with gr.Row():
|
378 |
+
demucs_audio = gr.Audio(
|
379 |
+
label = "Input Audio",
|
380 |
+
interactive = True
|
381 |
+
)
|
382 |
+
with gr.Row():
|
383 |
+
demucs_button = gr.Button("Separate", variant = "primary") #revisar esto
|
384 |
+
#resto del codigo de lo que hace el boton
|
385 |
+
with gr.Row():
|
386 |
+
demucs_stem_1 = gr.Audio(
|
387 |
+
show_download_button = True,
|
388 |
+
interactive = False,
|
389 |
+
label = "Stem 1"
|
390 |
+
)
|
391 |
+
demucs_stem_2 = gr.Audio(
|
392 |
+
show_download_button = True,
|
393 |
+
interactive = False,
|
394 |
+
label = "Stem 2"
|
395 |
+
)
|
396 |
+
demucs_stem_3 = gr.Audio(
|
397 |
+
show_download_button = True,
|
398 |
+
interactive = False,
|
399 |
+
label = "Stem 3"
|
400 |
+
)
|
401 |
+
demucs_stem_4 = gr.Audio(
|
402 |
+
show_download_button = True,
|
403 |
+
interactive = False,
|
404 |
+
label = "Stem 4"
|
405 |
+
)
|
406 |
+
with gr.Row():
|
407 |
+
demucs_stem_5 = gr.Audio(
|
408 |
+
show_download_button = True,
|
409 |
+
interactive = False,
|
410 |
+
label = "Stem 5"
|
411 |
+
)
|
412 |
+
demucs_stem_6 = gr.Audio(
|
413 |
+
show_download_button = True,
|
414 |
+
interactive = False,
|
415 |
+
label = "Stem 6"
|
416 |
+
)
|
417 |
+
with gr.Row():
|
418 |
+
demucs_status = gr.Textbox(
|
419 |
+
label = "Output Information",
|
420 |
+
interactive = False
|
421 |
+
#añadir algo que muestre aqui todo
|
422 |
+
)
|
423 |
+
app.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
audio-separator[gpu]==0.17.2
|
2 |
+
demucs
|