Update src/streamlit_app.py
Browse files- src/streamlit_app.py +5 -3
src/streamlit_app.py
CHANGED
@@ -11,6 +11,8 @@ st.write("Upload an image of your waste before throwing it.")
|
|
11 |
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "png", "jpeg"])
|
12 |
|
13 |
if uploaded_file is not None:
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
11 |
uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "png", "jpeg"])
|
12 |
|
13 |
if uploaded_file is not None:
|
14 |
+
with tempfile.NamedTemporaryFile(delete=False) as tmp_file:
|
15 |
+
tmp_file.write(uploaded_file.getbuffer())
|
16 |
+
tmp_file_path = tmp_file.name
|
17 |
+
img = Image.open(tmp_file_path)
|
18 |
+
st.image(img, caption="Uploaded Image", use_container_width=True)
|