Raphael
commited on
full transcription output
Browse filesSigned-off-by: Raphael <[email protected]>
app.py
CHANGED
@@ -66,8 +66,8 @@ def demo(url: str, translate: bool):
|
|
66 |
LOG.info("Base directory %s", basedir)
|
67 |
video_path, video = download(url, os.path.join(basedir, 'video.mp4'))
|
68 |
audio_clips(video, basedir)
|
69 |
-
srt_file, summary = process_video(basedir, video.duration, translate)
|
70 |
-
return summary, srt_file, [video_path, srt_file]
|
71 |
|
72 |
|
73 |
def download(url, dst):
|
@@ -118,7 +118,7 @@ def process_video(basedir: str, duration, translate: bool):
|
|
118 |
subs = translation(transcriptions, translate)
|
119 |
srt_file = build_srt_clips(subs, basedir)
|
120 |
summary = summarize(transcriptions, translate)
|
121 |
-
return srt_file, summary
|
122 |
|
123 |
|
124 |
def transcription(audio_dir: str, duration):
|
@@ -247,6 +247,7 @@ iface = gr.Interface(
|
|
247 |
gr.Text(label="Video summary"),
|
248 |
gr.File(label="SRT file"),
|
249 |
gr.Video(label="Video with subtitles"),
|
|
|
250 |
])
|
251 |
|
252 |
iface.launch()
|
|
|
66 |
LOG.info("Base directory %s", basedir)
|
67 |
video_path, video = download(url, os.path.join(basedir, 'video.mp4'))
|
68 |
audio_clips(video, basedir)
|
69 |
+
srt_file, full_transcription, summary = process_video(basedir, video.duration, translate)
|
70 |
+
return summary, srt_file, [video_path, srt_file], full_transcription
|
71 |
|
72 |
|
73 |
def download(url, dst):
|
|
|
118 |
subs = translation(transcriptions, translate)
|
119 |
srt_file = build_srt_clips(subs, basedir)
|
120 |
summary = summarize(transcriptions, translate)
|
121 |
+
return srt_file, ' '.join(subs).strip(), summary
|
122 |
|
123 |
|
124 |
def transcription(audio_dir: str, duration):
|
|
|
247 |
gr.Text(label="Video summary"),
|
248 |
gr.File(label="SRT file"),
|
249 |
gr.Video(label="Video with subtitles"),
|
250 |
+
gr.Text(label="Full transcription")
|
251 |
])
|
252 |
|
253 |
iface.launch()
|