Spaces:
Running
on
T4
Running
on
T4
FantasticGNU
commited on
Commit
•
1960e94
1
Parent(s):
95d541f
Update app.py
Browse files
app.py
CHANGED
@@ -166,35 +166,35 @@ def reset_user_input():
|
|
166 |
def reset_state():
|
167 |
return gr.update(value=''), None, None, [], [], [], PILImage.open('ffffff.png')
|
168 |
|
169 |
-
|
170 |
|
171 |
with gr.Blocks() as demo:
|
172 |
gr.HTML("""<h1 align="center">Demo of AnomalyGPT</h1>""")
|
173 |
|
174 |
with gr.Row():
|
175 |
with gr.Column(scale=1):
|
176 |
-
with gr.Row(
|
177 |
image_path = gr.Image(type="filepath", label="Query Image", value='crack_concrete.jpg')
|
178 |
-
with gr.Row(
|
179 |
normal_img_path = gr.Image(type="filepath", label="Normal Image (optional)", value=None)
|
180 |
-
with gr.Row(
|
181 |
-
|
182 |
-
with gr.Row(
|
|
|
183 |
top_p = gr.Slider(0, 1, value=0.01, step=0.01, label="Top P", interactive=True)
|
184 |
-
with gr.Row(scale=1):
|
185 |
temperature = gr.Slider(0, 1, value=1.0, step=0.01, label="Temperature", interactive=True)
|
186 |
|
187 |
|
188 |
with gr.Column(scale=3):
|
189 |
-
with gr.Row(
|
190 |
with gr.Column(scale=6):
|
191 |
chatbot = gr.Chatbot().style(height=440)
|
192 |
with gr.Column(scale=4):
|
193 |
# gr.Image(output)
|
194 |
image_output = gr.Image(interactive=False, label="Localization Output", type='pil',value=PILImage.open('ffffff.png'))
|
195 |
-
with gr.Row(
|
196 |
user_input = gr.Textbox(show_label=False, placeholder="Input...", lines=11).style(container=False)
|
197 |
-
with gr.Row(
|
198 |
with gr.Column(scale=2):
|
199 |
submitBtn = gr.Button("Submit", variant="primary")
|
200 |
with gr.Column(scale=1):
|
|
|
166 |
def reset_state():
|
167 |
return gr.update(value=''), None, None, [], [], [], PILImage.open('ffffff.png')
|
168 |
|
169 |
+
examples = ['crack_concrete.jpg', 'hazelnut_cut.png', 'carpet_normal.jpg']
|
170 |
|
171 |
with gr.Blocks() as demo:
|
172 |
gr.HTML("""<h1 align="center">Demo of AnomalyGPT</h1>""")
|
173 |
|
174 |
with gr.Row():
|
175 |
with gr.Column(scale=1):
|
176 |
+
with gr.Row():
|
177 |
image_path = gr.Image(type="filepath", label="Query Image", value='crack_concrete.jpg')
|
178 |
+
with gr.Row():
|
179 |
normal_img_path = gr.Image(type="filepath", label="Normal Image (optional)", value=None)
|
180 |
+
with gr.Row():
|
181 |
+
gr.Examples(examples=examples, inputs=[image_path])
|
182 |
+
with gr.Row():
|
183 |
+
max_length = gr.Slider(0, 512, value=512, step=1.0, label="Max length", interactive=True)
|
184 |
top_p = gr.Slider(0, 1, value=0.01, step=0.01, label="Top P", interactive=True)
|
|
|
185 |
temperature = gr.Slider(0, 1, value=1.0, step=0.01, label="Temperature", interactive=True)
|
186 |
|
187 |
|
188 |
with gr.Column(scale=3):
|
189 |
+
with gr.Row():
|
190 |
with gr.Column(scale=6):
|
191 |
chatbot = gr.Chatbot().style(height=440)
|
192 |
with gr.Column(scale=4):
|
193 |
# gr.Image(output)
|
194 |
image_output = gr.Image(interactive=False, label="Localization Output", type='pil',value=PILImage.open('ffffff.png'))
|
195 |
+
with gr.Row():
|
196 |
user_input = gr.Textbox(show_label=False, placeholder="Input...", lines=11).style(container=False)
|
197 |
+
with gr.Row():
|
198 |
with gr.Column(scale=2):
|
199 |
submitBtn = gr.Button("Submit", variant="primary")
|
200 |
with gr.Column(scale=1):
|