Commit
Β·
900034d
1
Parent(s):
2df2511
Update app.py
Browse files
app.py
CHANGED
@@ -260,21 +260,21 @@ with gr.Blocks(theme=theme) as blk_demo:
|
|
260 |
trg_in = gr.Image(type="pil", label='Target').style(height=300)
|
261 |
src_in = gr.Image(type="pil", label='Source').style(height=300)
|
262 |
with gr.Row():
|
263 |
-
|
264 |
with gr.Row():
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
gr.Examples(examples=[["assets/musk.jpg"], ["assets/rick.jpg"]],
|
279 |
inputs=trg_in)
|
280 |
with gr.Column():
|
@@ -282,7 +282,6 @@ with gr.Blocks(theme=theme) as blk_demo:
|
|
282 |
ano_out = gr.Image(type="pil", label='Output').style(height=300)
|
283 |
|
284 |
b1.click(run_inference, inputs=[trg_in, src_in, def_in, mrg_in, chk_in], outputs=[ano_out])
|
285 |
-
|
286 |
"""iface = gradio.Interface(run_inference,
|
287 |
[gradio.Image(shape=None, type="pil", label='Target'),
|
288 |
gradio.Image(shape=None, type="pil", label='Source'),
|
|
|
260 |
trg_in = gr.Image(type="pil", label='Target').style(height=300)
|
261 |
src_in = gr.Image(type="pil", label='Source').style(height=300)
|
262 |
with gr.Row():
|
263 |
+
b1 = gr.Button("Face Swap")
|
264 |
with gr.Row():
|
265 |
+
with gr.Accordion("Options", open=False):
|
266 |
+
chk_in = gr.CheckboxGroup(["Compare",
|
267 |
+
"Anonymize",
|
268 |
+
"Reconstruction Attack",
|
269 |
+
"Adversarial Defense"],
|
270 |
+
label="Mode",
|
271 |
+
info="Anonymize mode? "
|
272 |
+
"Apply reconstruction attack? "
|
273 |
+
"Apply defense against reconstruction attack?")
|
274 |
+
def_in = gr.Slider(0, 100, value=100,
|
275 |
+
label='Anonymization ratio (%)')
|
276 |
+
mrg_in = gr.Slider(0, 100, value=100,
|
277 |
+
label='Adversarial defense ratio (%)')
|
278 |
gr.Examples(examples=[["assets/musk.jpg"], ["assets/rick.jpg"]],
|
279 |
inputs=trg_in)
|
280 |
with gr.Column():
|
|
|
282 |
ano_out = gr.Image(type="pil", label='Output').style(height=300)
|
283 |
|
284 |
b1.click(run_inference, inputs=[trg_in, src_in, def_in, mrg_in, chk_in], outputs=[ano_out])
|
|
|
285 |
"""iface = gradio.Interface(run_inference,
|
286 |
[gradio.Image(shape=None, type="pil", label='Target'),
|
287 |
gradio.Image(shape=None, type="pil", label='Source'),
|