bla commited on
Commit
4bd0bee
·
1 Parent(s): 16f6d85

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -51,7 +51,7 @@ def analyze(path):
51
  multiprocess=False,
52
  keep_byproducts=True, # TODO: remove this
53
  )
54
-
55
  fig = allin1.visualize(
56
  result,
57
  multiprocess=False,
@@ -65,7 +65,7 @@ def analyze(path):
65
  )
66
  sonif_path = Path(f'./sonif/{path.stem}.sonif{path.suffix}').resolve().as_posix()
67
 
68
- return result.bpm, fig, sonif_path
69
 
70
 
71
  with gr.Blocks() as demo:
@@ -89,6 +89,11 @@ with gr.Blocks() as demo:
89
  show_download_button=False,
90
  scale=9,
91
  )
 
 
 
 
 
92
  # gr.Examples(
93
  # examples=[
94
  # './assets/NewJeans - Super Shy.mp3',
@@ -102,7 +107,7 @@ with gr.Blocks() as demo:
102
  button.click(
103
  fn=analyze,
104
  inputs=input_audio_path,
105
- outputs=[output_bpm, output_viz, output_sonif],
106
  api_name='analyze',
107
  )
108
 
 
51
  multiprocess=False,
52
  keep_byproducts=True, # TODO: remove this
53
  )
54
+ result_json_path = Path(f'./struct/{path.stem}.json').resolve().as_posix()
55
  fig = allin1.visualize(
56
  result,
57
  multiprocess=False,
 
65
  )
66
  sonif_path = Path(f'./sonif/{path.stem}.sonif{path.suffix}').resolve().as_posix()
67
 
68
+ return result.bpm, fig, sonif_path,result_json_path
69
 
70
 
71
  with gr.Blocks() as demo:
 
89
  show_download_button=False,
90
  scale=9,
91
  )
92
+ output_json = gr.File(
93
+ label='Download JSON',
94
+ type='auto',
95
+ show_download_button=True,
96
+ )
97
  # gr.Examples(
98
  # examples=[
99
  # './assets/NewJeans - Super Shy.mp3',
 
107
  button.click(
108
  fn=analyze,
109
  inputs=input_audio_path,
110
+ outputs=[output_bpm, output_viz, output_sonif,output_json],
111
  api_name='analyze',
112
  )
113