─░├žeri─če ge├ž

Referans i├žin ultralytics/trackers/basetrack.py

Not

Bu dosya https://github.com/ultralytics/ultralytics/blob/main/ ultralytics/trackers/basetrack .py adresinde mevcuttur. Bir sorun tespit ederseniz l├╝tfen bir ├çekme ─░ste─či ­čŤá´ŞĆ ile katk─▒da bulunarak d├╝zeltilmesine yard─▒mc─▒ olun. Te┼čekk├╝rler ­čÖĆ!



ultralytics.trackers.basetrack.TrackState

─░zlenen bir nesnenin olas─▒ durumlar─▒n─▒ temsil eden numaraland─▒rma s─▒n─▒f─▒.

Nitelikler:

─░sim Tip A├ž─▒klama
New int

Nesne yeni tespit edildi─činde durum.

Tracked int

Nesne sonraki karelerde ba┼čar─▒yla izlendi─činde durum.

Lost int

Nesne art─▒k izlenmedi─činde durum.

Removed int

Nesne takipten ├ž─▒kar─▒ld─▒─č─▒nda durum.

Kaynak kodu ultralytics/trackers/basetrack.py
class TrackState:
    """
    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.
    """

    New = 0
    Tracked = 1
    Lost = 2
    Removed = 3



ultralytics.trackers.basetrack.BaseTrack

Nesne izleme i├žin temel nitelikler ve y├Ântemler sa─člayan temel s─▒n─▒f.

Nitelikler:

─░sim Tip A├ž─▒klama
_count int

Benzersiz par├ža kimlikleri i├žin s─▒n─▒f d├╝zeyinde saya├ž.

track_id int

Par├ža i├žin benzersiz tan─▒mlay─▒c─▒.

is_activated bool

Par├žan─▒n o anda aktif olup olmad─▒─č─▒n─▒ g├Âsteren bayrak.

state TrackState

Pistin ┼ču anki durumu.

history OrderedDict

Pistin eyaletlerinin s─▒ral─▒ ge├žmi┼či.

features list

─░zleme i├žin nesneden ├ž─▒kar─▒lan ├Âzelliklerin listesi.

curr_feature any

─░zlenen nesnenin ge├žerli ├Âzelli─či.

score float

─░zlemenin g├╝ven puan─▒.

start_frame int

─░zlemenin ba┼člad─▒─č─▒ ├žer├ževe numaras─▒.

frame_id int

Par├ža taraf─▒ndan i┼členen en son ├žer├ževe kimli─či.

time_since_update int

Son g├╝ncellemeden bu yana ge├žen ├žer├ževeler.

location tuple

├çoklu kamera takibi ba─člam─▒nda nesnenin konumu.

Y├Ântemler:

─░sim A├ž─▒klama
end_frame

Nesnenin izlendi─či son karenin kimli─čini d├Ând├╝r├╝r.

next_id

Bir sonraki global par├ža kimli─čini art─▒r─▒r ve d├Ând├╝r├╝r.

activate

Pisti etkinle┼čtirmek i├žin soyut y├Ântem.

predict

Pistin bir sonraki durumunu tahmin etmek i├žin soyut y├Ântem.

update

─░zi yeni verilerle g├╝ncellemek i├žin soyut y├Ântem.

mark_lost

─░zi kay─▒p olarak i┼čaretler.

mark_removed

Par├žay─▒ kald─▒r─▒lm─▒┼č olarak i┼čaretler.

reset_id

Global par├ža kimli─či sayac─▒n─▒ s─▒f─▒rlar.

Kaynak kodu ultralytics/trackers/basetrack.py
class BaseTrack:
    """
    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.
    """

    _count = 0

    def __init__(self):
        """Initializes a new track with unique ID and foundational tracking attributes."""
        self.track_id = 0
        self.is_activated = False
        self.state = TrackState.New
        self.history = OrderedDict()
        self.features = []
        self.curr_feature = None
        self.score = 0
        self.start_frame = 0
        self.frame_id = 0
        self.time_since_update = 0
        self.location = (np.inf, np.inf)

    @property
    def end_frame(self):
        """Return the last frame ID of the track."""
        return self.frame_id

    @staticmethod
    def next_id():
        """Increment and return the global track ID counter."""
        BaseTrack._count += 1
        return BaseTrack._count

    def activate(self, *args):
        """Abstract method to activate the track with provided arguments."""
        raise NotImplementedError

    def predict(self):
        """Abstract method to predict the next state of the track."""
        raise NotImplementedError

    def update(self, *args, **kwargs):
        """Abstract method to update the track with new observations."""
        raise NotImplementedError

    def mark_lost(self):
        """Mark the track as lost."""
        self.state = TrackState.Lost

    def mark_removed(self):
        """Mark the track as removed."""
        self.state = TrackState.Removed

    @staticmethod
    def reset_id():
        """Reset the global track ID counter."""
        BaseTrack._count = 0

end_frame property

Par├žan─▒n son kare kimli─čini d├Ând├╝r├╝r.

__init__()

Benzersiz kimli─če ve temel izleme niteliklerine sahip yeni bir par├ža ba┼člat─▒r.

Kaynak kodu ultralytics/trackers/basetrack.py
def __init__(self):
    """Initializes a new track with unique ID and foundational tracking attributes."""
    self.track_id = 0
    self.is_activated = False
    self.state = TrackState.New
    self.history = OrderedDict()
    self.features = []
    self.curr_feature = None
    self.score = 0
    self.start_frame = 0
    self.frame_id = 0
    self.time_since_update = 0
    self.location = (np.inf, np.inf)

activate(*args)

Sa─članan arg├╝manlarla pisti etkinle┼čtirmek i├žin soyut y├Ântem.

Kaynak kodu ultralytics/trackers/basetrack.py
def activate(self, *args):
    """Abstract method to activate the track with provided arguments."""
    raise NotImplementedError

mark_lost()

─░zi kay─▒p olarak i┼čaretleyin.

Kaynak kodu ultralytics/trackers/basetrack.py
def mark_lost(self):
    """Mark the track as lost."""
    self.state = TrackState.Lost

mark_removed()

Par├žay─▒ ├ž─▒kar─▒lm─▒┼č olarak i┼čaretleyin.

Kaynak kodu ultralytics/trackers/basetrack.py
def mark_removed(self):
    """Mark the track as removed."""
    self.state = TrackState.Removed

next_id() staticmethod

Global par├ža kimli─či sayac─▒n─▒ art─▒r─▒r ve d├Ând├╝r├╝r.

Kaynak kodu ultralytics/trackers/basetrack.py
@staticmethod
def next_id():
    """Increment and return the global track ID counter."""
    BaseTrack._count += 1
    return BaseTrack._count

predict()

Pistin bir sonraki durumunu tahmin etmek i├žin soyut y├Ântem.

Kaynak kodu ultralytics/trackers/basetrack.py
def predict(self):
    """Abstract method to predict the next state of the track."""
    raise NotImplementedError

reset_id() staticmethod

Global par├ža kimli─či sayac─▒n─▒ s─▒f─▒rlay─▒n.

Kaynak kodu ultralytics/trackers/basetrack.py
@staticmethod
def reset_id():
    """Reset the global track ID counter."""
    BaseTrack._count = 0

update(*args, **kwargs)

─░zi yeni g├Âzlemlerle g├╝ncellemek i├žin soyut y├Ântem.

Kaynak kodu ultralytics/trackers/basetrack.py
def update(self, *args, **kwargs):
    """Abstract method to update the track with new observations."""
    raise NotImplementedError





Created 2023-11-12, Updated 2024-06-02
Authors: glenn-jocher (5), Burhan-Q (1)