Source code for pytb.tracking.tracker

"""
Copyright (c) 2021-2022 UCLouvain, ICTEAM
Licensed under GPL-3.0 [see LICENSE for details]
Written by Jonathan Samelson (2021-2022)
"""

from abc import ABC, abstractmethod
from pytb.output.detection import Detection


[docs]class Tracker(ABC):
[docs] @abstractmethod def __init__(self): """Initializes the tracker with the given parameters. """ super().__init__() self.need_frame = False
[docs] @abstractmethod def track(self, detection: Detection) -> Detection: """Performs a tracking method to match the IDs between frames. Args: detection (Detection): The detection used to infer IDs. Returns: Detection: A set of detections with the tracking information added. """ pass
[docs] @abstractmethod def reset_state(self): """Reset the current state of the tracker.""" pass