Spaces:
Runtime error
Runtime error
File size: 774 Bytes
8dcb834 aecb38a 8dcb834 aecb38a 8dcb834 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from translate import Translate # Import the Translate class
import gradio as gr
import os
from google.colab import files
def app(video_path, original_language, target_language):
translator = Translate(video_path, original_language, target_language)
video_file = translator.translate_video()
return video_file
# Gradio's built-in File component handles download functionality
interface_video_file = gr.Interface(
fn=app,
inputs=[
gr.Video(label="Video Path"),
gr.Dropdown(["English", "German", "Italian", "Spanish"], label="Original Language"),
gr.Dropdown(["English", "German", "Italian", "Spanish"], label="Targeted Language"),
],
outputs=gr.Video(label="Translated Video")
)
interface_video_file.launch(debug=True)
|