Spaces:
Sleeping
Sleeping
Salman11223
commited on
Commit
·
f20a44c
1
Parent(s):
6e7f968
Update app.py
Browse files
app.py
CHANGED
@@ -3,20 +3,24 @@ import gradio as gr
|
|
3 |
|
4 |
def translate_video(video_path, original_language, target_language, speaking_rate):
|
5 |
translator = Translate(video_path, target_language, original_language, speaking_rate)
|
6 |
-
translator.transcribe_and_translate()
|
7 |
-
|
|
|
8 |
|
9 |
-
interface = gr.Interface(
|
|
|
10 |
inputs=[
|
11 |
-
gr.
|
12 |
-
gr.
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
15 |
],
|
16 |
-
outputs=gr.Video(
|
17 |
-
live=True,
|
18 |
-
interpretation="default",
|
19 |
-
capture_session=True
|
20 |
)
|
21 |
|
22 |
-
interface.launch(debug
|
|
|
3 |
|
4 |
def translate_video(video_path, original_language, target_language, speaking_rate):
|
5 |
translator = Translate(video_path, target_language, original_language, speaking_rate)
|
6 |
+
video = translator.transcribe_and_translate()
|
7 |
+
# Return video in the output
|
8 |
+
return gr.Video(video)
|
9 |
|
10 |
+
interface = gr.Interface(
|
11 |
+
fn=app,
|
12 |
inputs=[
|
13 |
+
gr.components.Video(sources="upload", label="upload video"),
|
14 |
+
gr.Dropdown(
|
15 |
+
["English", "German", "French" ,"Spanish"], label="Original Language"
|
16 |
+
),
|
17 |
+
gr.Dropdown(
|
18 |
+
["English", "German", "French" ,"Spanish","Urdu"], label="Targeted Language"
|
19 |
+
),
|
20 |
+
gr.components.Textbox(label="Enter Float Value")
|
21 |
+
|
22 |
],
|
23 |
+
outputs=[gr.components.Video(label="Your result")]
|
|
|
|
|
|
|
24 |
)
|
25 |
|
26 |
+
interface.launch(debug=True)
|