Spaces:
Sleeping
Sleeping
Vivien Chappelier
commited on
Commit
•
e9d8edd
1
Parent(s):
4dfce87
not conviced with the editor, confusing and slow to process on low bitrate connection
Browse files
app.py
CHANGED
@@ -51,12 +51,13 @@ class BZHStableSignatureDemo(object):
|
|
51 |
self.pipe.vae.load_state_dict(sd, strict=False)
|
52 |
|
53 |
output = self.pipe(prompt, num_inference_steps=4, guidance_scale=0.0, output_type="pil")
|
54 |
-
return { "background": output.images[0], "layers": [], "composite": None }
|
55 |
|
56 |
-
def attack_detect(self,
|
57 |
|
58 |
-
img = img_edit["composite"]
|
59 |
img = img.convert("RGB")
|
|
|
60 |
# attack
|
61 |
if downscale != 1:
|
62 |
size = img.size
|
@@ -116,7 +117,7 @@ def interface():
|
|
116 |
with gr.Row():
|
117 |
btn1 = gr.Button("Generate")
|
118 |
with gr.Row():
|
119 |
-
watermarked_image = gr.
|
120 |
with gr.Column():
|
121 |
downscale = gr.Slider(1, 3, value=1, step=0.1, label="Downscale ratio")
|
122 |
saturation = gr.Slider(0, 2, value=1, step=0.1, label="Color saturation")
|
|
|
51 |
self.pipe.vae.load_state_dict(sd, strict=False)
|
52 |
|
53 |
output = self.pipe(prompt, num_inference_steps=4, guidance_scale=0.0, output_type="pil")
|
54 |
+
return output.images[0] #{ "background": output.images[0], "layers": [], "composite": None }
|
55 |
|
56 |
+
def attack_detect(self, img, jpeg_compression, downscale, saturation):
|
57 |
|
58 |
+
#img = img_edit["composite"]
|
59 |
img = img.convert("RGB")
|
60 |
+
|
61 |
# attack
|
62 |
if downscale != 1:
|
63 |
size = img.size
|
|
|
117 |
with gr.Row():
|
118 |
btn1 = gr.Button("Generate")
|
119 |
with gr.Row():
|
120 |
+
watermarked_image = gr.Image(type="pil", width=512, height=512)
|
121 |
with gr.Column():
|
122 |
downscale = gr.Slider(1, 3, value=1, step=0.1, label="Downscale ratio")
|
123 |
saturation = gr.Slider(0, 2, value=1, step=0.1, label="Color saturation")
|