Update app.py
Browse files
app.py
CHANGED
|
@@ -110,13 +110,18 @@ if detect_button:
|
|
| 110 |
image = Image.open(image)
|
| 111 |
# Display the original image
|
| 112 |
st.image(image, use_column_width=True, caption="Original Image")
|
|
|
|
| 113 |
# Perform object detection
|
| 114 |
processed_image, detected_objects = perform_object_detection(image, detect_model, threshold)
|
| 115 |
-
|
| 116 |
-
st.write(detected_objects)
|
| 117 |
# Display the image with detected objects
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
| 120 |
|
|
|
|
|
|
|
| 121 |
else:
|
| 122 |
st.write("Please upload an image for object detection.")
|
|
|
|
|
|
| 110 |
image = Image.open(image)
|
| 111 |
# Display the original image
|
| 112 |
st.image(image, use_column_width=True, caption="Original Image")
|
| 113 |
+
|
| 114 |
# Perform object detection
|
| 115 |
processed_image, detected_objects = perform_object_detection(image, detect_model, threshold)
|
| 116 |
+
|
|
|
|
| 117 |
# Display the image with detected objects
|
| 118 |
+
if isinstance(processed_image, Image.Image):
|
| 119 |
+
st.image(processed_image, use_column_width=True, caption="Image with Detected Objects")
|
| 120 |
+
else:
|
| 121 |
+
st.error("Failed to process image for object detection.")
|
| 122 |
|
| 123 |
+
# Display the detected objects as text
|
| 124 |
+
st.write(detected_objects)
|
| 125 |
else:
|
| 126 |
st.write("Please upload an image for object detection.")
|
| 127 |
+
|