Update src/streamlit_app.py
Browse files- src/streamlit_app.py +6 -8
src/streamlit_app.py
CHANGED
@@ -1,18 +1,16 @@
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
|
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
st.image("src/RezbinLogo.jpg", width=150)
|
|
|
8 |
st.title("Rezbin AI 📷")
|
9 |
st.write("Upload an image of your waste before throwing it.")
|
10 |
|
11 |
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "png", "jpeg"])
|
12 |
|
13 |
if uploaded_file is not None:
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
img = Image.open(tmp_file_path)
|
18 |
-
st.image(img, caption="Uploaded Image", use_container_width=True)
|
|
|
1 |
import streamlit as st
|
2 |
from PIL import Image
|
3 |
+
import io
|
4 |
|
5 |
+
# Show logo — make sure RezbinLogo.jpg is in the 'src/' folder in your repo
|
|
|
|
|
6 |
st.image("src/RezbinLogo.jpg", width=150)
|
7 |
+
|
8 |
st.title("Rezbin AI 📷")
|
9 |
st.write("Upload an image of your waste before throwing it.")
|
10 |
|
11 |
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "png", "jpeg"])
|
12 |
|
13 |
if uploaded_file is not None:
|
14 |
+
# Open image directly from uploaded file buffer (no temp file needed)
|
15 |
+
img = Image.open(io.BytesIO(uploaded_file.read()))
|
16 |
+
st.image(img, caption="Uploaded Image", use_container_width=True)
|
|
|
|