veronhii commited on
Commit
23ec869
·
1 Parent(s): d995000

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -5
app.py CHANGED
@@ -21,12 +21,8 @@ def predict_fn(img):
21
  x = np.array(img_data)
22
  x = np.expand_dims(x, axis=0)
23
  temp = model.predict(x)
24
-
25
- idx = np.argsort(np.squeeze(temp))[::-1]
26
- top3_value = np.asarray([temp[0][i]] for i in idx[0:3])
27
- top3_idx = idx[0:3]
28
 
29
- return {CLASS_LABEL[i]:str(v) for i, v in zip(top3_idx,top3_value)}
30
 
31
 
32
  model = tf.keras.models.load_model("model.h5")
 
21
  x = np.array(img_data)
22
  x = np.expand_dims(x, axis=0)
23
  temp = model.predict(x)
 
 
 
 
24
 
25
+ return CLASS_LABEL[temp]
26
 
27
 
28
  model = tf.keras.models.load_model("model.h5")