Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
14 |
-
model = tf.keras.models.load_model('
|
15 |
return model
|
16 |
|
17 |
-
# Load the model
|
18 |
-
model = load_model_from_zip('my_christmas_tree_model.zip')
|
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")
|