Spaces:
Sleeping
Sleeping
File size: 1,132 Bytes
93a8660 db11b12 ad899fc 9518bb4 f20a44c c65d1a4 93a8660 f20a44c 93a8660 f20a44c ad899fc f20a44c 93a8660 b5af90f 93a8660 f20a44c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
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=outputs=[gr.components.Textbox(label="your result")]
# outputs=[gr.components.File(label="Your result")]
)
interface.launch(debug=True) |