# 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}")