Ë
    Fêñi¦  ã                   óF   — d dl mZ d dlmZmZmZ d dlmZ  G d„ de«      Zy)é    )ÚAny)ÚBaseSolutionÚSolutionAnnotatorÚSolutionResults)Úcolorsc                   ó8   ‡ — e Zd ZdZdeddfˆ fd„Zdefd„Zˆ xZS )Ú	VisionEyeaÏ  A class to manage object detection and vision mapping in images or video streams.

    This class extends the BaseSolution class and provides functionality for detecting objects, mapping vision points,
    and annotating results with bounding boxes and labels.

    Attributes:
        vision_point (tuple[int, int]): Coordinates (x, y) where vision will view objects and draw tracks.

    Methods:
        process: Process the input image to detect objects, annotate them, and apply vision mapping.

    Examples:
        >>> vision_eye = VisionEye()
        >>> frame = cv2.imread("frame.jpg")
        >>> results = vision_eye.process(frame)
        >>> print(f"Total detected instances: {results.total_tracks}")
    ÚkwargsÚreturnNc                 óL   •— t        ‰| �  di |¤Ž | j                  d   | _        y)zÔInitialize the VisionEye class for detecting objects and applying vision mapping.

        Args:
            **kwargs (Any): Keyword arguments passed to the parent class and for configuring vision_point.
        Úvision_pointN© )ÚsuperÚ__init__ÚCFGr   )Úselfr
   Ú	__class__s     €úb/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/ultralytics/solutions/vision_eye.pyr   zVisionEye.__init__   s&   ø€ ô 	‰ÑÑ"˜6Ò"à ŸH™H ^Ñ4ˆÕó    c           
      óú  — | j                  |«       t        || j                  «      }t        | j                  | j
                  | j                  | j                  «      D ][  \  }}}}|j                  || j                  |||«      t        t        |«      d«      ¬«       |j                  || j                  «       Œ] |j                  «       }| j                  |«       t!        |t#        | j
                  «      ¬«      S )a¢  Perform object detection, vision mapping, and annotation on the input image.

        Args:
            im0 (np.ndarray): The input image for detection and annotation.

        Returns:
            (SolutionResults): Object containing the annotated image and tracking statistics.
                - plot_im: Annotated output image with bounding boxes and vision mapping
                - total_tracks: Number of tracked objects in the frame

        Examples:
            >>> vision_eye = VisionEye()
            >>> frame = cv2.imread("image.jpg")
            >>> results = vision_eye.process(frame)
            >>> print(f"Detected {results.total_tracks} objects")
        T)ÚlabelÚcolor)Úplot_imÚtotal_tracks)Úextract_tracksr   Ú
line_widthÚzipÚclssÚ	track_idsÚboxesÚconfsÚ	box_labelÚadjust_box_labelr   ÚintÚ	visioneyer   ÚresultÚdisplay_outputr   Úlen)r   Úim0Ú	annotatorÚclsÚt_idÚboxÚconfr   s           r   ÚprocesszVisionEye.process&   sÕ   € ð" 	×Ñ˜CÔ Ü% c¨4¯?©?Ó;ˆ	ä$'¨¯	©	°4·>±>À4Ç:Á:ÈtÏzÉzÓ$Zò 	8Ñ ˆC��s˜Dà×Ñ ¨4×+@Ñ+@ÀÀdÈDÓ+QÔY_Ô`cÐdhÓ`iÐkoÓYpÐÔqØ×Ñ  T×%6Ñ%6Õ7ð	8ð
 ×"Ñ"Ó$ˆØ×Ñ˜GÔ$ô  w¼SÀÇÁÓ=PÔQÐQr   )	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r/   Ú__classcell__)r   s   @r   r	   r	   	   s)   ø„ ñð$5 ð 5¨õ 5ðR˜o÷ Rr   r	   N)	Útypingr   Úultralytics.solutions.solutionsr   r   r   Úultralytics.utils.plottingr   r	   r   r   r   ú<module>r8      s!   ðõ ç \Ñ \Ý -ô:R�õ :Rr   