Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ BATCH_SIZE = 1
|
|
10 |
device = 0 if torch.cuda.is_available() else "cpu"
|
11 |
|
12 |
mySpeechScore = SpeechScore([
|
13 |
-
'PESQ'
|
14 |
])
|
15 |
|
16 |
|
@@ -35,8 +35,8 @@ def format_timestamp(seconds: float, always_include_hours: bool = False, decimal
|
|
35 |
return seconds
|
36 |
|
37 |
|
38 |
-
def score(test_file, ref_file,
|
39 |
-
scores = mySpeechScore(test_path=test_file, reference_path=ref_file, window=None, score_rate=16000, return_mean=False)
|
40 |
return scores
|
41 |
|
42 |
|
@@ -47,8 +47,9 @@ file_score = gr.Interface(
|
|
47 |
inputs=[
|
48 |
gr.Audio(sources=["upload"], label="test file", type="filepath"),
|
49 |
gr.Audio(sources=["upload"], label="reference file", type="filepath"),
|
50 |
-
gr.Radio(["without reference", "with reference"], label="Task", info="choose non-instrusive or instrusive scoring"),
|
51 |
-
|
|
|
52 |
],
|
53 |
outputs="text",
|
54 |
#layout="horizontal",
|
|
|
10 |
device = 0 if torch.cuda.is_available() else "cpu"
|
11 |
|
12 |
mySpeechScore = SpeechScore([
|
13 |
+
'PESQ','DNSMOS'
|
14 |
])
|
15 |
|
16 |
|
|
|
35 |
return seconds
|
36 |
|
37 |
|
38 |
+
def score(test_file, ref_file, dnsmos, pesq, return_timestamps):
|
39 |
+
scores = mySpeechScore(test_path=test_file, reference_path=ref_file, dnsmos=dnsmos, pesq=pesq, window=None, score_rate=16000, return_mean=False)
|
40 |
return scores
|
41 |
|
42 |
|
|
|
47 |
inputs=[
|
48 |
gr.Audio(sources=["upload"], label="test file", type="filepath"),
|
49 |
gr.Audio(sources=["upload"], label="reference file", type="filepath"),
|
50 |
+
#gr.Radio(["without reference", "with reference"], label="Task", info="choose non-instrusive or instrusive scoring"),
|
51 |
+
gr.Checkbox(default=False, label="DNSMOS"),
|
52 |
+
gr.Checkbox(default=False, label="PESQ"),
|
53 |
],
|
54 |
outputs="text",
|
55 |
#layout="horizontal",
|