Update app.py
Browse files
app.py
CHANGED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from API import aud2text, Summarize
|
2 |
+
from moviepy.editor import *
|
3 |
+
|
4 |
+
class Vid2SumModel:
|
5 |
+
|
6 |
+
def predict(self, vid_file):
|
7 |
+
video = VideoFileClip(vid_file)
|
8 |
+
audio_file = "converted_audio.mp3"
|
9 |
+
video.audio.write_audiofile(audio_file)
|
10 |
+
|
11 |
+
text = self.aud2text(audio_file)
|
12 |
+
sum_text = self.summarize(text["text"])
|
13 |
+
return sum_text[0]["summary_text"]
|