noumanjavaid commited on
Commit
d2c9cf6
·
verified ·
1 Parent(s): 6d6909d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -180,7 +180,7 @@ def detect_watermark(det_im):
180
  # Gradio app
181
  with gr.Blocks() as app:
182
  with gr.Tab("Add Watermark"):
183
- cho = gr.Radio(choices=["stegan", ""] ,value="stenography", label="Watermark Method")
184
  with gr.Row():
185
  with gr.Column():
186
  inp_im = gr.Image(label="Input Image", type="filepath")
@@ -203,6 +203,23 @@ with gr.Blocks() as app:
203
 
204
  det_btn.click(detect_watermark, inputs=[det_im], outputs=[det_msg])
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  if __name__ == "__main__":
207
  app.launch(
208
  show_api=False
 
180
  # Gradio app
181
  with gr.Blocks() as app:
182
  with gr.Tab("Add Watermark"):
183
+ cho = gr.Radio(choices=["stegan", "pnginfo"], value="stegan", label="Watermark Method") # Correct default value
184
  with gr.Row():
185
  with gr.Column():
186
  inp_im = gr.Image(label="Input Image", type="filepath")
 
203
 
204
  det_btn.click(detect_watermark, inputs=[det_im], outputs=[det_msg])
205
 
206
+ if __name__ == "__main__":
207
+ app.launch(
208
+ show_api=False
209
+ )
210
+
211
+ mark_btn.click(choose_encode, inputs=[inp_im, inp_mark, cho], outputs=[out_im, msg_box, file_output])
212
+
213
+ with gr.Tab("Detect Watermark"):
214
+ with gr.Row():
215
+ with gr.Column():
216
+ det_im = gr.Image(label="Watermarked Image", type="filepath")
217
+ det_btn = gr.Button("Detect Watermark")
218
+ with gr.Column():
219
+ det_msg = gr.Textbox(label="Detected Watermark", lines=6)
220
+
221
+ det_btn.click(detect_watermark, inputs=[det_im], outputs=[det_msg])
222
+
223
  if __name__ == "__main__":
224
  app.launch(
225
  show_api=False