Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,38 +20,7 @@ model_path = hf_hub_download(repo_id=repo_id, filename=filename, cache_dir=cache
|
|
| 20 |
# Load the model
|
| 21 |
model = tf.keras.models.load_model(model_path)
|
| 22 |
|
| 23 |
-
# Streamlit UI
|
| 24 |
-
st.markdown(
|
| 25 |
-
"""
|
| 26 |
-
<style>
|
| 27 |
-
body {
|
| 28 |
-
background-color: #f0f0f0; /* Light gray background */
|
| 29 |
-
}
|
| 30 |
-
.stApp {
|
| 31 |
-
background-color: #f8f8f8; /* Slightly lighter background for the app container */
|
| 32 |
-
padding: 20px;
|
| 33 |
-
border-radius: 10px;
|
| 34 |
-
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
| 35 |
-
}
|
| 36 |
-
.stButton>button {
|
| 37 |
-
background-color: #c0392b; /* Christmas red for buttons */
|
| 38 |
-
color: white;
|
| 39 |
-
border: none;
|
| 40 |
-
padding: 10px 20px;
|
| 41 |
-
border-radius: 5px;
|
| 42 |
-
cursor: pointer;
|
| 43 |
-
}
|
| 44 |
-
.stButton>button:hover {
|
| 45 |
-
background-color: #e74c3c; /* Slightly darker red on hover */
|
| 46 |
-
}
|
| 47 |
-
h1 {
|
| 48 |
-
color: #27ae60; /* Christmas green for the title */
|
| 49 |
-
}
|
| 50 |
-
</style>
|
| 51 |
-
""",
|
| 52 |
-
unsafe_allow_html=True,
|
| 53 |
-
)
|
| 54 |
-
|
| 55 |
st.title("Christmas Tree Classifier")
|
| 56 |
st.write("Upload an image of a Christmas tree to classify it:")
|
| 57 |
|
|
@@ -60,6 +29,7 @@ uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png
|
|
| 60 |
if uploaded_file is not None:
|
| 61 |
# Display the uploaded image
|
| 62 |
image = Image.open(uploaded_file)
|
|
|
|
| 63 |
st.image(image, caption="Uploaded Image.", use_container_width=True)
|
| 64 |
st.write("")
|
| 65 |
st.write("Classifying...")
|
|
|
|
| 20 |
# Load the model
|
| 21 |
model = tf.keras.models.load_model(model_path)
|
| 22 |
|
| 23 |
+
# Streamlit UI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
st.title("Christmas Tree Classifier")
|
| 25 |
st.write("Upload an image of a Christmas tree to classify it:")
|
| 26 |
|
|
|
|
| 29 |
if uploaded_file is not None:
|
| 30 |
# Display the uploaded image
|
| 31 |
image = Image.open(uploaded_file)
|
| 32 |
+
# Updated Line:
|
| 33 |
st.image(image, caption="Uploaded Image.", use_container_width=True)
|
| 34 |
st.write("")
|
| 35 |
st.write("Classifying...")
|