Spaces:
Sleeping
Sleeping
from translate import Translate # Import the Translate class | |
import gradio as gr | |
import os | |
import moviepy.editor as mp | |
import assemblyai as aai | |
import requests | |
import azure.cognitiveservices.speech as speechsdk | |
from moviepy.editor import AudioFileClip | |
from gradio_client import Client | |
def app(video_path, original_language, target_language): | |
translate = Translate(video_path, target_language, original_language) | |
translated_file = translate.transcribe_and_translate() | |
# Return video in the output | |
return gr.components.File(translated_file) | |
interface = gr.Interface( | |
fn=app, | |
inputs=[ | |
gr.components.Video(sources="upload", label="upload video"), | |
gr.Dropdown( | |
["English", "German", "French" ,"Spanish"], label="Original Language" | |
), | |
gr.Dropdown( | |
["English", "German", "French" ,"Spanish","Urdu"], label="Targeted Language" | |
) | |
# gr.components.Textbox(label="Enter Float Value") | |
], | |
# outputs=[gr.components.Video(label="Your result")] | |
outputs=[gr.components.File(label="Your result")] | |
) | |
interface.launch(debug=True) |