Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -122,12 +122,25 @@ camera_image = st.camera_input("Or take a picture of the car")
|
|
| 122 |
|
| 123 |
# Process the image (either uploaded or from camera)
|
| 124 |
image = None
|
|
|
|
|
|
|
|
|
|
| 125 |
if uploaded_file is not None:
|
| 126 |
-
|
| 127 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
elif camera_image is not None:
|
| 129 |
-
|
| 130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
if image is not None:
|
| 133 |
st.image(image, caption='Processed Image', use_container_width=True)
|
|
|
|
| 122 |
|
| 123 |
# Process the image (either uploaded or from camera)
|
| 124 |
image = None
|
| 125 |
+
st.write(f"uploaded_file: {uploaded_file}")
|
| 126 |
+
st.write(f"camera_image: {camera_image}")
|
| 127 |
+
|
| 128 |
if uploaded_file is not None:
|
| 129 |
+
st.write("Attempting to open uploaded file...")
|
| 130 |
+
try:
|
| 131 |
+
image = Image.open(uploaded_file)
|
| 132 |
+
st.write("Image uploaded successfully.")
|
| 133 |
+
except Exception as e:
|
| 134 |
+
st.error(f"Error opening uploaded file: {str(e)}")
|
| 135 |
elif camera_image is not None:
|
| 136 |
+
st.write("Attempting to open camera image...")
|
| 137 |
+
try:
|
| 138 |
+
image = Image.open(camera_image)
|
| 139 |
+
st.write("Image captured successfully.")
|
| 140 |
+
except Exception as e:
|
| 141 |
+
st.error(f"Error opening camera image: {str(e)}")
|
| 142 |
+
|
| 143 |
+
st.write(f"image: {image}")
|
| 144 |
|
| 145 |
if image is not None:
|
| 146 |
st.image(image, caption='Processed Image', use_container_width=True)
|