Spaces:
Sleeping
Sleeping
sergiopaniego
commited on
Commit
•
487ba13
1
Parent(s):
13fc488
Updated app
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def get_output_figure(pil_img, scores, labels, boxes):
|
|
32 |
|
33 |
return plt.gcf()
|
34 |
|
35 |
-
def get_output_attn_figure(image, encoding, results):
|
36 |
# keep only predictions of queries with +0.9 condifence (excluding no-object class)
|
37 |
probas = outputs.logits.softmax(-1)[0, :, :-1]
|
38 |
keep = probas.max(-1).values > 0.9
|
@@ -103,7 +103,7 @@ def detect(image):
|
|
103 |
buf.seek(0)
|
104 |
output_pil_img = Image.open(buf)
|
105 |
|
106 |
-
output_figure_attn = get_output_attn_figure(image, encoding, results)
|
107 |
|
108 |
buf = io.BytesIO()
|
109 |
output_figure_attn.savefig(buf, bbox_inches='tight')
|
|
|
32 |
|
33 |
return plt.gcf()
|
34 |
|
35 |
+
def get_output_attn_figure(image, encoding, results, outputs):
|
36 |
# keep only predictions of queries with +0.9 condifence (excluding no-object class)
|
37 |
probas = outputs.logits.softmax(-1)[0, :, :-1]
|
38 |
keep = probas.max(-1).values > 0.9
|
|
|
103 |
buf.seek(0)
|
104 |
output_pil_img = Image.open(buf)
|
105 |
|
106 |
+
output_figure_attn = get_output_attn_figure(image, encoding, results, outputs)
|
107 |
|
108 |
buf = io.BytesIO()
|
109 |
output_figure_attn.savefig(buf, bbox_inches='tight')
|