harshaUwm163 commited on
Commit
b1c22dd
1 Parent(s): 8b190a8

fixed the output dict error

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -47,12 +47,9 @@ def infer(input_image):
47
  image_tensor = read_image(input_image)
48
  print(image_tensor.shape)
49
  predictions = model.predict(np.expand_dims((image_tensor), axis=0))
50
- predictions = np.squeeze(predictions)
51
- predictions = np.argmax(predictions) # , axis=2
52
- predicted_label = class_names[predictions.item()]
53
- return str(predicted_label)
54
 
55
- # return dict(zip(class_names, predictions))
56
 
57
 
58
  # get the inputs
 
47
  image_tensor = read_image(input_image)
48
  print(image_tensor.shape)
49
  predictions = model.predict(np.expand_dims((image_tensor), axis=0))
50
+ predictions = np.squeeze(predictions).astype(float)
 
 
 
51
 
52
+ return dict(zip(class_names, predictions))
53
 
54
 
55
  # get the inputs