Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,6 +25,18 @@ model = tf.keras.models.load_model(model_path)
|
|
| 25 |
st.title("Christmas Tree Classifier")
|
| 26 |
st.write("Upload an image of a Christmas tree to classify it:")
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
| 29 |
|
| 30 |
if uploaded_file is not None:
|
|
@@ -46,17 +58,4 @@ if uploaded_file is not None:
|
|
| 46 |
predicted_class = "Decorated" if prediction[0][0] >= 0.5 else "Undecorated"
|
| 47 |
|
| 48 |
# Display the prediction
|
| 49 |
-
st.write(f"Prediction: {predicted_class}")
|
| 50 |
-
|
| 51 |
-
# Create tabs here (after the main UI elements)
|
| 52 |
-
tab1, tab2 = st.tabs(["Christmas Tree Classifier", "Sample Images"])
|
| 53 |
-
|
| 54 |
-
# Tab 1: Christmas Tree Classifier
|
| 55 |
-
with tab1:
|
| 56 |
-
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
| 57 |
-
if uploaded_file is not None:
|
| 58 |
-
# ... (Rest of the code for image processing and prediction) ...
|
| 59 |
-
|
| 60 |
-
# Tab 2: Sample Images
|
| 61 |
-
with tab2:
|
| 62 |
-
# ... (Code for Tab 2 remains the same) ...
|
|
|
|
| 25 |
st.title("Christmas Tree Classifier")
|
| 26 |
st.write("Upload an image of a Christmas tree to classify it:")
|
| 27 |
|
| 28 |
+
# Create tabs here (after the main UI elements)
|
| 29 |
+
tab1, tab2 = st.tabs(["Christmas Tree Classifier", "Sample Images"])
|
| 30 |
+
|
| 31 |
+
# Tab 1: Christmas Tree Classifier
|
| 32 |
+
with tab1:
|
| 33 |
+
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
| 34 |
+
if uploaded_file is not None:
|
| 35 |
+
# ... (Rest of the code for image processing and prediction) ...
|
| 36 |
+
|
| 37 |
+
# Tab 2: Sample Images
|
| 38 |
+
with tab2:
|
| 39 |
+
# ... (Code for Tab 2 remains the same) ...
|
| 40 |
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
|
| 41 |
|
| 42 |
if uploaded_file is not None:
|
|
|
|
| 58 |
predicted_class = "Decorated" if prediction[0][0] >= 0.5 else "Undecorated"
|
| 59 |
|
| 60 |
# Display the prediction
|
| 61 |
+
st.write(f"Prediction: {predicted_class}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|