Spaces:
Runtime error
Runtime error
Update services/under_construction/earthwork_detection.py
Browse files
services/under_construction/earthwork_detection.py
CHANGED
@@ -26,17 +26,6 @@ except Exception as e:
|
|
26 |
model = None
|
27 |
|
28 |
def process_earthwork(frame: np.ndarray) -> Tuple[List[Dict[str, Any]], np.ndarray]:
|
29 |
-
"""
|
30 |
-
Detect earthwork-related objects in a video frame 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 earthwork items.
|
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 earthwork_detection.")
|
|
|
26 |
model = None
|
27 |
|
28 |
def process_earthwork(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 earthwork_detection.")
|