Rob Jaret commited on
Commit
67e4482
·
1 Parent(s): a55e289

Added instructions, et. al.

Browse files
Files changed (1) hide show
  1. app.py +17 -5
app.py CHANGED
@@ -4,8 +4,8 @@ import huggingface_hub
4
  model_path_configs = {
5
  "Humpback Whales": ("Intelligent-Instruments-Lab/rave-models", "humpbacks_pondbrain_b2048_r48000_z20.ts"),
6
  "Magnets": ("Intelligent-Instruments-Lab/rave-models", "magnets_b2048_r48000_z8.ts"),
7
- "Big Ensemble": ("Intelligent-Instruments-Lab/rave-models", "crozzoli_bigensemblesmusic_18d.ts"),
8
- "Bird Dawn Chorus": ("Intelligent-Instruments-Lab/rave-models", "birds_dawnchorus_b2048_r48000_z8.ts"),
9
  "Speaking & Singing": ("Intelligent-Instruments-Lab/rave-models", "voice-multi-b2048-r48000-z11.ts"),
10
  "Resonator Piano": ("Intelligent-Instruments-Lab/rave-models", "mrp_strengjavera_b2048_r44100_z16.ts"),
11
  "Multimbral Guitar": ("Intelligent-Instruments-Lab/rave-models", "guitar_iil_b2048_r48000_z16.ts"),
@@ -248,12 +248,24 @@ def GenerateRaveEncDecAudio(model_name_a, model_name_b, audio_file_name, audio_f
248
 
249
  import gradio as gr
250
 
 
251
  waveform_options = gr.WaveformOptions(waveform_color="#01C6FF",
252
  waveform_progress_color="#0066B4",
253
  skip_length=2,)
254
- column_widths=['35%', '20%', '20%', '25%']
255
 
256
- AverageModels = gr.Interface(title="Process Audio Through Averaged Models.",
 
 
 
 
 
 
 
 
 
 
 
 
257
  fn=GenerateRaveEncDecAudio,
258
  inputs=[
259
  gr.Radio(model_path_config_keys, label="Select Model A", value="Multimbral Guitar", container=True),
@@ -271,7 +283,7 @@ AverageModels = gr.Interface(title="Process Audio Through Averaged Models.",
271
  gr.Audio(label="Encoded/Decoded through Model A", sources=None, waveform_options=waveform_options,),
272
  gr.Audio(label="Encoded/Decoded through Model B", sources=None, waveform_options=waveform_options,),
273
  gr.Audio(label="Encoded/Decoded through averaged model", sources=None, waveform_options=waveform_options,),
274
- gr.Textbox(label="Stats"),
275
  gr.Dataframe(label="Params Averaged", show_copy_button="True", scale=100, column_widths=column_widths, headers=['Param Name', 'Model A Shape', 'Model B Shape', 'Errors']),
276
  gr.Dataframe(label="Params Not Averaged", show_copy_button="True", scale=100, column_widths=column_widths, headers=['Param Name', 'Model A Shape', 'Model B Shape', 'Errors'])
277
  ]
 
4
  model_path_configs = {
5
  "Humpback Whales": ("Intelligent-Instruments-Lab/rave-models", "humpbacks_pondbrain_b2048_r48000_z20.ts"),
6
  "Magnets": ("Intelligent-Instruments-Lab/rave-models", "magnets_b2048_r48000_z8.ts"),
7
+ "Big Ensemble": ("Intelligent-Instruments-Lab/rave-models", "crozzoli_bigensemblesmusic_18d.ts"),
8
+ "Bird Dawn Chorus": ("Intelligent-Instruments-Lab/rave-models", "birds_dawnchorus_b2048_r48000_z8.ts"),
9
  "Speaking & Singing": ("Intelligent-Instruments-Lab/rave-models", "voice-multi-b2048-r48000-z11.ts"),
10
  "Resonator Piano": ("Intelligent-Instruments-Lab/rave-models", "mrp_strengjavera_b2048_r44100_z16.ts"),
11
  "Multimbral Guitar": ("Intelligent-Instruments-Lab/rave-models", "guitar_iil_b2048_r48000_z16.ts"),
 
248
 
249
  import gradio as gr
250
 
251
+ column_widths=['35%', '20%', '20%', '25%']
252
  waveform_options = gr.WaveformOptions(waveform_color="#01C6FF",
253
  waveform_progress_color="#0066B4",
254
  skip_length=2,)
 
255
 
256
+ description = "<p>This app attempts to average tewo RAVE models and then encode and decode an audio file through the averaged model.</p>" \
257
+ "<ul><li>Select the two models from the list of pre-trained RAVE models (put credits).</li>" \
258
+ "<li>Select an audio file from the ones available in the dropdown, or upload an audio file of up to 60 seconds.</li>" \
259
+ "<li>Select a sample rate multiple for the averaged model. When there is a useful result, it sometimes sounds better at double the sample rate.</li>" \
260
+ "<li>Select a bias towards one of the models. A bias of 0 will average the two models equally. A positive bias will favor Model A, and a negative bias will favor Model B.</li></ul>" \
261
+ "<p>The app will display the original audio, the audio processed through each individual model, and the audio processed through the averaged model.</p>" \
262
+ "<p>Note that in most cases not all parameters can be averaged. They may not exist in both models, or they may not have the same shape.</br>" \
263
+ "These will be reported in the output dataframes and can be copied into a spreadsheet to be analyzed.</p>" \
264
+
265
+
266
+
267
+
268
+ AverageModels = gr.Interface(title="Process Audio Through the Average of Two Rave Models", description=description,
269
  fn=GenerateRaveEncDecAudio,
270
  inputs=[
271
  gr.Radio(model_path_config_keys, label="Select Model A", value="Multimbral Guitar", container=True),
 
283
  gr.Audio(label="Encoded/Decoded through Model A", sources=None, waveform_options=waveform_options,),
284
  gr.Audio(label="Encoded/Decoded through Model B", sources=None, waveform_options=waveform_options,),
285
  gr.Audio(label="Encoded/Decoded through averaged model", sources=None, waveform_options=waveform_options,),
286
+ gr.Textbox(label="Info:"),
287
  gr.Dataframe(label="Params Averaged", show_copy_button="True", scale=100, column_widths=column_widths, headers=['Param Name', 'Model A Shape', 'Model B Shape', 'Errors']),
288
  gr.Dataframe(label="Params Not Averaged", show_copy_button="True", scale=100, column_widths=column_widths, headers=['Param Name', 'Model A Shape', 'Model B Shape', 'Errors'])
289
  ]