File size: 827 Bytes
37a660b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# controller.py
from services.under_construction.bridge_pier_check import process_bridge_piers
from services.under_construction.culvert_check import process_culverts
from services.under_construction.earthwork_detection import process_earthwork

def detect_under_construction_objects(frame, mode: str):
    """
    Dispatches frame to the appropriate detection function based on mode.
    Args:
        frame: Input frame as a numpy array.
        mode: One of "bridge", "culvert", "earthwork".
    Returns:
        Tuple of (detections, annotated_frame)
    """
    if mode == "bridge":
        return process_bridge_piers(frame)
    elif mode == "culvert":
        return process_culverts(frame)
    elif mode == "earthwork":
        return process_earthwork(frame)
    else:
        raise ValueError(f"Unknown mode: {mode}")