§
    l¬¸jw  ã                  ó`   — d dl mZ d dlmZmZ d dlmZ d dlZe G d„ d¦  «        ¦   «         ZdS )é    )Úannotations)Ú	dataclassÚfield)ÚAnyNc                  ó&  — e Zd ZU dZdZded<   dZded<   dZded<   dZd	ed
<   dZ	d	ed<   dZ
d	ed<   dZded<   ej        Zded<   dZd	ed<   dZd	ed<   dZded<   dZded<    ed„ ¬¦  «        Zded<   dZded<   d Zd!ed"<   d#Zded$<   d%Zd&ed'<   d(Zded)<   dZded*<   d+Zded,<   d-Zded.<   d/Zded0<   d-Zded1<   d2Zded3<   d4Z ded5<   d6Z!d	ed7<   d8Z"ded9<   d:Z#ded;<   dZ$ded<<   d=Z%ded><   dZ&d?ed@<   dAZ'dedB<   dCZ(dedD<   dZ)d	edE<   dFZ*dedG<   dKdJ„Z+dS )LÚSolutionConfigaŠ  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.
        show_boxes (bool): Whether to display bounding boxes on the 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_DEEPGREEN).
        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[float, float], 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, optional): Path to a JSON file containing data for parking areas.
        line_width (int): Width for visual display, e.g. bounding boxes, keypoints, and 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.
        quantize (int | str | None): Inference precision, e.g. 16 (FP16). Only PyTorch and TorchScript models compute in
            it; elsewhere the artifact and runtime decide, though 16 rounds OpenVINO inputs. Replaces the deprecated
            half flag.
        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="yolo26n.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_labelsÚ
show_boxeszlist[tuple[int, int]] | NoneÚregionz
int | NoneÚcolormapÚshow_inÚshow_outg      b@ÚfloatÚup_angleéZ   ÚintÚ
down_anglec                 ó
   — g d¢S )N)é   é   é
   © r   ó    úl/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/ultralytics/solutions/config.pyú<lambda>zSolutionConfig.<lambda>P   s
   € °J°J°J€ r   )Údefault_factoryz	list[int]ÚkptsÚlineÚstrÚanalytics_type)gš™™™™™)@gÍÌÌÌÌÌ@ztuple[float, float] | 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_pixeléx   Ú	max_speedFÚshowgffffffæ?Úioug      Ð?ÚconfÚdevicei,  Úmax_detzint | str | NoneÚquantizei€  Úimgszzbotsort.yamlÚtrackerÚverboseÚimagesÚdataÚkwargsr   c                ó  — d|v r.ddl m}  |dd¦  «         |                     d¦  «        rdnd|d<   |                     ¦   «         D ]<\  }}t	          | |¦  «        rt          | ||¦  «         Œ'd}t          |› d|› �¦  «        ‚| S )	zNUpdate configuration parameters with new values provided as keyword arguments.Úhalfr   )Údeprecation_warnr:   é   Nz:https://docs.ultralytics.com/solutions#solutions-argumentsz' is not a valid solution argument, see )Úultralytics.utilsrC   ÚpopÚitemsÚhasattrÚsetattrÚ
ValueError)Úselfr@   rC   ÚkeyÚvalueÚurls         r   ÚupdatezSolutionConfig.updateh   s½   € à�VÐÐØ:Ð:Ð:Ð:Ð:Ð:àÐ˜V ZÑ0Ô0Ð0Ø'-§z¢z°&Ñ'9Ô'9Ð!C  ¸tˆF�:ÑØ Ÿ,š,™.œ.ð 	Wð 	W‰JˆC�Ý�t˜SÑ!Ô!ð WÝ˜˜c 5Ñ)Ô)Ð)Ð)àR�Ý  CÐ!UÐ!UÐPSÐ!UÐ!UÑVÔVÐVàˆr   )r@   r   ),Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   Ú__annotations__r
   r   r   r   r   r   Úcv2ÚCOLORMAP_DEEPGREENr   r   r   r   r   r   r"   r%   r&   r'   r)   r*   r+   r-   r/   r0   r1   r2   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r?   rO   r   r   r   r   r      sž  € € € € € € ð5ð 5ðn €FÐÐÐÑØ€EÐÐÐÑØ $€GÐ$Ð$Ð$Ñ$Ø€IÐÐÐÑØ€KÐÐÐÑØ€JÐÐÐÑØ+/€FÐ/Ð/Ð/Ñ/ØÔ1€HÐ1Ð1Ð1Ñ1Ø€GÐÐÐÑØ€HÐÐÐÑØ€HÐÐÐÑØ€JÐÐÐÑØ�eÐ,>Ð,>Ð?Ñ?Ô?€DÐ?Ð?Ð?Ñ?Ø €NÐ Ð Ð Ñ Ø*5€GÐ5Ð5Ð5Ñ5Ø€JÐÐÐÑØ$,€LÐ,Ð,Ð,Ñ,Ø(€HÐ(Ð(Ð(Ñ(Ø €IÐ Ð Ð Ñ Ø€JÐÐÐÑØ€GÐÐÐÑØ€CÐÐÐÑØ€HÐÐÐÑØ!€OÐ!Ð!Ð!Ñ!Ø€IÐÐÐÑØ€DÐÐÐÑØ€CÐÐÐÑØ€DÐÐÐÑØ€FÐÐÐÑØ€GÐÐÐÑØ!%€HÐ%Ð%Ð%Ñ%Ø€EÐÐÐÑØ!€GÐ!Ð!Ð!Ñ!Ø€GÐÐÐÑØ€DÐÐÐÑðð ð ð ð ð r   r   )	Ú
__future__r   Údataclassesr   r   Útypingr   rU   r   r   r   r   ú<module>rZ      s”   ðð #Ð "Ð "Ð "Ð "Ð "à (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ø Ð Ð Ð Ð Ð à 
€
€
€
ð ðjð jð jð jð jñ jô jñ „ðjð jð jr   