Spaces:
Running
Running
Liangcd
commited on
Commit
•
1172100
1
Parent(s):
0d5f907
[demo] refine app.py
Browse files- app.py +9 -13
- pre_model/cnceleb_resnet34_LM.onnx +0 -3
- pre_model/voxceleb_resnet34_LM.onnx +0 -3
app.py
CHANGED
@@ -99,13 +99,9 @@ def speaker_verification(audio_path1, audio_path2, lang='CN'):
|
|
99 |
if audio_path1 == None or audio_path2 == None:
|
100 |
output = OUTPUT_ERROR.format('Please enter two audios')
|
101 |
return output
|
102 |
-
if lang == '
|
103 |
-
model = OnnxModel('pre_model/voxceleb_resnet34_LM.onnx')
|
104 |
-
elif lang == 'cnc_res34_LM':
|
105 |
-
model = OnnxModel('pre_model/cnceleb_resnet34_LM.onnx')
|
106 |
-
elif lang == 'vox_res34':
|
107 |
model = OnnxModel('pre_model/voxceleb_resnet34.onnx')
|
108 |
-
elif lang == '
|
109 |
model = OnnxModel('pre_model/cnceleb_resnet34.onnx')
|
110 |
else:
|
111 |
output = OUTPUT_ERROR.format('Please select a language')
|
@@ -134,7 +130,7 @@ inputs = [
|
|
134 |
type="filepath",
|
135 |
optional=True,
|
136 |
label='Speaker#2'),
|
137 |
-
gr.Radio(['
|
138 |
]
|
139 |
|
140 |
output = gr.outputs.HTML(label="")
|
@@ -148,12 +144,12 @@ article = (
|
|
148 |
"</p>")
|
149 |
|
150 |
examples = [
|
151 |
-
['examples/BAC009S0764W0228.wav', 'examples/BAC009S0764W0328.wav', '
|
152 |
-
['examples/BAC009S0913W0133.wav', 'examples/BAC009S0764W0228.wav', '
|
153 |
-
['examples/00001_spk1.wav', 'examples/00003_spk2.wav', '
|
154 |
-
['examples/00010_spk2.wav', 'examples/00024_spk1.wav', '
|
155 |
-
['examples/00001_spk1.wav', 'examples/00024_spk1.wav', '
|
156 |
-
['examples/00010_spk2.wav', 'examples/00003_spk2.wav', '
|
157 |
]
|
158 |
|
159 |
interface = gr.Interface(
|
|
|
99 |
if audio_path1 == None or audio_path2 == None:
|
100 |
output = OUTPUT_ERROR.format('Please enter two audios')
|
101 |
return output
|
102 |
+
if lang == 'EN':
|
|
|
|
|
|
|
|
|
103 |
model = OnnxModel('pre_model/voxceleb_resnet34.onnx')
|
104 |
+
elif lang == 'CN':
|
105 |
model = OnnxModel('pre_model/cnceleb_resnet34.onnx')
|
106 |
else:
|
107 |
output = OUTPUT_ERROR.format('Please select a language')
|
|
|
130 |
type="filepath",
|
131 |
optional=True,
|
132 |
label='Speaker#2'),
|
133 |
+
gr.Radio(['EN', 'CN'], label='Language'),
|
134 |
]
|
135 |
|
136 |
output = gr.outputs.HTML(label="")
|
|
|
144 |
"</p>")
|
145 |
|
146 |
examples = [
|
147 |
+
['examples/BAC009S0764W0228.wav', 'examples/BAC009S0764W0328.wav', 'CN'],
|
148 |
+
['examples/BAC009S0913W0133.wav', 'examples/BAC009S0764W0228.wav', 'CN'],
|
149 |
+
['examples/00001_spk1.wav', 'examples/00003_spk2.wav', 'EN'],
|
150 |
+
['examples/00010_spk2.wav', 'examples/00024_spk1.wav', 'EN'],
|
151 |
+
['examples/00001_spk1.wav', 'examples/00024_spk1.wav', 'EN'],
|
152 |
+
['examples/00010_spk2.wav', 'examples/00003_spk2.wav', 'EN'],
|
153 |
]
|
154 |
|
155 |
interface = gr.Interface(
|
pre_model/cnceleb_resnet34_LM.onnx
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:e7584940aeac8d5512d875e58ce6c09ba4ddad65d8128e1dac0d93aadd087ebb
|
3 |
-
size 26530309
|
|
|
|
|
|
|
|
pre_model/voxceleb_resnet34_LM.onnx
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:7bb2f06e9df17cdf1ef14ee8a15ab08ed28e8d0ef5054ee135741560df2ec068
|
3 |
-
size 26530309
|
|
|
|
|
|
|
|