mails10 commited on
Commit
982bef2
·
verified ·
1 Parent(s): b88e8e7

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +34 -0
  2. mos_scores.csv +0 -0
  3. requirements.txt +1 -0
app.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import csv
3
+ import os
4
+
5
+ # Audio file paths
6
+ audio_a_path = "audio/audio_a.wav"
7
+ audio_b_path = "audio/audio_b.wav"
8
+
9
+ def submit(intelligibility, naturalness, expressiveness):
10
+ with open("mos_scores.csv", "a", newline="") as f:
11
+ writer = csv.writer(f)
12
+ writer.writerow([audio_a_path, audio_b_path, intelligibility, naturalness, expressiveness])
13
+ return "Thank you for your feedback!"
14
+
15
+ with gr.Blocks() as demo:
16
+ gr.Markdown("# 🎧 MOS Evaluation")
17
+ gr.Markdown("Compare Audio A and Audio B, then rate them below.")
18
+
19
+ with gr.Row():
20
+ with gr.Column():
21
+ gr.Audio(audio_a_path, label="Audio A", type="filepath")
22
+ with gr.Column():
23
+ gr.Audio(audio_b_path, label="Audio B", type="filepath")
24
+
25
+ intelligibility = gr.Slider(1, 5, value=3, step=1, label="Intelligibility")
26
+ naturalness = gr.Slider(1, 5, value=3, step=1, label="Naturalness")
27
+ expressiveness = gr.Slider(1, 5, value=3, step=1, label="Expressiveness")
28
+
29
+ submit_btn = gr.Button("Submit")
30
+ output = gr.Textbox(label="Status")
31
+
32
+ submit_btn.click(fn=submit, inputs=[intelligibility, naturalness, expressiveness], outputs=output)
33
+
34
+ demo.launch()
mos_scores.csv ADDED
File without changes
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ gradio