Spaces:
Runtime error
Runtime error
import gradio as gr | |
import numpy as np | |
def avatar_pro(videos, powerpoint): | |
return videos | |
def avatar_lite(image, text, powerpoint): | |
return 0 | |
with gr.Blocks() as demo: | |
gr.Markdown('''## Avatar: Easily Show Yourself | |
Please Chose User Model: **Avatar Pro** or **Avatar Lite** | |
In Avatar Program, You can easily generate a video with your own cartoon image for powerpoint presentation | |
In **Avatar Pro** mode, You need to upload a video and a powerpoint file | |
In **Avatar Lite** mode, You need to upload a selfie, a powerpoint and a presentation text''') | |
with gr.Tab("Avatar Pro"): | |
with gr.Row(): | |
video_input_pro = gr.Video(label="Please Upload Your Representation Video") | |
ppt_input_pro = gr.File(label="Please Upload your Powerpoint File") | |
video_output_pro = gr.Video(label="Here is your final Video") | |
pro_button = gr.Button("Generate!") | |
with gr.Tab("Avatar Lite"): | |
text_input_lite = gr.Textbox(label="Please Enter Your Speech") | |
with gr.Row(): | |
image_input_lite = gr.Image(label="Please Upload Your Photo") | |
ppt_input_lite = gr.File(label="Please Upload your Powerpoint File") | |
video_output_lite = gr.Video(label="Here is your final Video") | |
lite_button = gr.Button("Generate!") | |
inputs_pro = [video_input_pro, ppt_input_pro] | |
inputs_lite = [image_input_lite, text_input_lite, ppt_input_lite] | |
pro_button.click(avatar_pro, inputs=inputs_pro, outputs=video_output_pro) | |
lite_button.click(avatar_lite, inputs=inputs_lite, outputs=video_output_lite) | |
demo.launch() | |