|
import gradio as gr |
|
|
|
|
|
from PIL import Image |
|
from gtts import gTTS |
|
import tempfile |
|
from pydub import AudioSegment |
|
from pydub.generators import Sine |
|
|
|
|
|
import soundfile |
|
|
|
import dlib |
|
import cv2 |
|
import imageio |
|
import os |
|
import gradio as gr |
|
import os, subprocess, torchaudio |
|
from PIL import Image |
|
import ffmpeg |
|
|
|
|
|
|
|
block = gr.Blocks() |
|
|
|
|
|
|
|
def generate_ocr(method,image,gender): |
|
print("efef") |
|
return "Hello" |
|
|
|
def run(): |
|
with block: |
|
|
|
with gr.Group(): |
|
with gr.Box(): |
|
with gr.Row().style(equal_height=True): |
|
image_in = gr.Image(show_label=False, type="filepath") |
|
|
|
input_text=gr.Textbox(lines=3, value="Hello How are you?", label="Input Text") |
|
gender = gr.Radio(["Female","Male"],value="Female",label="Gender") |
|
video_out = gr.Textbox(label="output") |
|
|
|
with gr.Row().style(equal_height=True): |
|
btn = gr.Button("Generate") |
|
|
|
btn.click(generate_ocr, inputs=[image_in, input_text,gender], outputs=[video_out]) |
|
|
|
block.launch(server_name="0.0.0.0", server_port=7860) |
|
|
|
if __name__ == "__main__": |
|
run() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|