
    h                    R    S SK Jr  S SKJrJr  S SKJr  S SKr\ " S S5      5       rg)    )annotations)	dataclassfield)AnyNc                     \ rS rSr% SrSrS\S'   SrS\S'   SrS\S'   S	r	S
\S'   S	r
S
\S'   SrS\S'   \R                  rS\S'   S	rS
\S'   S	rS
\S'   SrS\S'   SrS\S'   \" S S9rS\S'   SrS\S'   S rS!\S"'   S#rS\S$'   S%rS&\S''   S(rS\S)'   SrS\S*'   S+rS\S,'   S-rS\S.'   S/rS\S0'   S-rS\S1'   S2rS\S3'   S4r S\S5'   S6r!S
\S7'   S8r"S\S9'   S:r#S\S;'   Sr$S\S<'   S=r%S\S>'   S6r&S
\S?'   S@r'S\SA'   S	r(S
\SB'   SCr)S\SD'   SGSE jr*SFr+g)HSolutionConfig   a  
Manages configuration parameters for Ultralytics Vision AI solutions.

The SolutionConfig class serves as a centralized configuration container for all the
Ultralytics solution modules: https://docs.ultralytics.com/solutions/#solutions.
It leverages Python `dataclass` for clear, type-safe, and maintainable parameter definitions.

Attributes:
    source (str, optional): Path to the input source (video, RTSP, etc.). Only usable with Solutions CLI.
    model (str, optional): Path to the Ultralytics YOLO model to be used for inference.
    classes (list[int], optional): List of class indices to filter detections.
    show_conf (bool): Whether to show confidence scores on the visual output.
    show_labels (bool): Whether to display class labels on visual output.
    region (list[tuple[int, int]], optional): Polygonal region or line for object counting.
    colormap (int, optional): OpenCV colormap constant for visual overlays (e.g., cv2.COLORMAP_JET).
    show_in (bool): Whether to display count number for objects entering the region.
    show_out (bool): Whether to display count number for objects leaving the region.
    up_angle (float): Upper angle threshold used in pose-based workouts monitoring.
    down_angle (int): Lower angle threshold used in pose-based workouts monitoring.
    kpts (list[int]): Keypoint indices to monitor, e.g., for pose analytics.
    analytics_type (str): Type of analytics to perform ("line", "area", "bar", "pie", etc.).
    figsize (tuple[int, int], optional): Size of the matplotlib figure used for analytical plots (width, height).
    blur_ratio (float): Ratio used to blur objects in the video frames (0.0 to 1.0).
    vision_point (tuple[int, int]): Reference point for directional tracking or perspective drawing.
    crop_dir (str): Directory path to save cropped detection images.
    json_file (str): Path to a JSON file containing data for parking areas.
    line_width (int): Width for visual display i.e. bounding boxes, keypoints, counts.
    records (int): Number of detection records to send email alerts.
    fps (float): Frame rate (Frames Per Second) for speed estimation calculation.
    max_hist (int): Maximum number of historical points or states stored per tracked object for speed estimation.
    meter_per_pixel (float): Scale for real-world measurement, used in speed or distance calculations.
    max_speed (int): Maximum speed limit (e.g., km/h or mph) used in visual alerts or constraints.
    show (bool): Whether to display the visual output on screen.
    iou (float): Intersection-over-Union threshold for detection filtering.
    conf (float): Confidence threshold for keeping predictions.
    device (str, optional): Device to run inference on (e.g., 'cpu', '0' for CUDA GPU).
    max_det (int): Maximum number of detections allowed per video frame.
    half (bool): Whether to use FP16 precision (requires a supported CUDA device).
    tracker (str): Path to tracking configuration YAML file (e.g., 'botsort.yaml').
    verbose (bool): Enable verbose logging output for debugging or diagnostics.
    data (str): Path to image directory used for similarity search.

Methods:
    update: Update the configuration with user-defined keyword arguments and raise error on invalid keys.

Examples:
    >>> from ultralytics.solutions.config import SolutionConfig
    >>> cfg = SolutionConfig(model="yolo11n.pt", region=[(0, 0), (100, 0), (100, 100), (0, 100)])
    >>> cfg.update(show=False, conf=0.3)
    >>> print(cfg.model)
Nz
str | Nonesourcemodelzlist[int] | NoneclassesTbool	show_confshow_labelszlist[tuple[int, int]] | Noneregionz
int | Nonecolormapshow_inshow_outg      b@floatup_angleZ   int
down_anglec                 
    / SQ$ )N)      
    r       V/home/james-whalen/.local/lib/python3.13/site-packages/ultralytics/solutions/config.py<lambda>SolutionConfig.<lambda>L   s    Jr   )default_factoryz	list[int]kptslinestranalytics_type)g)@g@ztuple[int, int] | Nonefigsizeg      ?
blur_ratio)   r)   ztuple[int, int]vision_pointzcropped-detectionscrop_dir	json_file   
line_width   recordsg      >@fpsmax_histg?meter_per_pixelx   	max_speedFshowgffffff?ioug      ?confdevicei,  max_dethalfzbotsort.yamltrackerverboseimagesdatac                    UR                  5        H3  u  p#[        X5      (       a  [        XU5        M#  Sn[        U SU 35      e   U $ )zNUpdate configuration parameters with new values provided as keyword arguments.z;https://docs.ultralytics.com/solutions/#solutions-argumentsz' is not a valid solution argument, see )itemshasattrsetattr
ValueError)selfkwargskeyvalueurls        r   updateSolutionConfig.updatec   sM     ,,.JCt!!5)S C5(OPSu!UVV ) r   r   )rF   r   ),__name__
__module____qualname____firstlineno____doc__r
   __annotations__r   r   r   r   r   cv2COLORMAP_DEEPGREENr   r   r   r   r   r   r#   r&   r'   r(   r*   r+   r,   r.   r0   r1   r2   r3   r5   r6   r7   r8   r9   r:   r;   r<   r=   r?   rJ   __static_attributes__r   r   r   r   r      sh   2h FJE: $G$ItK+/F(/11Hj1GTHdHeJ,>?D)? NC &1G#1J$,L/,(Hc(IsJGSCHc!OU!IsD$CD%FJGSD$!GS!GTD#	r   r   )	
__future__r   dataclassesr   r   typingr   rR   r   r   r   r   <module>rX      s/    # (  
 ` ` `r   