Spaces:
Running
Running
narugo1992
commited on
Commit
•
d5f3b25
1
Parent(s):
aaca0d9
dev(narugo): optimize GUI
Browse files
app.py
CHANGED
@@ -52,16 +52,19 @@ if __name__ == '__main__':
|
|
52 |
with gr.Row():
|
53 |
with gr.Column():
|
54 |
gr_input_image = gr.Image(type='pil', label='Original Image')
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
61 |
|
62 |
with gr.Column():
|
63 |
-
|
64 |
-
|
|
|
65 |
gr_output_image = gr.Image(type='pil', label='Attacked Image')
|
66 |
|
67 |
gr_btn_submit.click(
|
|
|
52 |
with gr.Row():
|
53 |
with gr.Column():
|
54 |
gr_input_image = gr.Image(type='pil', label='Original Image')
|
55 |
+
with gr.Row():
|
56 |
+
gr_attack_target = gr.Radio(['auto', 'ai', 'human'], value='auto', label='Attack Target')
|
57 |
+
gr_steps = gr.Slider(minimum=1, maximum=50, value=20, step=1, label='Steps')
|
58 |
+
with gr.Row():
|
59 |
+
gr_eps = gr.Slider(label="eps (Noise intensity)", minimum=1, maximum=16, step=1, value=1)
|
60 |
+
gr_noise_step_size = gr.Slider(label="Noise step size", minimum=0.001, maximum=16, step=0.001,
|
61 |
+
value=0.136)
|
62 |
+
gr_btn_submit = gr.Button(value='Attack This Image', variant='primary')
|
63 |
|
64 |
with gr.Column():
|
65 |
+
with gr.Row():
|
66 |
+
gr_before_prediction = gr.Label(label='Before Prediction')
|
67 |
+
gr_after_prediction = gr.Label(label='After Prediction')
|
68 |
gr_output_image = gr.Image(type='pil', label='Attacked Image')
|
69 |
|
70 |
gr_btn_submit.click(
|