Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ from sklearn.preprocessing import MinMaxScaler
|
|
| 6 |
from keras.models import Model
|
| 7 |
from keras.layers import Conv2D
|
| 8 |
import cv2
|
|
|
|
| 9 |
|
| 10 |
model = keras.models.load_model("model.keras")
|
| 11 |
|
|
@@ -43,7 +44,9 @@ if uploaded_img is not None:
|
|
| 43 |
#img_norm = img_resized.astype('float32') / 255.0
|
| 44 |
input_img = img_resized.reshape(1,28,28,1)
|
| 45 |
|
| 46 |
-
model.predict(np.zeros((1, 28, 28, 1), dtype=np.float32))
|
|
|
|
|
|
|
| 47 |
|
| 48 |
st.image(img_resized, caption="Uploaded Image (Resized to 28x28)", use_container_width =True, channels="GRAY")
|
| 49 |
|
|
|
|
| 6 |
from keras.models import Model
|
| 7 |
from keras.layers import Conv2D
|
| 8 |
import cv2
|
| 9 |
+
import tensorflow as tf
|
| 10 |
|
| 11 |
model = keras.models.load_model("model.keras")
|
| 12 |
|
|
|
|
| 44 |
#img_norm = img_resized.astype('float32') / 255.0
|
| 45 |
input_img = img_resized.reshape(1,28,28,1)
|
| 46 |
|
| 47 |
+
#model.predict(np.zeros((1, 28, 28, 1), dtype=np.float32))
|
| 48 |
+
dummy_input = tf.zeros((1, 28, 28, 1))
|
| 49 |
+
_ = model(dummy_input)
|
| 50 |
|
| 51 |
st.image(img_resized, caption="Uploaded Image (Resized to 28x28)", use_container_width =True, channels="GRAY")
|
| 52 |
|