Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,10 +38,8 @@ def predict_image(image, model_name):
|
|
38 |
|
39 |
pred = classifier.predict_image(img=image)
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
acc = dict((label2id[i], "%.2f" % 100.0 if label2id[i].lower() == pred.lower() else 0.0) for i in range(len(label2id)))
|
44 |
-
print(acc)
|
45 |
return acc
|
46 |
# return pred
|
47 |
|
|
|
38 |
|
39 |
pred = classifier.predict_image(img=image)
|
40 |
|
41 |
+
acc = dict((labels[i], 0.0) for i in range(len(labels)))
|
42 |
+
acc[pred] = 100.0
|
|
|
|
|
43 |
return acc
|
44 |
# return pred
|
45 |
|