fffiloni commited on
Commit
b7fc745
1 Parent(s): 25f737f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -6,6 +6,7 @@ The entrance of the gradio
6
 
7
  import tyro
8
  import gradio as gr
 
9
  import os.path as osp
10
  from src.utils.helper import load_description
11
  from src.gradio_pipeline import GradioPipeline
@@ -32,7 +33,8 @@ gradio_pipeline = GradioPipeline(
32
  args=args
33
  )
34
 
35
- def gpu_wrapped_execute_s_video(*args, **kwargs):
 
36
  return gradio_pipeline.execute_s_video(*args, **kwargs)
37
 
38
  # assets
@@ -44,22 +46,17 @@ example_video_dir = "assets/examples/driving"
44
 
45
  # Define components first
46
 
47
- retargeting_input_image = gr.Image(type="filepath")
48
- output_image = gr.Image(type="numpy")
49
- output_image_paste_back = gr.Image(type="numpy")
50
- output_video = gr.Video()
51
- output_video_concat = gr.Video()
52
-
53
  output_video1 = gr.Video()
54
  output_video_concat1 = gr.Video()
55
 
56
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
57
- gr.HTML(load_description(title_md))
58
- gr.Markdown(load_description("assets/gradio_description_upload.md"))
59
 
60
  with gr.Row():
61
  # Examples
62
- gr.Markdown("## For video to video")
 
 
 
63
  # for video portrait
64
  with gr.Row():
65
  with gr.Accordion(open=True, label="Video Portrait"):
 
6
 
7
  import tyro
8
  import gradio as gr
9
+ import spaces
10
  import os.path as osp
11
  from src.utils.helper import load_description
12
  from src.gradio_pipeline import GradioPipeline
 
33
  args=args
34
  )
35
 
36
+ @spaces.GPU()
37
+ def gpu_wrapped_execute_s_video(*args, **kwargs, progress=gr.Progress()):
38
  return gradio_pipeline.execute_s_video(*args, **kwargs)
39
 
40
  # assets
 
46
 
47
  # Define components first
48
 
 
 
 
 
 
 
49
  output_video1 = gr.Video()
50
  output_video_concat1 = gr.Video()
51
 
52
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
 
 
53
 
54
  with gr.Row():
55
  # Examples
56
+ gr.Markdown("""
57
+ ## 🤗 This is the gradio demo for LivePortrait for video.
58
+ Please upload or use a webcam to get a Source Portrait Video (any aspect ratio) and upload a Driving Video (1:1 aspect ratio, or any aspect ratio with do crop (driving video) checked).
59
+ """)
60
  # for video portrait
61
  with gr.Row():
62
  with gr.Accordion(open=True, label="Video Portrait"):