alibabasglab commited on
Commit
b66c175
·
verified ·
1 Parent(s): 2db1d26

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -35,12 +35,7 @@ def format_timestamp(seconds: float, always_include_hours: bool = False, decimal
35
  return seconds
36
 
37
 
38
- def score(test_file, ref_file, dnsmos, pesq, return_timestamps):
39
- score_list=[]
40
- if dnsmos:
41
- score_list+=['DNSMOS']
42
- if pesq:
43
- score_list+=['PESQ']
44
  mySpeechScore = SpeechScore(score_list)
45
  scores = mySpeechScore(test_path=test_file, reference_path=ref_file, window=None, score_rate=16000, return_mean=False)
46
  return scores
@@ -54,8 +49,11 @@ file_score = gr.Interface(
54
  gr.Audio(sources=["upload"], label="test file", type="filepath"),
55
  gr.Audio(sources=["upload"], label="reference file", type="filepath"),
56
  #gr.Radio(["without reference", "with reference"], label="Task", info="choose non-instrusive or instrusive scoring"),
57
- gr.Checkbox(default=False, label="DNSMOS"),
58
- gr.Checkbox(default=False, label="PESQ"),
 
 
 
59
  ],
60
  outputs="text",
61
  #layout="horizontal",
 
35
  return seconds
36
 
37
 
38
+ def score(test_file, ref_file, score_list, return_timestamps):
 
 
 
 
 
39
  mySpeechScore = SpeechScore(score_list)
40
  scores = mySpeechScore(test_path=test_file, reference_path=ref_file, window=None, score_rate=16000, return_mean=False)
41
  return scores
 
49
  gr.Audio(sources=["upload"], label="test file", type="filepath"),
50
  gr.Audio(sources=["upload"], label="reference file", type="filepath"),
51
  #gr.Radio(["without reference", "with reference"], label="Task", info="choose non-instrusive or instrusive scoring"),
52
+ #gr.Checkbox(default=False, label="DNSMOS"),
53
+ #gr.Checkbox(default=False, label="PESQ"),
54
+ gr.Dropdown(
55
+ ["DNSMOS", "PESQ", "NB-PESQ", "SISNR"], value=["DNSMOS", "PESQ"], multiselect=True, label="Scores", info="By checking the following scores, include them in the output."
56
+ ),
57
  ],
58
  outputs="text",
59
  #layout="horizontal",