32 lines
845 B
Python
32 lines
845 B
Python
"""
|
|
LangGraph state definition for the detection pipeline.
|
|
|
|
This TypedDict flows through all graph nodes. Each node reads what
|
|
it needs and writes its outputs. LangGraph manages the state transitions.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import TypedDict
|
|
|
|
from detect.models import BoundingBox, BrandDetection, DetectionReport, Frame, PipelineStats, TextCandidate
|
|
|
|
|
|
class DetectState(TypedDict, total=False):
|
|
# Input
|
|
video_path: str
|
|
job_id: str
|
|
profile_name: str
|
|
|
|
# Stage outputs
|
|
frames: list[Frame]
|
|
filtered_frames: list[Frame]
|
|
boxes_by_frame: dict[int, list[BoundingBox]]
|
|
text_candidates: list[TextCandidate]
|
|
unresolved_candidates: list[TextCandidate]
|
|
detections: list[BrandDetection]
|
|
report: DetectionReport
|
|
|
|
# Running stats (updated by each stage)
|
|
stats: PipelineStats
|