lokesh341 commited on
Commit
a79cd3f
·
1 Parent(s): f7d1156

Update services/plantation/missing_patch_check.py

Browse files
services/plantation/missing_patch_check.py CHANGED
@@ -26,17 +26,6 @@ except Exception as e:
26
  model = None
27
 
28
  def process_missing_patches(frame: np.ndarray) -> Tuple[List[Dict[str, Any]], np.ndarray]:
29
- """
30
- Detect missing patches in plantation areas using YOLOv8n.
31
-
32
- Args:
33
- frame (np.ndarray): Input frame in BGR format.
34
-
35
- Returns:
36
- Tuple[List[Dict[str, Any]], np.ndarray]: A tuple containing:
37
- - List of detected missing patches.
38
- - Annotated frame with bounding boxes and labels.
39
- """
40
  # Validate input frame
41
  if not isinstance(frame, np.ndarray) or frame.size == 0:
42
  logging.error("Invalid input frame provided to missing_patch_check.")
@@ -78,7 +67,7 @@ def process_missing_patches(frame: np.ndarray) -> Tuple[List[Dict[str, Any]], np
78
  "coordinates": [x_min, y_min, x_max, y_max]
79
  })
80
 
81
- color = (255, 192, 203) # Pink for missing patches
82
  cv2.rectangle(frame, (x_min, y_min), (x_max, y_max), color, 2)
83
  cv2.putText(
84
  frame,
 
26
  model = None
27
 
28
  def process_missing_patches(frame: np.ndarray) -> Tuple[List[Dict[str, Any]], np.ndarray]:
 
 
 
 
 
 
 
 
 
 
 
29
  # Validate input frame
30
  if not isinstance(frame, np.ndarray) or frame.size == 0:
31
  logging.error("Invalid input frame provided to missing_patch_check.")
 
67
  "coordinates": [x_min, y_min, x_max, y_max]
68
  })
69
 
70
+ color = (255, 165, 0) # Orange for missing patches
71
  cv2.rectangle(frame, (x_min, y_min), (x_max, y_max), color, 2)
72
  cv2.putText(
73
  frame,