SecureWatermark / app.py
Omnibus's picture
Update app.py
29136da
raw
history blame
924 Bytes
import gradio as gr
import utils
with gr.Blocks() as app:
with gr.Tab("Add Watermark"):
with gr.Row():
with gr.Column():
inp_im = gr.Image(label="Input Image",type="filepath")
inp_mark = gr.Textbox(label="Watermark")
mark_btn = gr.Button()
msg_box = gr.Textbox(label="System Message")
with gr.Column():
out_im = gr.Image(label="Watermarked Image")
with gr.Tab("Detect Watermark"):
with gr.Row():
with gr.Column():
det_im = gr.Image(label="Watermarked Image",type="filepath")
det_btn = gr.Button("Detect")
with gr.Column():
det_msg = gr.Textbox(label="Detected Watermark",lines=6, max_lines=50)
mark_btn.click(utils.encode,[inp_im,inp_mark],[out_im,msg_box])
det_btn.click(utils.decode,[det_im],det_msg)
app.launch()