Spaces:
Runtime error
Runtime error
Martijn van Beers
commited on
Commit
•
c081dbe
1
Parent(s):
d150409
Fix variable naming
Browse filesGiving the input and output textbox variables the same name is obviously
going to cause problems, so stop doing that
app.py
CHANGED
@@ -191,7 +191,7 @@ with gr.Blocks(title="Entity Grounding explainability using CLIP") as iface_NER:
|
|
191 |
with gr.Row():
|
192 |
with gr.Column() as inputs:
|
193 |
img = gr.Image(type='pil', label="Original Image")
|
194 |
-
|
195 |
ner_model = gr.Dropdown(label="CLIP Model", choices=['ViT-B/16', 'ViT-B/32', 'ViT-L/14'], value="ViT-B/32")
|
196 |
ner_layer = gr.Slider(label="Vision start layer", minimum=0, maximum=11, step=1, value=11)
|
197 |
submit = gr.Button("Submit")
|
@@ -207,7 +207,7 @@ with gr.Blocks(title="Entity Grounding explainability using CLIP") as iface_NER:
|
|
207 |
inputs=[img, text],
|
208 |
)
|
209 |
ner_model.change(update_slider, inputs=ner_model, outputs=ner_layer)
|
210 |
-
submit.click(run_demo, inputs=[img,
|
211 |
|
212 |
demo_tabs = gr.TabbedInterface([iface_default, iface_NER], ["Default", "Entities"])
|
213 |
with demo_tabs:
|
|
|
191 |
with gr.Row():
|
192 |
with gr.Column() as inputs:
|
193 |
img = gr.Image(type='pil', label="Original Image")
|
194 |
+
intext = gr.components.Textbox(label="Descriptive text")
|
195 |
ner_model = gr.Dropdown(label="CLIP Model", choices=['ViT-B/16', 'ViT-B/32', 'ViT-L/14'], value="ViT-B/32")
|
196 |
ner_layer = gr.Slider(label="Vision start layer", minimum=0, maximum=11, step=1, value=11)
|
197 |
submit = gr.Button("Submit")
|
|
|
207 |
inputs=[img, text],
|
208 |
)
|
209 |
ner_model.change(update_slider, inputs=ner_model, outputs=ner_layer)
|
210 |
+
submit.click(run_demo, inputs=[img, intext, ner_model, ner_layer], outputs=[text, gallery])
|
211 |
|
212 |
demo_tabs = gr.TabbedInterface([iface_default, iface_NER], ["Default", "Entities"])
|
213 |
with demo_tabs:
|