§
    ezniü  ã                   óN   — d dl mZ d dlZ G d„ d¦  «        Z G d„ d¦  «        ZdS )é    )ÚOrderedDictNc                   ó"   — e Zd ZdZdZdZdZdZdS )Ú
TrackStatea‡  
    Enumeration class representing the possible states of an object being tracked.

    Attributes:
        New (int): State when the object is newly detected.
        Tracked (int): State when the object is successfully tracked in subsequent frames.
        Lost (int): State when the object is no longer tracked.
        Removed (int): State when the object is removed from tracking.
    r   é   é   é   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚNewÚTrackedÚLostÚRemoved© ó    ú~/var/www/html/cool-property-finder/image-detection-backend/venv/lib/python3.11/site-packages/ultralytics/trackers/basetrack.pyr   r   	   s.   € € € € € ðð ð €CØ€GØ€DØ€G€G€Gr   r   c                   ó|   — e Zd ZdZdZd„ Zed„ ¦   «         Zed„ ¦   «         Z	d„ Z
d„ Zd„ Zd	„ Zd
„ Zed„ ¦   «         ZdS )Ú	BaseTracka¼  
    Base class for object tracking, providing foundational attributes and methods.

    Attributes:
        _count (int): Class-level counter for unique track IDs.
        track_id (int): Unique identifier for the track.
        is_activated (bool): Flag indicating whether the track is currently active.
        state (TrackState): Current state of the track.
        history (OrderedDict): Ordered history of the track's states.
        features (list): List of features extracted from the object for tracking.
        curr_feature (any): The current feature of the object being tracked.
        score (float): The confidence score of the tracking.
        start_frame (int): The frame number where tracking started.
        frame_id (int): The most recent frame ID processed by the track.
        time_since_update (int): Frames passed since the last update.
        location (tuple): The location of the object in the context of multi-camera tracking.

    Methods:
        end_frame: Returns the ID of the last frame where the object was tracked.
        next_id: Increments and returns the next global track ID.
        activate: Abstract method to activate the track.
        predict: Abstract method to predict the next state of the track.
        update: Abstract method to update the track with new data.
        mark_lost: Marks the track as lost.
        mark_removed: Marks the track as removed.
        reset_id: Resets the global track ID counter.
    r   c                 óø   — d| _         d| _        t          j        | _        t          ¦   «         | _        g | _        d | _        d| _	        d| _
        d| _        d| _        t          j        t          j        f| _        d S )Nr   F)Útrack_idÚis_activatedr   r   Ústater   ÚhistoryÚfeaturesÚcurr_featureÚscoreÚstart_frameÚframe_idÚtime_since_updateÚnpÚinfÚlocation©Úselfs    r   Ú__init__zBaseTrack.__init__9   sf   € ØˆŒØ!ˆÔÝ”^ˆŒ
Ý"‘}”}ˆŒØˆŒØ ˆÔØˆŒ
ØˆÔØˆŒØ!"ˆÔÝœ¥¤Ð(ˆŒˆˆr   c                 ó   — | j         S )z&Return the last frame ID of the track.)r   r$   s    r   Ú	end_framezBaseTrack.end_frameF   s   € ð Œ}Ðr   c                  óD   — t           xj        dz  c_        t           j        S )z1Increment and return the global track ID counter.r   ©r   Ú_countr   r   r   Únext_idzBaseTrack.next_idK   s!   € õ 	ÐÔ˜AÑÐÔÝÔÐr   c                 ó   — t           ‚)z>Abstract method to activate the track with provided arguments.©ÚNotImplementedError)r%   Úargss     r   ÚactivatezBaseTrack.activateQ   ó   € å!Ð!r   c                 ó   — t           ‚)z7Abstract method to predict the next state of the track.r.   r$   s    r   ÚpredictzBaseTrack.predictU   r2   r   c                 ó   — t           ‚)z:Abstract method to update the track with new observations.r.   )r%   r0   Úkwargss      r   ÚupdatezBaseTrack.updateY   r2   r   c                 ó(   — t           j        | _        dS )zMark the track as lost.N)r   r   r   r$   s    r   Ú	mark_lostzBaseTrack.mark_lost]   s   € å”_ˆŒ
ˆ
ˆ
r   c                 ó(   — t           j        | _        dS )zMark the track as removed.N)r   r   r   r$   s    r   Úmark_removedzBaseTrack.mark_removeda   s   € åÔ'ˆŒ
ˆ
ˆ
r   c                  ó   — dt           _        dS )z"Reset the global track ID counter.r   Nr*   r   r   r   Úreset_idzBaseTrack.reset_ide   s   € ð �	ÔÐÐr   N)r	   r
   r   r   r+   r&   Úpropertyr(   Ústaticmethodr,   r1   r4   r7   r9   r;   r=   r   r   r   r   r      sÐ   € € € € € ðð ð8 €Fð)ð )ð )ð ðð ñ „Xðð ð ð  ñ „\ð ð
"ð "ð "ð"ð "ð "ð"ð "ð "ð%ð %ð %ð(ð (ð (ð ðð ñ „\ðð ð r   r   )Úcollectionsr   Únumpyr!   r   r   r   r   r   ú<module>rB      s‰   ðð $Ð #Ð #Ð #Ð #Ð #à Ð Ð Ð ðð ð ð ð ñ ô ð ð"Nð Nð Nð Nð Nñ Nô Nð Nð Nð Nr   