29 lines
680 B
Python
29 lines
680 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 BrandDetection, DetectionReport, Frame, PipelineStats
|
|
|
|
|
|
class DetectState(TypedDict, total=False):
|
|
# Input
|
|
video_path: str
|
|
job_id: str
|
|
profile_name: str
|
|
|
|
# Stage outputs
|
|
frames: list[Frame]
|
|
filtered_frames: list[Frame]
|
|
detections: list[BrandDetection]
|
|
report: DetectionReport
|
|
|
|
# Running stats (updated by each stage)
|
|
stats: PipelineStats
|