Spaces:
Running
Running
victorisgeek
commited on
Commit
•
cf2e2eb
1
Parent(s):
f28c5f8
Update app.py
Browse files
app.py
CHANGED
@@ -41,34 +41,34 @@ def swap_pose(input_path, target_path, use_enhancer, use_sr, scale):
|
|
41 |
def main():
|
42 |
args = parse_args()
|
43 |
|
44 |
-
with gr.Blocks(theme='
|
45 |
gr.Markdown('# 👑 FaceClone')
|
46 |
gr.Markdown('### Deepfake Swap Face and Pose.')
|
47 |
with gr.Tab('🧩 FaceSwapper'):
|
48 |
gr.Markdown(' 🧸 FaceClone:power by Gradio')
|
49 |
-
with gr.Tab('📥
|
50 |
with gr.Row():
|
51 |
with gr.Column():
|
52 |
-
gr.Markdown('🖇️
|
53 |
image_input = gr.Image(type='filepath')
|
54 |
with gr.Row():
|
55 |
with gr.Column():
|
56 |
gr.Markdown(
|
57 |
-
'🎭
|
58 |
dst_face_image = gr.Image(type='filepath')
|
59 |
with gr.Column():
|
60 |
gr.Markdown(
|
61 |
-
'🧑🦳
|
62 |
src_face_image = gr.Image(type='filepath')
|
63 |
|
64 |
with gr.Column():
|
65 |
output_image = gr.Image(type='filepath')
|
66 |
use_enhancer = gr.Checkbox(
|
67 |
-
label="👑
|
68 |
info="🧿Whether use face enhance model.")
|
69 |
with gr.Row():
|
70 |
use_sr = gr.Checkbox(
|
71 |
-
label="🛠️
|
72 |
info="⚒️ Whether use image resolution model.")
|
73 |
scale = gr.Number(
|
74 |
value=1, label='📐image super resolution scale')
|
@@ -78,7 +78,7 @@ def main():
|
|
78 |
label='🧲 face similarity threshold',
|
79 |
minimum=0.0,
|
80 |
maximum=1.0)
|
81 |
-
convert_button = gr.Button('🔍
|
82 |
convert_button.click(fn=swap_face,
|
83 |
inputs=[
|
84 |
image_input, dst_face_image,
|
@@ -86,7 +86,7 @@ def main():
|
|
86 |
use_sr, scale, face_sim_thre
|
87 |
],
|
88 |
outputs=[output_image],
|
89 |
-
api_name='🔎
|
90 |
|
91 |
with gr.Tab('🖥️ Video'):
|
92 |
with gr.Row():
|
@@ -110,10 +110,10 @@ def main():
|
|
110 |
info="📷 Whether use face enhance model.")
|
111 |
with gr.Row():
|
112 |
use_sr = gr.Checkbox(
|
113 |
-
label="🔋 Super
|
114 |
info="🔦Whether use image resolution model.")
|
115 |
scale = gr.Number(
|
116 |
-
value=1, label='🗞️ Super
|
117 |
with gr.Row():
|
118 |
face_sim_thre = gr.Number(
|
119 |
value=0.6,
|
@@ -128,7 +128,7 @@ def main():
|
|
128 |
use_sr, scale, face_sim_thre
|
129 |
],
|
130 |
outputs=[output_video],
|
131 |
-
api_name='💽
|
132 |
|
133 |
with gr.Tab('🪩 PoseSwapper'):
|
134 |
gr.Markdown(' 🧸FaceClone:Deepfake power by Gradio')
|
@@ -150,7 +150,7 @@ def main():
|
|
150 |
label="🛠️ Super Resolution",
|
151 |
info="⌛Whether use image resolution model.")
|
152 |
scale = gr.Number(
|
153 |
-
value=1, label='📸
|
154 |
convert_button = gr.Button('🎯 Swap')
|
155 |
convert_button.click(fn=swap_pose,
|
156 |
inputs=[
|
@@ -158,7 +158,7 @@ def main():
|
|
158 |
use_enhancer, use_sr, scale
|
159 |
],
|
160 |
outputs=[output_image],
|
161 |
-
api_name='🎭
|
162 |
|
163 |
# with gr.Tab('Video'):
|
164 |
# with gr.Row():
|
|
|
41 |
def main():
|
42 |
args = parse_args()
|
43 |
|
44 |
+
with gr.Blocks(theme='ysharma/huggingface@=0.0.4') as web_ui:
|
45 |
gr.Markdown('# 👑 FaceClone')
|
46 |
gr.Markdown('### Deepfake Swap Face and Pose.')
|
47 |
with gr.Tab('🧩 FaceSwapper'):
|
48 |
gr.Markdown(' 🧸 FaceClone:power by Gradio')
|
49 |
+
with gr.Tab('📥 Face'):
|
50 |
with gr.Row():
|
51 |
with gr.Column():
|
52 |
+
gr.Markdown('🖇️ Source Face to be swapped')
|
53 |
image_input = gr.Image(type='filepath')
|
54 |
with gr.Row():
|
55 |
with gr.Column():
|
56 |
gr.Markdown(
|
57 |
+
'🎭 Target source included with Face')
|
58 |
dst_face_image = gr.Image(type='filepath')
|
59 |
with gr.Column():
|
60 |
gr.Markdown(
|
61 |
+
'🧑🦳 Source Face to Replace Target Face')
|
62 |
src_face_image = gr.Image(type='filepath')
|
63 |
|
64 |
with gr.Column():
|
65 |
output_image = gr.Image(type='filepath')
|
66 |
use_enhancer = gr.Checkbox(
|
67 |
+
label="👑 Face Enhance",
|
68 |
info="🧿Whether use face enhance model.")
|
69 |
with gr.Row():
|
70 |
use_sr = gr.Checkbox(
|
71 |
+
label="🛠️ Super resolution",
|
72 |
info="⚒️ Whether use image resolution model.")
|
73 |
scale = gr.Number(
|
74 |
value=1, label='📐image super resolution scale')
|
|
|
78 |
label='🧲 face similarity threshold',
|
79 |
minimum=0.0,
|
80 |
maximum=1.0)
|
81 |
+
convert_button = gr.Button('🔍Swap')
|
82 |
convert_button.click(fn=swap_face,
|
83 |
inputs=[
|
84 |
image_input, dst_face_image,
|
|
|
86 |
use_sr, scale, face_sim_thre
|
87 |
],
|
88 |
outputs=[output_image],
|
89 |
+
api_name='🔎Image swap')
|
90 |
|
91 |
with gr.Tab('🖥️ Video'):
|
92 |
with gr.Row():
|
|
|
110 |
info="📷 Whether use face enhance model.")
|
111 |
with gr.Row():
|
112 |
use_sr = gr.Checkbox(
|
113 |
+
label="🔋 Super Resolution",
|
114 |
info="🔦Whether use image resolution model.")
|
115 |
scale = gr.Number(
|
116 |
+
value=1, label='🗞️ Super Resolution Image')
|
117 |
with gr.Row():
|
118 |
face_sim_thre = gr.Number(
|
119 |
value=0.6,
|
|
|
128 |
use_sr, scale, face_sim_thre
|
129 |
],
|
130 |
outputs=[output_video],
|
131 |
+
api_name='💽 Video Swap 💽')
|
132 |
|
133 |
with gr.Tab('🪩 PoseSwapper'):
|
134 |
gr.Markdown(' 🧸FaceClone:Deepfake power by Gradio')
|
|
|
150 |
label="🛠️ Super Resolution",
|
151 |
info="⌛Whether use image resolution model.")
|
152 |
scale = gr.Number(
|
153 |
+
value=1, label='📸 Super resolution scale')
|
154 |
convert_button = gr.Button('🎯 Swap')
|
155 |
convert_button.click(fn=swap_pose,
|
156 |
inputs=[
|
|
|
158 |
use_enhancer, use_sr, scale
|
159 |
],
|
160 |
outputs=[output_image],
|
161 |
+
api_name='🎭 Image slSwap 🎭')
|
162 |
|
163 |
# with gr.Tab('Video'):
|
164 |
# with gr.Row():
|