yuragoithf commited on
Commit
95eabb4
·
verified ·
1 Parent(s): 6aff23a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -47,7 +47,7 @@ def predict_class(image):
47
  img = tf.cast(image, tf.float32)
48
  img = tf.image.resize(img, [input_shape[0], input_shape[1]])
49
  img = tf.expand_dims(img, axis=0)
50
- prediction = model.predict(img)[0]
51
  return prediction
52
 
53
  # UI Design for single class output
@@ -59,7 +59,7 @@ def predict_class(image):
59
 
60
  # UI Design for multy class output
61
  def classify_image(image):
62
- results = predict_class(image)
63
  output = {labels.get(i): float(results[i]) for i in range(len(results))}
64
  result = output if max(output.values()) >=0.98 else {"NO_CIFAR10_CLASS": 1}
65
  return result[0]
 
47
  img = tf.cast(image, tf.float32)
48
  img = tf.image.resize(img, [input_shape[0], input_shape[1]])
49
  img = tf.expand_dims(img, axis=0)
50
+ prediction = model.predict(img)
51
  return prediction
52
 
53
  # UI Design for single class output
 
59
 
60
  # UI Design for multy class output
61
  def classify_image(image):
62
+ results = predict_class(image)[0]
63
  output = {labels.get(i): float(results[i]) for i in range(len(results))}
64
  result = output if max(output.values()) >=0.98 else {"NO_CIFAR10_CLASS": 1}
65
  return result[0]