Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
def predict(image):
|
2 |
# Convert image to a numpy array
|
3 |
image = np.array(image)
|
|
|
1 |
+
import gradio as gr # Ensure you import gradio correctly
|
2 |
+
import tensorflow as tf
|
3 |
+
import numpy as np
|
4 |
+
|
5 |
+
# Load the Keras model
|
6 |
+
model = tf.keras.models.load_model("denis_mnist_cnn_model.h5")
|
7 |
+
|
8 |
+
# Define a function to preprocess input and make predictions
|
9 |
def predict(image):
|
10 |
# Convert image to a numpy array
|
11 |
image = np.array(image)
|