Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -182,21 +182,25 @@ def rename_stems(audio, vocals_stem, instrumental_stem, other_stem, drums_stem,
|
|
182 |
return stems
|
183 |
|
184 |
def leaderboard(list_filter, list_limit):
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
|
|
|
|
|
|
|
|
200 |
|
201 |
def roformer_separator(audio, model_key, seg_size, override_seg_size, overlap, pitch_shift, model_dir, out_dir, out_format, norm_thresh, amp_thresh, batch_size, vocals_stem, instrumental_stem, other_stem, drums_stem, bass_stem, guitar_stem, piano_stem, progress=gr.Progress(track_tqdm=True)):
|
202 |
"""Separate audio using Roformer model."""
|
|
|
182 |
return stems
|
183 |
|
184 |
def leaderboard(list_filter, list_limit):
|
185 |
+
try:
|
186 |
+
result = subprocess.run(
|
187 |
+
["PolUVR", "-l", f"--list_filter={list_filter}", f"--list_limit={list_limit}"],
|
188 |
+
capture_output=True,
|
189 |
+
text=True,
|
190 |
+
shell=True,
|
191 |
+
)
|
192 |
+
if result.returncode != 0:
|
193 |
+
return f"Error: {result.stderr}"
|
194 |
+
|
195 |
+
return "<table border='1'>" + "".join(
|
196 |
+
f"<tr style='{'font-weight: bold; font-size: 1.2em;' if i == 0 else ''}'>" +
|
197 |
+
"".join(f"<td>{cell}</td>" for cell in re.split(r"\s{2,}", line.strip())) +
|
198 |
+
"</tr>"
|
199 |
+
for i, line in enumerate(re.findall(r"^(?!-+)(.+)$", result.stdout.strip(), re.MULTILINE))
|
200 |
+
) + "</table>"
|
201 |
+
|
202 |
+
except Exception as e:
|
203 |
+
return f"Error: {e}"
|
204 |
|
205 |
def roformer_separator(audio, model_key, seg_size, override_seg_size, overlap, pitch_shift, model_dir, out_dir, out_format, norm_thresh, amp_thresh, batch_size, vocals_stem, instrumental_stem, other_stem, drums_stem, bass_stem, guitar_stem, piano_stem, progress=gr.Progress(track_tqdm=True)):
|
206 |
"""Separate audio using Roformer model."""
|