Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -40,17 +40,19 @@ def video_demo(video, subtitle, subtitle_type, subtitle_language):
|
|
40 |
else:
|
41 |
return video
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
gr.Markdown("
|
46 |
-
|
47 |
-
|
48 |
-
gr.Video(label="Video", interactive=True)
|
49 |
-
gr.File(label="Subtitle", file_types=[".srt", ".vtt"])
|
50 |
-
gr.Textbox(label="Subtitle Language (ISO 639-1 code, 'en' for English)")
|
51 |
-
|
52 |
-
|
53 |
-
)
|
|
|
|
|
54 |
|
55 |
if __name__ == "__main__":
|
56 |
demo.launch()
|
|
|
40 |
else:
|
41 |
return video
|
42 |
|
43 |
+
with gr.Blocks() as demo:
|
44 |
+
gr.Markdown("# Text to SRT Converter")
|
45 |
+
gr.Markdown("### ⚠️ For information, the process can be really long.")
|
46 |
+
|
47 |
+
with gr.Group():
|
48 |
+
video_input = gr.Video(label="Video", interactive=True)
|
49 |
+
subtitle_input = gr.File(label="Subtitle", file_types=[".srt", ".vtt"])
|
50 |
+
subtitle_language_input = gr.Textbox(label="Subtitle Language (ISO 639-1 code, 'en' for English)")
|
51 |
+
submit_button = gr.Button("Submit")
|
52 |
+
|
53 |
+
output_video = gr.Video(label="Processed Video")
|
54 |
+
|
55 |
+
submit_button.click(fn=video_demo, inputs=[video_input, subtitle_input, subtitle_language_input], outputs=output_video)
|
56 |
|
57 |
if __name__ == "__main__":
|
58 |
demo.launch()
|