yhzhai commited on
Commit
7eb32fd
1 Parent(s): 2e87a2a

add demo description

Browse files
Files changed (1) hide show
  1. app.py +33 -9
app.py CHANGED
@@ -76,12 +76,36 @@ def _get_model(config_path="configs/final.yaml", ckpt_path="tmp/checkpoint.pt"):
76
  return opt, model
77
 
78
 
79
- iface = gr.Interface(
80
- fn=greet,
81
- title="WSCL: Image Manipulation Detection",
82
- inputs=gr.Image(),
83
- outputs=["image", "text"],
84
- examples=[["demo/au.jpg"], ["demo/tp.jpg"]],
85
- cache_examples=True,
86
- )
87
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  return opt, model
77
 
78
 
79
+ with gr.Blocks(css=".output-image, .input-image, .image-preview {height: 400px !important}") as demo:
80
+ # gr.Markdown("## Image Manipulation Detection and Localization")
81
+ gr.HTML("""
82
+ <div style="text-align: center; margin-bottom: 20px;">
83
+ <h1>WSCL: Image Manipulation Detection</h1>
84
+ <h4>This demo detects and localizes image manipulations. For best performance, please use image of size smaller than 1024x1024.</h4>
85
+ <div style="display: flex; justify-content: center; align-items: center; text-align: center;">
86
+ <a href="https://arxiv.org/abs/2309.01246" style="margin-right: 5px;"><img src="https://img.shields.io/badge/Arxiv-2309.01246-red"></a>
87
+ <a href="https://github.com/yhZhai/WSCL" style="margin-left: 5px;"><img src='https://img.shields.io/badge/Github-WSCL-blue'></a>
88
+ </div>
89
+ </div>
90
+ """)
91
+
92
+ with gr.Row():
93
+ with gr.Column():
94
+ iface = gr.Interface(
95
+ fn=greet,
96
+ # title="WSCL: Image Manipulation Detection",
97
+ inputs=gr.Image(),
98
+ outputs=["image", "text"],
99
+ examples=[["demo/au.jpg"], ["demo/tp.jpg"]],
100
+ cache_examples=True,
101
+ )
102
+
103
+ # iface = gr.Interface(
104
+ # fn=greet,
105
+ # title="WSCL: Image Manipulation Detection",
106
+ # inputs=gr.Image(),
107
+ # outputs=["image", "text"],
108
+ # examples=[["demo/au.jpg"], ["demo/tp.jpg"]],
109
+ # cache_examples=True,
110
+ # )
111
+ demo.launch()