m7mdal7aj commited on
Commit
fcf5aaf
1 Parent(s): 92bc556

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -99,10 +99,9 @@ def perform_object_detection(image, model_name, threshold):
99
 
100
 
101
  # Perform object detection and draw bounding boxes
102
- st.write("9999999999999")
103
  processed_image, detected_objects = detect_and_draw_objects(image, model_name, threshold)
104
- st.write("66666666666666")
105
- st.write(detected_objects[:20])
106
  return processed_image, detected_objects
107
 
108
 
@@ -113,25 +112,20 @@ if detect_button:
113
  # Open the uploaded image
114
  try:
115
  image = Image.open(image)
116
- st.write("1111111111111")
117
  # Display the original image
118
  st.image(image, use_column_width=True, caption="Original Image")
119
- st.write("22222222222222")
120
  # Perform object detection
121
  processed_image, detected_objects = perform_object_detection(image, detect_model, threshold)
122
- st.write(detected_objects)
123
- st.write("333333333333333")
124
- st.write(processed_image)
125
- st.write(type(processed_image))
126
- #if processed_image:
127
  # Display the image with detected objects
128
  st.image(processed_image, use_column_width=True, caption="Image with Detected Objects")
129
- st.write("444444444444444")
130
  # Display the detected objects as text
131
  st.write(detected_objects)
132
- st.write("5555555555555555")
133
- #else:
134
- # st.error("Failed to process image for object detection.")
135
 
136
  except Exception as e:
137
  st.error(f"Error loading image: {e}")
 
99
 
100
 
101
  # Perform object detection and draw bounding boxes
102
+
103
  processed_image, detected_objects = detect_and_draw_objects(image, model_name, threshold)
104
+
 
105
  return processed_image, detected_objects
106
 
107
 
 
112
  # Open the uploaded image
113
  try:
114
  image = Image.open(image)
115
+
116
  # Display the original image
117
  st.image(image, use_column_width=True, caption="Original Image")
118
+
119
  # Perform object detection
120
  processed_image, detected_objects = perform_object_detection(image, detect_model, threshold)
121
+
122
+
 
 
 
123
  # Display the image with detected objects
124
  st.image(processed_image, use_column_width=True, caption="Image with Detected Objects")
125
+
126
  # Display the detected objects as text
127
  st.write(detected_objects)
128
+
 
 
129
 
130
  except Exception as e:
131
  st.error(f"Error loading image: {e}")