Files
VideoDetect/src/router.py
T
2026-08-10 15:51:25 -04:00

27 lines
625 B
Python

"""Threshold-based routing of video-level confidence to MATCH / REVIEW / SKIP."""
import logging
logger = logging.getLogger(__name__)
MATCH = "MATCH"
REVIEW = "REVIEW"
SKIP = "SKIP"
def route(
confidence: float,
t_high: float = 0.75,
t_low: float = 0.45,
) -> str:
"""Return the routing decision for a video-level confidence score."""
if confidence >= t_high:
decision = MATCH
elif confidence >= t_low:
decision = REVIEW
else:
decision = SKIP
logger.debug("route: C=%.4f t_high=%.2f t_low=%.2f → %s", confidence, t_high, t_low, decision)
return decision