Liusuthu commited on
Commit
ac0c33e
·
verified ·
1 Parent(s): cfe1036

Update app_utils.py

Browse files
Files changed (1) hide show
  1. app_utils.py +6 -7
app_utils.py CHANGED
@@ -397,21 +397,20 @@ def video_score(video):
397
  print(i)
398
  #平衡点值为零,越正越负面
399
  score1=0*prob[0]-8*prob[1]+4*prob[2]+0*prob[3]+2*prob[4]+2*prob[5]+4*prob[6]
400
- print("score1=",score)
401
 
402
  #trans the audio file
403
  my_audio_clip = AudioFileClip(video)
404
  my_audio_clip.write_audiofile("data/audio.wav",ffmpeg_params=["-ac","1"])
405
 
406
  Audio="data/audio.wav"
407
- #text,prob2,label,path=classify_continuous(Audio)
408
  #0是抑郁概率,1是非抑郁概率
409
- #score2=10*prob2[0]-10*prob[1]
410
- #print(prob2,label)
411
  print("score2=",score2)
412
 
413
- text_result="demo"
414
- # text_result=text_api(text)
415
- # print(text_result)
416
 
417
  return score1,score2,text_result
 
397
  print(i)
398
  #平衡点值为零,越正越负面
399
  score1=0*prob[0]-8*prob[1]+4*prob[2]+0*prob[3]+2*prob[4]+2*prob[5]+4*prob[6]
400
+ print("score1=",score1)
401
 
402
  #trans the audio file
403
  my_audio_clip = AudioFileClip(video)
404
  my_audio_clip.write_audiofile("data/audio.wav",ffmpeg_params=["-ac","1"])
405
 
406
  Audio="data/audio.wav"
407
+ text,prob2,label,path=classify_continuous(Audio)
408
  #0是抑郁概率,1是非抑郁概率
409
+ score2=10*prob2[0]-10*prob[1]
410
+ print(prob2,label)
411
  print("score2=",score2)
412
 
413
+ text_result=text_api(text)
414
+ print(text_result)
 
415
 
416
  return score1,score2,text_result