willco-afk commited on
Commit
8c6260d
·
verified ·
1 Parent(s): ff6e3b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -5,17 +5,16 @@ import numpy as np
5
  import zipfile
6
  import os
7
 
8
-
9
  # Function to load the model from the zip file
10
  def load_model_from_zip(zip_file_path):
11
  with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
12
  zip_ref.extractall('.') # Extract to the current directory
13
- # Load the SavedModel (no need for model_path anymore)
14
- model = tf.keras.models.load_model('your_trained_model') # Replace 'your_trained_model' with your model folder name, if any
15
  return model
16
 
17
- # Load the model
18
- model = load_model_from_zip('my_christmas_tree_model.zip') # Update with your actual zip file name
19
 
20
  # Streamlit UI
21
  st.title("Christmas Tree Classifier")
 
5
  import zipfile
6
  import os
7
 
 
8
  # Function to load the model from the zip file
9
  def load_model_from_zip(zip_file_path):
10
  with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
11
  zip_ref.extractall('.') # Extract to the current directory
12
+ # Load the SavedModel directly from the current directory (root)
13
+ model = tf.keras.models.load_model('.')
14
  return model
15
 
16
+ # Load the model
17
+ model = load_model_from_zip('my_christmas_tree_model.zip')
18
 
19
  # Streamlit UI
20
  st.title("Christmas Tree Classifier")