Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,12 @@ def classify_image(inp):
|
|
21 |
prediction = model.predict(inp)
|
22 |
#label = dict((v,k) for k,v in labels.items())
|
23 |
predicted_class_indices=np.argmax(prediction,axis=1)
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
|
27 |
|
|
|
21 |
prediction = model.predict(inp)
|
22 |
#label = dict((v,k) for k,v in labels.items())
|
23 |
predicted_class_indices=np.argmax(prediction,axis=1)
|
24 |
+
result = {}
|
25 |
+
for i in range(len(predicted_class_indices)):
|
26 |
+
if predicted_class_indices[i] < NUM_CLASSES:
|
27 |
+
result[labels[predicted_class_indices[i]]]= float(predicted_class_indices[i])
|
28 |
+
return result
|
29 |
+
|
30 |
|
31 |
|
32 |
|