This commit is contained in:
2026-03-23 16:55:13 -03:00
parent 4fdbdfc6d3
commit 3df9ed5ada
17 changed files with 848 additions and 4 deletions

View File

@@ -7,6 +7,8 @@ Each node emits graph_update events so the UI can visualize transitions.
from __future__ import annotations
import os
from langgraph.graph import END, StateGraph
from detect import emit
@@ -15,6 +17,9 @@ from detect.profiles import SoccerBroadcastProfile
from detect.state import DetectState
from detect.stages.frame_extractor import extract_frames
from detect.stages.scene_filter import scene_filter
from detect.stages.yolo_detector import detect_objects
INFERENCE_URL = os.environ.get("INFERENCE_URL") # None = local mode
NODES = [
"extract_frames",
@@ -84,10 +89,19 @@ def node_filter_scenes(state: DetectState) -> dict:
def node_detect_objects(state: DetectState) -> dict:
_emit_transition(state, "detect_objects", "running")
profile = _get_profile(state)
config = profile.detection_config()
frames = state.get("filtered_frames", [])
job_id = state.get("job_id")
emit.log(job_id, "YOLODetector", "INFO", "Stub: object detection not yet implemented")
all_boxes = detect_objects(frames, config, inference_url=INFERENCE_URL, job_id=job_id)
stats = state.get("stats", PipelineStats())
stats.regions_detected = sum(len(boxes) for boxes in all_boxes.values())
_emit_transition(state, "detect_objects", "done")
return {}
return {"stats": stats}
def node_run_ocr(state: DetectState) -> dict: