Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -57,11 +57,12 @@ def analyze(path):
|
|
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 |
-
|
63 |
-
print(
|
64 |
-
|
65 |
fig = allin1.visualize(
|
66 |
result,
|
67 |
multiprocess=False,
|
@@ -100,7 +101,7 @@ def analyze(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:
|
@@ -125,6 +126,7 @@ with gr.Blocks() as demo:
|
|
125 |
# scale=9,
|
126 |
#)
|
127 |
elapsed_time = gr.Textbox(label='Overall inference time', scale=1)
|
|
|
128 |
with gr.Column():
|
129 |
bass = gr.Audio(label='bass', show_share_button=False)
|
130 |
vocals =gr.Audio(label='vocals', show_share_button=False)
|
@@ -149,7 +151,7 @@ with gr.Blocks() as demo:
|
|
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 |
|
|
|
57 |
keep_byproducts=True, # TODO: remove this
|
58 |
)
|
59 |
|
60 |
+
json_structure_output = None
|
61 |
for root, dirs, files in os.walk(f"./struct"):
|
62 |
for file_path in files:
|
63 |
+
json_structure_output = os.path.join(root, file_path)
|
64 |
+
print(json_structure_output)
|
65 |
+
|
66 |
fig = allin1.visualize(
|
67 |
result,
|
68 |
multiprocess=False,
|
|
|
101 |
drums_path = file_path
|
102 |
|
103 |
#return result.bpm, fig, sonif_path, elapsed_time
|
104 |
+
return result.bpm, fig, elapsed_time, json_structure_output, bass_path, drums_path, other_path, vocals_path
|
105 |
|
106 |
|
107 |
with gr.Blocks() as demo:
|
|
|
126 |
# scale=9,
|
127 |
#)
|
128 |
elapsed_time = gr.Textbox(label='Overall inference time', scale=1)
|
129 |
+
json_structure_output = gr.File(label="Json structure")
|
130 |
with gr.Column():
|
131 |
bass = gr.Audio(label='bass', show_share_button=False)
|
132 |
vocals =gr.Audio(label='vocals', show_share_button=False)
|
|
|
151 |
fn=analyze,
|
152 |
inputs=input_audio_path,
|
153 |
#outputs=[output_bpm, output_viz, output_sonif, elapsed_time],
|
154 |
+
outputs=[output_bpm, output_viz, json_structure_output, elapsed_time, bass, drums, other, vocals],
|
155 |
api_name='analyze',
|
156 |
)
|
157 |
|