Spaces:
Running
Running
File size: 1,677 Bytes
80ebd45 f700d4a 80ebd45 f700d4a 80ebd45 f700d4a 1b4bfa7 f700d4a 1b4bfa7 |
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 36 37 38 39 40 41 42 43 44 45 |
import gradio as gr
import spaces
import torch
# zero = torch.Tensor([0]).cuda()
# print(zero.device) # <-- 'cpu' 🤔
# @spaces.GPU
# def greet(n):
# print(zero.device) # <-- 'cuda:0' 🤗
# return f"Hello {zero + n} Tensor"
def one_shot(image_in,input_text,gender):
print("Hello")
return "htllo123"
def run():
with gr.Blocks(css=".gradio-container {background-color: lightgray} #radio_div {background-color: #FFD8B4; font-size: 40px;}") as demo:
gr.Markdown("<h1 style='text-align: center;'>"+ "One Shot Talking Face from Text" + "</h1><br/><br/>")
with gr.Group():
# with gr.Box():
with gr.Row():
# with gr.Row().style(equal_height=True):
image_in = gr.Image(show_label=True, type="filepath",label="Input Image")
input_text = gr.Textbox(show_label=True,label="Input Text")
gender = gr.Radio(["Female","Male"],value="Female",label="Gender")
video_out = gr.Video(show_label=True,label="Output")
with gr.Row():
# with gr.Row().style(equal_height=True):
btn = gr.Button("Generate")
# gr.Markdown(
# """
# <p style='text-align: center;'>Feel free to give us your thoughts on this demo and please contact us at
# <a href="mailto:letstalk@pragnakalp.com" target="_blank">letstalk@pragnakalp.com</a>
# <p style='text-align: center;'>Developed by: <a href="https://www.pragnakalp.com" target="_blank">Pragnakalp Techlabs</a></p>
# """)
btn.click(one_shot, inputs=[image_in,input_text,gender], outputs=[video_out])
demo.queue()
if __name__ == "__main__":
run()
|