m7mdal7aj commited on
Commit
4f92821
·
verified ·
1 Parent(s): 10b8c1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
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
- # Display the detected objects
116
- st.write(detected_objects)
117
  # Display the image with detected objects
118
- st.write(processed_image) # testing to be deleted
119
- st.image(processed_image, use_column_width=True, caption="Image with Detected Objects")
 
 
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
+