Spaces:
Runtime error
Runtime error
Commit ·
2633210
1
Parent(s): 315a6c8
Update app.py
Browse files29 unmodified lines303132333334353637383940414243444041424344454647484929 unmodified lines uploaded_image = st.file_uploader("Upload an image", type=["jpg", "jpeg", "png"])
if uploaded_image is not None: # Read the image from uploaded file # Read the image from the uploaded file image = Image.open(uploaded_image)
# Display the uploaded image st.image(image, caption='Uploaded Image.', use_column_width=True)
# Preprocess the image probs = process_image(image)
# Display the result st.subheader("Result") st.json(probs.tolist()) try: probs = process_image(image) # Display the result st.subheader("Result") st.json(probs.tolist()) except Exception as e: st.error(f"Error processing image: {e}")
if __name__ == '__main__': main()app.py+8-6