PierreHanna commited on
Commit
6946728
1 Parent(s): 700f2e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -51,18 +51,15 @@ def process(input_path):
51
  for d in res['instruments']:
52
  instruments[d['name']] = d['probability']
53
 
54
- timbres = []
55
  for d in res['timbres']:
56
- timbres.append((d['name'],d['probability']))
57
- print(timbres)
 
58
 
59
- vocalgender = [res['vocal_gender'][0]['name'], res['vocal_gender'][0]['probability']]
60
- print(vocalgender)
61
 
62
- audioquality = [res['audio_quality'][0]['name'], res['audio_quality'][0]['probability']]
63
- print(audioquality)
64
-
65
- return dict_moods, genres, instruments, themes, str(dict_desc['Electric/Acoustic']),str(dict_desc['Danceability']),str(dict_desc['Arousal']),str(dict_desc['Vocal/Instrumental']),str(dict_desc['Studio/Live']),str(dict_desc['Music/Speech']),str(dict_desc['Valence']),str(dict_desc['Melodic']),str(dict_desc['Articulation']),str(dict_desc['RhythmicStability']),str(dict_desc['Dissonance']),str(dict_desc['BPM']),str(dict_desc['Binary']),str(dict_desc['Key']),str(dict_desc['Mode']),str(dict_desc['TexturalStability'])
66
 
67
 
68
 
@@ -100,6 +97,9 @@ with gr.Blocks() as demo:
100
  with gr.Column():
101
  gr.HTML("<h3>Instruments</h3>")
102
  instruments = gr.Label(label="Instruments", show_label=False)
 
 
 
103
 
104
  with gr.Column():
105
  gr.HTML("<h3> Descriptors</h3>")
@@ -130,8 +130,11 @@ with gr.Blocks() as demo:
130
  analyze_btn.click(process, inputs=[audio_input],
131
  outputs=[dict_moods,
132
  genres,
133
- instruments,
 
 
134
  themes,
 
135
  acousticness,
136
  danceability,
137
  arousal,
 
51
  for d in res['instruments']:
52
  instruments[d['name']] = d['probability']
53
 
54
+ timbres = {}
55
  for d in res['timbres']:
56
+ timbres[d['name']] = d['probability']
57
+
58
+ vocalgender[res['vocal_gender'][0]['name']]= res['vocal_gender'][0]['probability']
59
 
60
+ audioquality[res['audio_quality'][0]['name']]= res['audio_quality'][0]['probability']
 
61
 
62
+ return dict_moods, genres, instruments, vocalgender, timbres, themes, audioquality,str(dict_desc['Electric/Acoustic']),str(dict_desc['Danceability']),str(dict_desc['Arousal']),str(dict_desc['Vocal/Instrumental']),str(dict_desc['Studio/Live']),str(dict_desc['Music/Speech']),str(dict_desc['Valence']),str(dict_desc['Melodic']),str(dict_desc['Articulation']),str(dict_desc['RhythmicStability']),str(dict_desc['Dissonance']),str(dict_desc['BPM']),str(dict_desc['Binary']),str(dict_desc['Key']),str(dict_desc['Mode']),str(dict_desc['TexturalStability'])
 
 
 
63
 
64
 
65
 
 
97
  with gr.Column():
98
  gr.HTML("<h3>Instruments</h3>")
99
  instruments = gr.Label(label="Instruments", show_label=False)
100
+ vocalgender = gr.Label(label="Vocal Gender", show_label=False)
101
+ timbres = gr.Label(label="Texture", show_label=False)
102
+ audioquality = gr.Label(label="Audio Quality", show_label=False)
103
 
104
  with gr.Column():
105
  gr.HTML("<h3> Descriptors</h3>")
 
130
  analyze_btn.click(process, inputs=[audio_input],
131
  outputs=[dict_moods,
132
  genres,
133
+ instruments,
134
+ vocalgender,
135
+ timbres,
136
  themes,
137
+ audioquality,
138
  acousticness,
139
  danceability,
140
  arousal,