ravikagitha commited on
Commit
31f6ede
·
verified ·
1 Parent(s): 86ffda1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3,12 +3,12 @@ import tensorflow as tf
3
  import numpy as np
4
 
5
  # Load the model
6
- model = tf.keras.saving.load_model('mnist_trained_model_2(acc-97%).h5')
7
 
8
  # Classification prediction function
9
  labels = [0,1,2,3,4,5,6,7,8,9]
10
  def classify_image(image):
11
- prediction = model.predict(image.reshape(-1,784)/255).flatten()
12
  confidences = {labels[i]: float(prediction[i]) for i in range(10)}
13
  return confidences
14
 
 
3
  import numpy as np
4
 
5
  # Load the model
6
+ model = tf.keras.saving.load_model('mnist_model.h5')
7
 
8
  # Classification prediction function
9
  labels = [0,1,2,3,4,5,6,7,8,9]
10
  def classify_image(image):
11
+ prediction = model.predict(image.reshape(28,28))
12
  confidences = {labels[i]: float(prediction[i]) for i in range(10)}
13
  return confidences
14