Spaces:
Sleeping
Sleeping
Update cord_inference.py
Browse files- cord_inference.py +2 -4
cord_inference.py
CHANGED
@@ -55,14 +55,12 @@ def prediction(image):
|
|
55 |
true_words = true_words[1:-1]
|
56 |
true_confidence_scores = true_confidence_scores[1:-1]
|
57 |
|
58 |
-
l_words = []
|
59 |
-
|
60 |
d = {}
|
61 |
for id, i in enumerate(true_predictions):
|
62 |
if i not in d.keys():
|
63 |
-
d[i] =
|
64 |
else:
|
65 |
-
d[i] = d[i] + ", " +
|
66 |
d = {k: v.strip() for (k, v) in d.items()}
|
67 |
|
68 |
# TODO:process the json
|
|
|
55 |
true_words = true_words[1:-1]
|
56 |
true_confidence_scores = true_confidence_scores[1:-1]
|
57 |
|
|
|
|
|
58 |
d = {}
|
59 |
for id, i in enumerate(true_predictions):
|
60 |
if i not in d.keys():
|
61 |
+
d[i] = true_words[id]
|
62 |
else:
|
63 |
+
d[i] = d[i] + ", " + true_words[id]
|
64 |
d = {k: v.strip() for (k, v) in d.items()}
|
65 |
|
66 |
# TODO:process the json
|