Update app.py
Browse files
app.py
CHANGED
@@ -13,8 +13,8 @@ os.system("wget -c https://cloud.tsinghua.edu.cn/f/da8d61d012014b12a9e4/?dl=1 -O
|
|
13 |
|
14 |
|
15 |
|
16 |
-
title = "#
|
17 |
-
DESCRIPTION = '''### Gradio
|
18 |
|
19 |
<img id="overview" alt="overview" src="https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model/raw/main/assets/vox.gif" />
|
20 |
'''
|
@@ -62,14 +62,14 @@ def main():
|
|
62 |
gr.Markdown(DESCRIPTION)
|
63 |
|
64 |
with gr.Box():
|
65 |
-
gr.Markdown('''##
|
66 |
-
-
|
67 |
-
-
|
68 |
''')
|
69 |
with gr.Row():
|
70 |
with gr.Column():
|
71 |
with gr.Row():
|
72 |
-
input_image = gr.Image(label='
|
73 |
type="pil")
|
74 |
|
75 |
with gr.Row():
|
@@ -79,13 +79,13 @@ def main():
|
|
79 |
for path in paths])
|
80 |
|
81 |
with gr.Box():
|
82 |
-
gr.Markdown('''##
|
83 |
-
-
|
84 |
''')
|
85 |
with gr.Row():
|
86 |
with gr.Column():
|
87 |
with gr.Row():
|
88 |
-
driving_video = gr.Video(label='
|
89 |
format="mp4")
|
90 |
|
91 |
with gr.Row():
|
@@ -95,16 +95,16 @@ def main():
|
|
95 |
for path in paths])
|
96 |
|
97 |
with gr.Box():
|
98 |
-
gr.Markdown('''##
|
99 |
-
-
|
100 |
''')
|
101 |
with gr.Row():
|
102 |
with gr.Column():
|
103 |
with gr.Row():
|
104 |
-
generate_button = gr.Button('
|
105 |
|
106 |
with gr.Column():
|
107 |
-
result = gr.Video(type="file", label="
|
108 |
gr.Markdown(FOOTER)
|
109 |
generate_button.click(fn=inference,
|
110 |
inputs=[
|
|
|
13 |
|
14 |
|
15 |
|
16 |
+
title = "# 图片动画"
|
17 |
+
DESCRIPTION = '''### 图片动画的Gradio实现</b>, CVPR 2022. <a href='https://arxiv.org/abs/2203.14367'>[Paper]</a><a href='https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model'>[Github Code]</a>
|
18 |
|
19 |
<img id="overview" alt="overview" src="https://github.com/yoyo-nb/Thin-Plate-Spline-Motion-Model/raw/main/assets/vox.gif" />
|
20 |
'''
|
|
|
62 |
gr.Markdown(DESCRIPTION)
|
63 |
|
64 |
with gr.Box():
|
65 |
+
gr.Markdown('''## 第1步 (上传人脸图片)
|
66 |
+
- 拖一张含人脸的图片到 **输入图片**.
|
67 |
+
- 如果图片中有多张人脸, 使用右上角的编辑按钮裁剪图片.
|
68 |
''')
|
69 |
with gr.Row():
|
70 |
with gr.Column():
|
71 |
with gr.Row():
|
72 |
+
input_image = gr.Image(label='输入图片',
|
73 |
type="pil")
|
74 |
|
75 |
with gr.Row():
|
|
|
79 |
for path in paths])
|
80 |
|
81 |
with gr.Box():
|
82 |
+
gr.Markdown('''## 第2步 (选择动态视频)
|
83 |
+
- **为人脸图片选择目标视频**.
|
84 |
''')
|
85 |
with gr.Row():
|
86 |
with gr.Column():
|
87 |
with gr.Row():
|
88 |
+
driving_video = gr.Video(label='目标视频',
|
89 |
format="mp4")
|
90 |
|
91 |
with gr.Row():
|
|
|
95 |
for path in paths])
|
96 |
|
97 |
with gr.Box():
|
98 |
+
gr.Markdown('''## 第3步 (基于视频生成动态图片)
|
99 |
+
- 点击 **开始** 按钮. (注意: 由于是在CPU上运行, 生成最终结果需要花费大约3分钟.)
|
100 |
''')
|
101 |
with gr.Row():
|
102 |
with gr.Column():
|
103 |
with gr.Row():
|
104 |
+
generate_button = gr.Button('开始')
|
105 |
|
106 |
with gr.Column():
|
107 |
+
result = gr.Video(type="file", label="输出")
|
108 |
gr.Markdown(FOOTER)
|
109 |
generate_button.click(fn=inference,
|
110 |
inputs=[
|