Spaces:
Runtime error
Runtime error
Update app_utils.py
Browse files- app_utils.py +7 -10
app_utils.py
CHANGED
@@ -18,7 +18,7 @@ import torchaudio
|
|
18 |
from speechbrain.pretrained.interfaces import foreign_class
|
19 |
from paraformer import AudioReader, CttPunctuator, FSMNVad, ParaformerOffline
|
20 |
from gradio_client import Client
|
21 |
-
|
22 |
##############################################################################################
|
23 |
client = Client("Liusuthu/TextDepression")
|
24 |
|
@@ -282,7 +282,7 @@ def video_score(video):
|
|
282 |
|
283 |
|
284 |
#ζεε½ζ°
|
285 |
-
def
|
286 |
|
287 |
cap = cv2.VideoCapture(video)
|
288 |
w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
|
@@ -441,14 +441,11 @@ def video_test(video):
|
|
441 |
my_audio_clip.write_audiofile("data/audio.wav",ffmpeg_params=["-ac","1"])
|
442 |
|
443 |
audio = wav.read('data/audio.wav')
|
444 |
-
text,prob2,label,path=classify_continuous(audio)
|
445 |
-
|
446 |
-
score2=10*prob2[0]-10*prob2[1]
|
447 |
-
print(prob2,label,path)
|
448 |
-
print("score2=",score2)
|
449 |
|
450 |
-
|
451 |
-
|
|
|
452 |
|
|
|
453 |
|
454 |
-
return
|
|
|
18 |
from speechbrain.pretrained.interfaces import foreign_class
|
19 |
from paraformer import AudioReader, CttPunctuator, FSMNVad, ParaformerOffline
|
20 |
from gradio_client import Client
|
21 |
+
from consult import speech_score
|
22 |
##############################################################################################
|
23 |
client = Client("Liusuthu/TextDepression")
|
24 |
|
|
|
282 |
|
283 |
|
284 |
#ζεε½ζ°
|
285 |
+
def video_score(video):
|
286 |
|
287 |
cap = cv2.VideoCapture(video)
|
288 |
w = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
|
|
|
441 |
my_audio_clip.write_audiofile("data/audio.wav",ffmpeg_params=["-ac","1"])
|
442 |
|
443 |
audio = wav.read('data/audio.wav')
|
|
|
|
|
|
|
|
|
|
|
444 |
|
445 |
+
text,socre2=speech_score(audio)
|
446 |
+
|
447 |
+
print(text)
|
448 |
|
449 |
+
score=score2+score1
|
450 |
|
451 |
+
return text,score
|