Politrees commited on
Commit
ccf4bd7
·
verified ·
1 Parent(s): 465565a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +49 -40
app.py CHANGED
@@ -249,26 +249,31 @@ with gr.Blocks(
249
  title="🎵 PolUVR - Politrees 🎵",
250
  css="footer{display:none !important}",
251
  theme=gr.themes.Soft(
 
 
 
252
  spacing_size="sm",
253
  radius_size="lg",
254
  )
255
  ) as app:
256
  gr.Markdown("<h1> Audio-Separator by Politrees </h1>")
257
  with gr.Accordion("General settings", open=False):
258
- model_file_dir = gr.Textbox(value="/tmp/audio-separator-models/", label="Directory for storing model files", placeholder="/tmp/audio-separator-models/", interactive=False)
259
- with gr.Row():
260
- output_dir = gr.Textbox(value="output", label="File output directory", placeholder="output", interactive=True)
261
- output_format = gr.Dropdown(value="wav", choices=["wav", "flac", "mp3"], label="Output Format")
262
- with gr.Row():
263
- norm_threshold = gr.Slider(value=0.9, step=0.1, minimum=0, maximum=1, label="Normalization", info="max peak amplitude to normalize input and output audio.")
264
- amp_threshold = gr.Slider(value=0.6, step=0.1, minimum=0, maximum=1, label="Amplification", info="min peak amplitude to amplify input and output audio.")
 
265
 
266
  with gr.Tab("Roformer"):
267
- with gr.Row():
268
- roformer_model = gr.Dropdown(label="Select the Model", choices=list(ROFORMER_MODELS.keys()))
269
- with gr.Row():
270
- roformer_seg_size = gr.Slider(minimum=32, maximum=4000, step=32, value=256, label="Segment Size", info="Larger consumes more resources, but may give better results.")
271
- roformer_overlap = gr.Slider(minimum=2, maximum=4, step=1, value=4, label="Overlap", info="Amount of overlap between prediction windows.")
 
272
  with gr.Row():
273
  roformer_audio = gr.Audio(label="Input Audio", type="filepath")
274
  with gr.Row():
@@ -278,11 +283,12 @@ with gr.Blocks(
278
  roformer_stem2 = gr.Audio(label="Stem 2", type="filepath", interactive=False)
279
 
280
  with gr.Tab("MDX23C"):
281
- with gr.Row():
282
- mdx23c_model = gr.Dropdown(label="Select the Model", choices=MDX23C_MODELS)
283
- with gr.Row():
284
- mdx23c_seg_size = gr.Slider(minimum=32, maximum=4000, step=32, value=256, label="Segment Size", info="Larger consumes more resources, but may give better results.")
285
- mdx23c_overlap = gr.Slider(minimum=2, maximum=50, step=1, value=8, label="Overlap", info="Amount of overlap between prediction windows.")
 
286
  with gr.Row():
287
  mdx23c_audio = gr.Audio(label="Input Audio", type="filepath")
288
  with gr.Row():
@@ -292,13 +298,14 @@ with gr.Blocks(
292
  mdx23c_stem2 = gr.Audio(label="Stem 2", type="filepath", interactive=False)
293
 
294
  with gr.Tab("MDX-NET"):
295
- with gr.Row():
296
- mdx_model = gr.Dropdown(label="Select the Model", choices=MDXNET_MODELS)
297
- with gr.Row():
298
- mdx_hop_length = gr.Slider(minimum=0.001, maximum=0.999, step=0.001, value=0.25, label="Hop Length")
299
- mdx_seg_size = gr.Slider(minimum=32, maximum=4000, step=32, value=256, label="Segment Size", info="Larger consumes more resources, but may give better results.")
300
- mdx_overlap = gr.Slider(minimum=0.001, maximum=0.999, step=0.001, value=0.25, label="Overlap")
301
- mdx_denoise = gr.Checkbox(value=True, label="Denoise", info="Enable denoising during separation.")
 
302
  with gr.Row():
303
  mdx_audio = gr.Audio(label="Input Audio", type="filepath")
304
  with gr.Row():
@@ -308,15 +315,16 @@ with gr.Blocks(
308
  mdx_stem2 = gr.Audio(label="Stem 2", type="filepath", interactive=False)
309
 
310
  with gr.Tab("VR ARCH"):
311
- with gr.Row():
312
- vr_model = gr.Dropdown(label="Select the Model", choices=VR_ARCH_MODELS)
313
- with gr.Row():
314
- vr_window_size = gr.Slider(minimum=320, maximum=1024, step=32, value=512, label="Window Size")
315
- vr_aggression = gr.Slider(minimum=1, maximum=50, step=1, value=5, label="Agression", info="Intensity of primary stem extraction.")
316
- vr_tta = gr.Checkbox(value=True, label="TTA", info="Enable Test-Time-Augmentation; slow but improves quality.")
317
- vr_post_process = gr.Checkbox(value=True, label="Post Process", info="Enable post-processing.")
318
- vr_post_process_threshold = gr.Slider(minimum=0.1, maximum=0.3, step=0.1, value=0.2, label="Post Process Threshold", info="Threshold for post-processing.")
319
- vr_high_end_process = gr.Checkbox(value=False, label="High End Process", info="Mirror the missing frequency range of the output.")
 
320
  with gr.Row():
321
  vr_audio = gr.Audio(label="Input Audio", type="filepath")
322
  with gr.Row():
@@ -326,13 +334,14 @@ with gr.Blocks(
326
  vr_stem2 = gr.Audio(label="Stem 2", type="filepath", interactive=False)
327
 
328
  with gr.Tab("Demucs"):
329
- with gr.Row():
330
- demucs_model = gr.Dropdown(label="Select the Model", choices=DEMUCS_MODELS)
331
- with gr.Row():
332
- demucs_seg_size = gr.Slider(minimum=1, maximum=100, step=1, value=50, label="Segment Size")
333
- demucs_shifts = gr.Slider(minimum=0, maximum=20, step=1, value=2, label="Shifts", info="Number of predictions with random shifts, higher = slower but better quality.")
334
- demucs_overlap = gr.Slider(minimum=0.001, maximum=0.999, step=0.001, value=0.25, label="Overlap")
335
- demucs_segments_enabled = gr.Checkbox(value=True, label="Segment-wise processing")
 
336
  with gr.Row():
337
  demucs_audio = gr.Audio(label="Input Audio", type="filepath")
338
  with gr.Row():
 
249
  title="🎵 PolUVR - Politrees 🎵",
250
  css="footer{display:none !important}",
251
  theme=gr.themes.Soft(
252
+ primary_hue="green",
253
+ secondary_hue="green",
254
+ neutral_hue="neutral",
255
  spacing_size="sm",
256
  radius_size="lg",
257
  )
258
  ) as app:
259
  gr.Markdown("<h1> Audio-Separator by Politrees </h1>")
260
  with gr.Accordion("General settings", open=False):
261
+ with gr.Group():
262
+ model_file_dir = gr.Textbox(value="/tmp/audio-separator-models/", label="Directory for storing model files", placeholder="/tmp/audio-separator-models/", interactive=False)
263
+ with gr.Row():
264
+ output_dir = gr.Textbox(value="output", label="File output directory", placeholder="output", interactive=True)
265
+ output_format = gr.Dropdown(value="wav", choices=["wav", "flac", "mp3"], label="Output Format")
266
+ with gr.Row():
267
+ norm_threshold = gr.Slider(value=0.9, step=0.1, minimum=0, maximum=1, label="Normalization", info="max peak amplitude to normalize input and output audio.")
268
+ amp_threshold = gr.Slider(value=0.6, step=0.1, minimum=0, maximum=1, label="Amplification", info="min peak amplitude to amplify input and output audio.")
269
 
270
  with gr.Tab("Roformer"):
271
+ with gr.Group():
272
+ with gr.Row():
273
+ roformer_model = gr.Dropdown(label="Select the Model", choices=list(ROFORMER_MODELS.keys()))
274
+ with gr.Row():
275
+ roformer_seg_size = gr.Slider(minimum=32, maximum=4000, step=32, value=256, label="Segment Size", info="Larger consumes more resources, but may give better results.")
276
+ roformer_overlap = gr.Slider(minimum=2, maximum=4, step=1, value=4, label="Overlap", info="Amount of overlap between prediction windows.")
277
  with gr.Row():
278
  roformer_audio = gr.Audio(label="Input Audio", type="filepath")
279
  with gr.Row():
 
283
  roformer_stem2 = gr.Audio(label="Stem 2", type="filepath", interactive=False)
284
 
285
  with gr.Tab("MDX23C"):
286
+ with gr.Group():
287
+ with gr.Row():
288
+ mdx23c_model = gr.Dropdown(label="Select the Model", choices=MDX23C_MODELS)
289
+ with gr.Row():
290
+ mdx23c_seg_size = gr.Slider(minimum=32, maximum=4000, step=32, value=256, label="Segment Size", info="Larger consumes more resources, but may give better results.")
291
+ mdx23c_overlap = gr.Slider(minimum=2, maximum=50, step=1, value=8, label="Overlap", info="Amount of overlap between prediction windows.")
292
  with gr.Row():
293
  mdx23c_audio = gr.Audio(label="Input Audio", type="filepath")
294
  with gr.Row():
 
298
  mdx23c_stem2 = gr.Audio(label="Stem 2", type="filepath", interactive=False)
299
 
300
  with gr.Tab("MDX-NET"):
301
+ with gr.Group():
302
+ with gr.Row():
303
+ mdx_model = gr.Dropdown(label="Select the Model", choices=MDXNET_MODELS)
304
+ with gr.Row():
305
+ mdx_hop_length = gr.Slider(minimum=0.001, maximum=0.999, step=0.001, value=0.25, label="Hop Length")
306
+ mdx_seg_size = gr.Slider(minimum=32, maximum=4000, step=32, value=256, label="Segment Size", info="Larger consumes more resources, but may give better results.")
307
+ mdx_overlap = gr.Slider(minimum=0.001, maximum=0.999, step=0.001, value=0.25, label="Overlap")
308
+ mdx_denoise = gr.Checkbox(value=True, label="Denoise", info="Enable denoising during separation.")
309
  with gr.Row():
310
  mdx_audio = gr.Audio(label="Input Audio", type="filepath")
311
  with gr.Row():
 
315
  mdx_stem2 = gr.Audio(label="Stem 2", type="filepath", interactive=False)
316
 
317
  with gr.Tab("VR ARCH"):
318
+ with gr.Group():
319
+ with gr.Row():
320
+ vr_model = gr.Dropdown(label="Select the Model", choices=VR_ARCH_MODELS)
321
+ with gr.Row():
322
+ vr_window_size = gr.Slider(minimum=320, maximum=1024, step=32, value=512, label="Window Size")
323
+ vr_aggression = gr.Slider(minimum=1, maximum=50, step=1, value=5, label="Agression", info="Intensity of primary stem extraction.")
324
+ vr_tta = gr.Checkbox(value=True, label="TTA", info="Enable Test-Time-Augmentation; slow but improves quality.")
325
+ vr_post_process = gr.Checkbox(value=True, label="Post Process", info="Enable post-processing.")
326
+ vr_post_process_threshold = gr.Slider(minimum=0.1, maximum=0.3, step=0.1, value=0.2, label="Post Process Threshold", info="Threshold for post-processing.")
327
+ vr_high_end_process = gr.Checkbox(value=False, label="High End Process", info="Mirror the missing frequency range of the output.")
328
  with gr.Row():
329
  vr_audio = gr.Audio(label="Input Audio", type="filepath")
330
  with gr.Row():
 
334
  vr_stem2 = gr.Audio(label="Stem 2", type="filepath", interactive=False)
335
 
336
  with gr.Tab("Demucs"):
337
+ with gr.Group():
338
+ with gr.Row():
339
+ demucs_model = gr.Dropdown(label="Select the Model", choices=DEMUCS_MODELS)
340
+ with gr.Row():
341
+ demucs_seg_size = gr.Slider(minimum=1, maximum=100, step=1, value=50, label="Segment Size")
342
+ demucs_shifts = gr.Slider(minimum=0, maximum=20, step=1, value=2, label="Shifts", info="Number of predictions with random shifts, higher = slower but better quality.")
343
+ demucs_overlap = gr.Slider(minimum=0.001, maximum=0.999, step=0.001, value=0.25, label="Overlap")
344
+ demucs_segments_enabled = gr.Checkbox(value=True, label="Segment-wise processing")
345
  with gr.Row():
346
  demucs_audio = gr.Audio(label="Input Audio", type="filepath")
347
  with gr.Row():