Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -57,13 +57,16 @@ def analyze(path):
|
|
57 |
keep_byproducts=True, # TODO: remove this
|
58 |
)
|
59 |
|
60 |
-
|
|
|
|
|
|
|
61 |
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
|
68 |
#allin1.sonify(
|
69 |
# result,
|
@@ -95,9 +98,9 @@ def analyze(path):
|
|
95 |
other_path = file_path
|
96 |
if "drums.wav" in file_path:
|
97 |
drums_path = file_path
|
98 |
-
|
99 |
#return result.bpm, fig, sonif_path, elapsed_time
|
100 |
-
return result.bpm, elapsed_time, bass_path, drums_path, other_path, vocals_path
|
101 |
|
102 |
|
103 |
with gr.Blocks() as demo:
|
@@ -111,7 +114,7 @@ with gr.Blocks() as demo:
|
|
111 |
show_download_button=False,
|
112 |
)
|
113 |
button = gr.Button('Analyze', variant='primary')
|
114 |
-
|
115 |
with gr.Row():
|
116 |
output_bpm = gr.Textbox(label='BPM', scale=1)
|
117 |
#output_sonif = gr.Audio(
|
@@ -146,7 +149,7 @@ with gr.Blocks() as demo:
|
|
146 |
fn=analyze,
|
147 |
inputs=input_audio_path,
|
148 |
#outputs=[output_bpm, output_viz, output_sonif, elapsed_time],
|
149 |
-
outputs=[output_bpm, elapsed_time, bass, drums, other, vocals],
|
150 |
api_name='analyze',
|
151 |
)
|
152 |
|
|
|
57 |
keep_byproducts=True, # TODO: remove this
|
58 |
)
|
59 |
|
60 |
+
for root, dirs, files in os.walk(f"./struct"):
|
61 |
+
for file_path in files:
|
62 |
+
file_path = os.path.join(root, file_path)
|
63 |
+
print(file_path)
|
64 |
|
65 |
+
fig = allin1.visualize(
|
66 |
+
result,
|
67 |
+
multiprocess=False,
|
68 |
+
)
|
69 |
+
fig.set_dpi(300)
|
70 |
|
71 |
#allin1.sonify(
|
72 |
# result,
|
|
|
98 |
other_path = file_path
|
99 |
if "drums.wav" in file_path:
|
100 |
drums_path = file_path
|
101 |
+
|
102 |
#return result.bpm, fig, sonif_path, elapsed_time
|
103 |
+
return result.bpm, fig, elapsed_time, bass_path, drums_path, other_path, vocals_path
|
104 |
|
105 |
|
106 |
with gr.Blocks() as demo:
|
|
|
114 |
show_download_button=False,
|
115 |
)
|
116 |
button = gr.Button('Analyze', variant='primary')
|
117 |
+
output_viz = gr.Plot(label='Visualization')
|
118 |
with gr.Row():
|
119 |
output_bpm = gr.Textbox(label='BPM', scale=1)
|
120 |
#output_sonif = gr.Audio(
|
|
|
149 |
fn=analyze,
|
150 |
inputs=input_audio_path,
|
151 |
#outputs=[output_bpm, output_viz, output_sonif, elapsed_time],
|
152 |
+
outputs=[output_bpm, output_viz, elapsed_time, bass, drums, other, vocals],
|
153 |
api_name='analyze',
|
154 |
)
|
155 |
|