fantos commited on
Commit
da8c450
·
verified ·
1 Parent(s): 6725799

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -16,28 +16,29 @@ footer {
16
  """
17
 
18
  with gr.Blocks(css=css) as app:
19
-
20
  gr.Markdown("[![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Ffantos-watermark.hf.space&countColor=%23263759)](https://visitorbadge.io/status?path=https%3A%2F%2Ffantos-watermark.hf.space)")
21
-
22
 
23
  with gr.Tab("Add Watermark"):
24
- cho = gr.Radio(choices=["stegan","pnginfo"],value="stegan")
25
  with gr.Row():
26
-
27
  with gr.Column():
28
- inp_im = gr.Image(label="Input Image",type="filepath")
29
  inp_mark = gr.Textbox(label="Watermark")
30
- mark_btn = gr.Button()
31
  msg_box = gr.Textbox(label="System Message")
32
  with gr.Column():
33
  out_im = gr.Image(label="Watermarked Image")
 
34
  with gr.Tab("Detect Watermark"):
35
  with gr.Row():
36
  with gr.Column():
37
- det_im = gr.Image(label="Watermarked Image",type="filepath")
38
  det_btn = gr.Button("Detect")
39
  with gr.Column():
40
- det_msg = gr.Textbox(label="Detected Watermark",lines=6, max_lines=50)
41
- mark_btn.click(choose_encode,[inp_im,inp_mark,cho],[out_im,msg_box])
42
- det_btn.click(utils.decode,[det_im],det_msg)
 
 
43
  app.launch()
 
16
  """
17
 
18
  with gr.Blocks(css=css) as app:
19
+ gr.Markdown("# Image Watermarking Tool")
20
  gr.Markdown("[![Visitors](https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Ffantos-watermark.hf.space&countColor=%23263759)](https://visitorbadge.io/status?path=https%3A%2F%2Ffantos-watermark.hf.space)")
 
21
 
22
  with gr.Tab("Add Watermark"):
23
+ cho = gr.Radio(choices=["stegan", "pnginfo"], value="stegan")
24
  with gr.Row():
 
25
  with gr.Column():
26
+ inp_im = gr.Image(label="Input Image", type="filepath")
27
  inp_mark = gr.Textbox(label="Watermark")
28
+ mark_btn = gr.Button("Add Watermark")
29
  msg_box = gr.Textbox(label="System Message")
30
  with gr.Column():
31
  out_im = gr.Image(label="Watermarked Image")
32
+
33
  with gr.Tab("Detect Watermark"):
34
  with gr.Row():
35
  with gr.Column():
36
+ det_im = gr.Image(label="Watermarked Image", type="filepath")
37
  det_btn = gr.Button("Detect")
38
  with gr.Column():
39
+ det_msg = gr.Textbox(label="Detected Watermark", lines=6, max_lines=50)
40
+
41
+ mark_btn.click(choose_encode, [inp_im, inp_mark, cho], [out_im, msg_box])
42
+ det_btn.click(utils.decode, [det_im], det_msg)
43
+
44
  app.launch()