anamjafar6 commited on
Commit
984b079
·
verified ·
1 Parent(s): eb62531

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -1,3 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  # ---- PAGE CONFIG ----
2
  st.set_page_config(
3
  page_title="Digit Recognition App",
 
1
+ import streamlit as st
2
+ import numpy as np
3
+ from PIL import Image
4
+ from tensorflow.keras.models import load_model
5
+
6
+ # Load trained model (placed in same directory as app.py)
7
+ @st.cache_resource # cache so model loads only once
8
+ def load_cnn_model():
9
+ return load_model("mnist_cnn.h5")
10
+
11
+ model = load_cnn_model()
12
+
13
  # ---- PAGE CONFIG ----
14
  st.set_page_config(
15
  page_title="Digit Recognition App",