Spaces:
Sleeping
Sleeping
patrickramos
commited on
Commit
·
83ffd1d
1
Parent(s):
6fbef6e
Update app.py
Browse files
app.py
CHANGED
@@ -144,6 +144,13 @@ def visualize(input_img, visual_emb_gam_setups, show_scores, show_cbars):
|
|
144 |
|
145 |
return fig
|
146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
demo = gr.Interface(
|
148 |
fn=visualize,
|
149 |
inputs=[
|
@@ -154,6 +161,10 @@ demo = gr.Interface(
|
|
154 |
],
|
155 |
outputs=[
|
156 |
gr.Plot(label='Patch contributions'),
|
157 |
-
]
|
|
|
|
|
|
|
|
|
158 |
)
|
159 |
demo.launch(debug=True)
|
|
|
144 |
|
145 |
return fig
|
146 |
|
147 |
+
description = 'Visualize the patch contributions of [visual Emb-GAMs](https://huggingface.co/models?other=visual%20emb-gam) to class labels.'
|
148 |
+
article = '''An extension of [Emb-GAMs](https://arxiv.org/abs/2209.11799), visual Emb-GAMs classify images by embedding images, taking intermediate representations correponding to different spatial regions, summing these up and predicting a class label from the sum using a GAM.
|
149 |
+
|
150 |
+
The use of a sum of embeddings allows us to visualize which regions of an image contributed positive or negatively to each class score.
|
151 |
+
|
152 |
+
No paper yet, but you can refer to this [tweet](https://twitter.com/patrick_j_ramos/status/1586992857969147904?s=20&t=5-j5gKK0FpZOgzR_9Wdm1g). Also, check out the original [Emb-GAM paper](https://arxiv.org/abs/2209.11799).'''
|
153 |
+
|
154 |
demo = gr.Interface(
|
155 |
fn=visualize,
|
156 |
inputs=[
|
|
|
161 |
],
|
162 |
outputs=[
|
163 |
gr.Plot(label='Patch contributions'),
|
164 |
+
],
|
165 |
+
examples=[[path,setups,False,False] for path in glob.glob('examples/*')],
|
166 |
+
title='Visual Emb-GAM Probing',
|
167 |
+
description=,
|
168 |
+
|
169 |
)
|
170 |
demo.launch(debug=True)
|