Liusuthu commited on
Commit
2455fea
Β·
verified Β·
1 Parent(s): 5b8e5cd

Update app_utils.py

Browse files
Files changed (1) hide show
  1. app_utils.py +11 -2
app_utils.py CHANGED
@@ -71,7 +71,9 @@ def classify_continuous(audio):
71
 
72
  out_prob, score, index, text_lab = classifier.classify_batch(signal1)
73
  print(type(out_prob.squeeze(0).numpy()))
 
74
  print(type(text_lab[-1]))
 
75
  return text_results, out_prob.squeeze(0).numpy(), text_lab[-1], Audio
76
 
77
 
@@ -401,7 +403,14 @@ def video_score(video):
401
  my_audio_clip = AudioFileClip(video)
402
  my_audio_clip.write_audiofile("data/audio.wav",ffmpeg_params=["-ac","1"])
403
 
404
-
 
 
 
 
 
405
 
 
 
406
 
407
- return score1
 
71
 
72
  out_prob, score, index, text_lab = classifier.classify_batch(signal1)
73
  print(type(out_prob.squeeze(0).numpy()))
74
+ print(out_prob.squeeze(0).numpy())
75
  print(type(text_lab[-1]))
76
+ print(text_lab[-1])
77
  return text_results, out_prob.squeeze(0).numpy(), text_lab[-1], Audio
78
 
79
 
 
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