KaburaJ commited on
Commit
8669566
·
1 Parent(s): fa67a36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -54,9 +54,10 @@ set_png_as_page_bg('background.webp')
54
  def load_model():
55
  if not os.path.isfile('model.h5'):
56
  subprocess.run(['curl --output model.h5 "https://github.com/KaburaJ/Binary-Image-classification/blob/main/ZebraHorse/CNN%20Application/model.h5"'], shell=True)
57
-
58
- model=tf.keras.models.load_model('model.h5', compile=False)
59
- return model
 
60
 
61
  # def load_model():
62
  # # Load the model architecture
@@ -99,7 +100,7 @@ def main():
99
 
100
  pred_button = st.button("Predict")
101
 
102
- model = load_model()
103
  # label = ['Zebra', 'Horse']
104
  # label = np.array(label).reshape(1, -1)
105
  # ohe= OneHotEncoder()
 
54
  def load_model():
55
  if not os.path.isfile('model.h5'):
56
  subprocess.run(['curl --output model.h5 "https://github.com/KaburaJ/Binary-Image-classification/blob/main/ZebraHorse/CNN%20Application/model.h5"'], shell=True)
57
+
58
+ model=tf.keras.models.load_model('model.h5', compile=False)
59
+ return model
60
+
61
 
62
  # def load_model():
63
  # # Load the model architecture
 
100
 
101
  pred_button = st.button("Predict")
102
 
103
+ load_model()
104
  # label = ['Zebra', 'Horse']
105
  # label = np.array(label).reshape(1, -1)
106
  # ohe= OneHotEncoder()