""" Pydantic models for CFB40 configuration. This module contains validated configuration models using Pydantic BaseModel. """ from typing import Optional from pydantic import BaseModel class SessionConfig(BaseModel): """ Configuration for a detection session, including user-specified regions. This model contains all the information needed to run play detection on a video, including the selected scorebug, play clock, and timeout regions. """ # Video settings video_path: str start_time: float end_time: Optional[float] # Scorebug region (absolute coordinates in frame) scorebug_x: int scorebug_y: int scorebug_width: int scorebug_height: int # Play clock region (relative to scorebug) playclock_x_offset: int playclock_y_offset: int playclock_width: int playclock_height: int # Timeout tracker regions (absolute coordinates in frame) # Home team timeout indicators (3 ovals stacked vertically) home_timeout_x: int = 0 home_timeout_y: int = 0 home_timeout_width: int = 0 home_timeout_height: int = 0 # Away team timeout indicators (3 ovals stacked vertically) away_timeout_x: int = 0 away_timeout_y: int = 0 away_timeout_width: int = 0 away_timeout_height: int = 0 # FLAG region (relative to scorebug, like play clock) # This is where "1st & 10" / "FLAG" appears on the scorebug flag_x_offset: int = 0 flag_y_offset: int = 0 flag_width: int = 0 flag_height: int = 0 # Generated paths template_path: str = "" config_path: str = "" # Video identifier for output naming video_basename: str = ""