Spaces:
Running
Running
Liangcd
commited on
Commit
·
d6e0b7c
1
Parent(s):
594b332
[demo] update display
Browse files
app.py
CHANGED
@@ -94,15 +94,17 @@ class OnnxModel(object):
|
|
94 |
input_feed={'feats': feats})
|
95 |
return embeddings[0]
|
96 |
|
|
|
|
|
97 |
|
98 |
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 == 'EN':
|
103 |
-
model =
|
104 |
elif lang == 'CN':
|
105 |
-
model =
|
106 |
else:
|
107 |
output = OUTPUT_ERROR.format('Please select a language')
|
108 |
return output
|
|
|
94 |
input_feed={'feats': feats})
|
95 |
return embeddings[0]
|
96 |
|
97 |
+
vox_model = OnnxModel('pre_model/voxceleb_resnet34.onnx')
|
98 |
+
cnc_model = OnnxModel('pre_model/cnceleb_resnet34.onnx')
|
99 |
|
100 |
def speaker_verification(audio_path1, audio_path2, lang='CN'):
|
101 |
if audio_path1 == None or audio_path2 == None:
|
102 |
output = OUTPUT_ERROR.format('Please enter two audios')
|
103 |
return output
|
104 |
if lang == 'EN':
|
105 |
+
model = vox_model
|
106 |
elif lang == 'CN':
|
107 |
+
model = cnc_model
|
108 |
else:
|
109 |
output = OUTPUT_ERROR.format('Please select a language')
|
110 |
return output
|