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, speaking_rate): | |
translate = Translate(video_path, target_language, original_language, speaking_rate) | |
video = translate.transcribe_and_translate() | |
# Return video in the output | |
return gr.Video(video) | |
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")] | |
) | |
interface.launch(debug=True) |