PierreHanna commited on
Commit
037ae38
1 Parent(s): 1349967

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -91,11 +91,12 @@ def process(audio_file, embed_html_all):
91
  else:
92
  vocalgender[res['vocal_gender'][0]['name']]= 0
93
 
 
94
 
95
  audioquality = {}
96
  audioquality[res['audio_quality'][0]['name']]= res['audio_quality'][0]['probability']
97
 
98
- return embed_html_all, 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'])
99
  #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'])
100
 
101
 
@@ -153,6 +154,9 @@ with gr.Blocks() as demo:
153
  gr.HTML("<h3> AudioQuality</h3>")
154
  audioquality = gr.Label(label="Audio Quality", show_label=False)
155
 
 
 
 
156
  with gr.Column():
157
  gr.HTML("<h3> Descriptors</h3>")
158
  #gr.HTML("<h5> Vocal/Instrumental</h5>")
@@ -203,7 +207,8 @@ with gr.Blocks() as demo:
203
  binary,
204
  key,
205
  mode,
206
- texturalstability
 
207
  ])
208
  gr.Examples(
209
  examples = [["https://www.youtube.com/watch?v=v2AC41dglnM"],
@@ -241,7 +246,8 @@ with gr.Blocks() as demo:
241
  binary,
242
  key,
243
  mode,
244
- texturalstability
 
245
  ],
246
  fn = process_url,
247
  examples_per_page=15,
@@ -272,7 +278,8 @@ with gr.Blocks() as demo:
272
  binary,
273
  key,
274
  mode,
275
- texturalstability
 
276
  ])
277
 
278
 
 
91
  else:
92
  vocalgender[res['vocal_gender'][0]['name']]= 0
93
 
94
+ musicratio = res['music_ratio']
95
 
96
  audioquality = {}
97
  audioquality[res['audio_quality'][0]['name']]= res['audio_quality'][0]['probability']
98
 
99
+ return embed_html_all, 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']),musicratio
100
  #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'])
101
 
102
 
 
154
  gr.HTML("<h3> AudioQuality</h3>")
155
  audioquality = gr.Label(label="Audio Quality", show_label=False)
156
 
157
+ gr.HTML("<h3> MusicRatio </h3>")
158
+ musicratio = gr.Label(label="Music Ratio", show_label=False)
159
+
160
  with gr.Column():
161
  gr.HTML("<h3> Descriptors</h3>")
162
  #gr.HTML("<h5> Vocal/Instrumental</h5>")
 
207
  binary,
208
  key,
209
  mode,
210
+ texturalstability,
211
+ musicratio
212
  ])
213
  gr.Examples(
214
  examples = [["https://www.youtube.com/watch?v=v2AC41dglnM"],
 
246
  binary,
247
  key,
248
  mode,
249
+ texturalstability,
250
+ musicratio
251
  ],
252
  fn = process_url,
253
  examples_per_page=15,
 
278
  binary,
279
  key,
280
  mode,
281
+ texturalstability,
282
+ musicratio
283
  ])
284
 
285