Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -118,13 +118,13 @@ if detect_button:
|
|
118 |
# Perform object detection
|
119 |
processed_image, detected_objects = perform_object_detection(image, detect_model, threshold)
|
120 |
|
121 |
-
if processed_image:
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
else:
|
127 |
-
|
128 |
|
129 |
except Exception as e:
|
130 |
st.error(f"Error loading image: {e}")
|
|
|
118 |
# Perform object detection
|
119 |
processed_image, detected_objects = perform_object_detection(image, detect_model, threshold)
|
120 |
|
121 |
+
#if processed_image:
|
122 |
+
# Display the image with detected objects
|
123 |
+
st.image(processed_image, use_column_width=True, caption="Image with Detected Objects")
|
124 |
+
# Display the detected objects as text
|
125 |
+
st.write(detected_objects)
|
126 |
+
#else:
|
127 |
+
# st.error("Failed to process image for object detection.")
|
128 |
|
129 |
except Exception as e:
|
130 |
st.error(f"Error loading image: {e}")
|