Spaces:
Sleeping
Sleeping
Update inference.py
Browse files- inference.py +2 -5
inference.py
CHANGED
@@ -53,10 +53,6 @@ def prediction(image):
|
|
53 |
true_words = true_words[1:-1]
|
54 |
true_confidence_scores = true_confidence_scores[1:-1]
|
55 |
|
56 |
-
#for i, j in enumerate(true_confidence_scores):
|
57 |
-
# if j < 0.5:
|
58 |
-
# true_predictions[i] = "O"
|
59 |
-
|
60 |
d = {}
|
61 |
for id, i in enumerate(true_predictions):
|
62 |
#rimuovo i prefissi
|
@@ -66,7 +62,8 @@ def prediction(image):
|
|
66 |
d[i] = true_words[id]
|
67 |
else:
|
68 |
d[i] = d[i] + ", " + true_words[id]
|
69 |
-
|
|
|
70 |
|
71 |
if "O" in d: d.pop("O")
|
72 |
|
|
|
53 |
true_words = true_words[1:-1]
|
54 |
true_confidence_scores = true_confidence_scores[1:-1]
|
55 |
|
|
|
|
|
|
|
|
|
56 |
d = {}
|
57 |
for id, i in enumerate(true_predictions):
|
58 |
#rimuovo i prefissi
|
|
|
62 |
d[i] = true_words[id]
|
63 |
else:
|
64 |
d[i] = d[i] + ", " + true_words[id]
|
65 |
+
|
66 |
+
#d = {k: v.strip() for (k, v) in d.items()}
|
67 |
|
68 |
if "O" in d: d.pop("O")
|
69 |
|