Martin Tomov commited on
Commit
2065714
·
verified ·
1 Parent(s): 312614a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -151,11 +151,8 @@ def extract_and_paste_insect(original_image: np.ndarray, detection: DetectionRes
151
  background[y_offset:y_end, x_offset:x_end] = insect
152
 
153
  def create_yellow_background_with_insects(image: np.ndarray, detections: List[DetectionResult]) -> np.ndarray:
154
- # Create a yellow background in RGB
155
- yellow_background = np.full((image.shape[0], image.shape[1], 3), (255, 255, 0), dtype=np.uint8)
156
- # Convert the yellow background from RGB to BGR for OpenCV
157
- yellow_background = cv2.cvtColor(yellow_background, cv2.COLOR_RGB2BGR)
158
-
159
  for detection in detections:
160
  if detection.mask is not None:
161
  extract_and_paste_insect(image, detection, yellow_background)
 
151
  background[y_offset:y_end, x_offset:x_end] = insect
152
 
153
  def create_yellow_background_with_insects(image: np.ndarray, detections: List[DetectionResult]) -> np.ndarray:
154
+ yellow_background = np.full((image.shape[0], image.shape[1], 3), (0, 255, 255), dtype=np.uint8) # BGR for yellow in OpenCV
155
+ yellow_background[:] = (0, 255, 255) # Ensuring it's yellow
 
 
 
156
  for detection in detections:
157
  if detection.mask is not None:
158
  extract_and_paste_insect(image, detection, yellow_background)