felixrosberg commited on
Commit
9dd5afd
β€’
1 Parent(s): 900034d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -27
app.py CHANGED
@@ -253,33 +253,33 @@ Demo is based of recent research from my Ph.D work. Results expects to be publis
253
  """
254
 
255
  with gr.Blocks(theme=theme) as blk_demo:
256
- gr.Markdown(value="# Face Dancer")
257
- with gr.Row():
258
- with gr.Column():
259
- with gr.Box():
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():
281
- with gr.Box():
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,
 
253
  """
254
 
255
  with gr.Blocks(theme=theme) as blk_demo:
256
+ gr.Markdown(value="# Face Dancer")
257
+ with gr.Row():
258
+ with gr.Column():
259
+ with gr.Box():
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():
281
+ with gr.Box():
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,