lokesh341 commited on
Commit
21230b8
·
1 Parent(s): a649171

Update services/operations_maintenance/signage_check.py

Browse files
services/operations_maintenance/signage_check.py CHANGED
@@ -26,17 +26,6 @@ except Exception as e:
26
  model = None
27
 
28
  def process_signages(frame: np.ndarray) -> Tuple[List[Dict[str, Any]], np.ndarray]:
29
- """
30
- Detect signages in a video frame using YOLOv8m.
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 signages.
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 signage_check.")
@@ -78,7 +67,7 @@ def process_signages(frame: np.ndarray) -> Tuple[List[Dict[str, Any]], np.ndarra
78
  "coordinates": [x_min, y_min, x_max, y_max]
79
  })
80
 
81
- color = (0, 191, 255) # DeepSkyBlue for signage
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_signages(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 signage_check.")
 
67
  "coordinates": [x_min, y_min, x_max, y_max]
68
  })
69
 
70
+ color = (0, 0, 255) # Blue for signage
71
  cv2.rectangle(frame, (x_min, y_min), (x_max, y_max), color, 2)
72
  cv2.putText(
73
  frame,