Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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('
|
| 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(
|
| 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 |
|