File size: 1,072 Bytes
7630e84
 
 
 
 
 
9a7dc92
7630e84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31e7e40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import gradio as gr
import os
from main import LANGS, Pipeline


def video_identity(video, source_language="English", target_language="Spanish"):
    pipeline = Pipeline()
    video_path = pipeline(video, "sample", source_language, target_language)

    return video_path


demo = gr.Interface(video_identity,
                    inputs=[gr.Video(),
                            gr.components.Dropdown(label="Source Language", choices=LANGS),
                            gr.components.Dropdown(label="Target Language", choices=LANGS),
                            ],
                    outputs="playable_video",
                    examples=[[
                        os.path.join(os.path.dirname(__file__),
                                     "sample/iPhone_14_Pro.mp4"), "English"]],
                    cache_examples=True,
                    title="Video Subtitler Demo 🍿🍿🍿",
                    description="This demo is a proof of concept for a video subtitler. "
                    )

pipeline = Pipeline()
demo.queue(max_size=15).launch(show_error=True)