Sa-m commited on
Commit
0cfd3a9
1 Parent(s): 24c337c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
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
- return {labels[i]: float(predicted_class_indices[i]) for i in range(NUM_CLASSES)}
 
 
 
 
 
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