vitaliy-sharandin
commited on
Commit
•
9110e67
1
Parent(s):
2c9e1d7
Update app.py
Browse files
app.py
CHANGED
@@ -275,12 +275,23 @@ def translate_video(video_path, youtube_link, target_language, speaker_model):
|
|
275 |
def clear_inputs():
|
276 |
return None, "", None, None
|
277 |
|
278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
gr.Markdown("<h1 style='text-align: center;'>🌐AI Video Translation</h2>")
|
280 |
gr.Markdown("<h3 style='text-align: center;'>Currently supported languages are: English, Polish, Ukrainian, and Russian</h3>")
|
281 |
|
282 |
with gr.Row():
|
283 |
-
with gr.Column():
|
284 |
gr.Markdown("<h2 style='text-align: center;'>Inputs</h3>")
|
285 |
video = gr.Video(label="Upload a video file")
|
286 |
gr.Markdown("<h3 style='text-align: center;'>OR</h3>")
|
@@ -290,11 +301,13 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
290 |
speaker_model = gr.Dropdown(["(Recommended) XTTS_V2", "VITs (will be default for Ukrainian)"], value="(Recommended) XTTS_V2", label="Select text-to-speech generation model")
|
291 |
with gr.Row():
|
292 |
clear_btn = gr.Button("Clear inputs")
|
293 |
-
translate_btn = gr.Button("Translate")
|
294 |
-
|
295 |
with gr.Column():
|
296 |
-
gr.
|
297 |
-
|
|
|
|
|
298 |
|
299 |
translate_btn.click(
|
300 |
fn=translate_video,
|
|
|
275 |
def clear_inputs():
|
276 |
return None, "", None, None
|
277 |
|
278 |
+
|
279 |
+
|
280 |
+
css = """
|
281 |
+
.column-frame {
|
282 |
+
border: 2px solid #AAA;
|
283 |
+
border-radius: 10px;
|
284 |
+
padding: 10px;
|
285 |
+
margin: 10px;
|
286 |
+
}
|
287 |
+
"""
|
288 |
+
|
289 |
+
with gr.Blocks(theme=gr.themes.Soft(), css=css) as demo:
|
290 |
gr.Markdown("<h1 style='text-align: center;'>🌐AI Video Translation</h2>")
|
291 |
gr.Markdown("<h3 style='text-align: center;'>Currently supported languages are: English, Polish, Ukrainian, and Russian</h3>")
|
292 |
|
293 |
with gr.Row():
|
294 |
+
with gr.Column(elem_classes=["column-frame"]):
|
295 |
gr.Markdown("<h2 style='text-align: center;'>Inputs</h3>")
|
296 |
video = gr.Video(label="Upload a video file")
|
297 |
gr.Markdown("<h3 style='text-align: center;'>OR</h3>")
|
|
|
301 |
speaker_model = gr.Dropdown(["(Recommended) XTTS_V2", "VITs (will be default for Ukrainian)"], value="(Recommended) XTTS_V2", label="Select text-to-speech generation model")
|
302 |
with gr.Row():
|
303 |
clear_btn = gr.Button("Clear inputs")
|
304 |
+
translate_btn = gr.Button("Translate")
|
305 |
+
|
306 |
with gr.Column():
|
307 |
+
with gr.Row(elem_classes=["column-frame"]):
|
308 |
+
with gr.Column():
|
309 |
+
gr.Markdown("<h2 style='text-align: center;'>Translated Video</h3>")
|
310 |
+
output_video = gr.Video(label="Translated video")
|
311 |
|
312 |
translate_btn.click(
|
313 |
fn=translate_video,
|