demo / src /streamlit_app.py
shingguy1's picture
Update src/streamlit_app.py
aa701c3 verified
raw
history blame contribute delete
634 Bytes
import streamlit as st
import io
from PIL import Image
st.set_page_config(page_title="🧪 Upload Debug Test", layout="centered")
st.title("🧪 Upload Debug Test")
uploaded_file = st.file_uploader("Upload an image...", type=["jpg", "jpeg", "png"])
if uploaded_file is not None:
st.write("Upload received!")
try:
file_bytes = uploaded_file.read()
image = Image.open(io.BytesIO(file_bytes)).convert("RGB")
st.image(image, caption="Image Loaded", use_column_width=True)
st.success("✅ Image loaded successfully.")
except Exception as e:
st.error(f"❌ Failed to open image: {e}")