You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
804 B
32 lines
804 B
"""Base classes for trackers."""
|
|
|
|
class BaseTracker:
|
|
"""Base class for all trackers."""
|
|
|
|
def __init__(self, params):
|
|
"""Initialize the tracker.
|
|
|
|
args:
|
|
params: Tracker parameters.
|
|
"""
|
|
self.params = params
|
|
|
|
def initialize(self, image, state):
|
|
"""Initialize the tracker with an image and target state.
|
|
|
|
args:
|
|
image: First frame
|
|
state: Target state in first frame, usually a bounding box [x, y, w, h]
|
|
"""
|
|
raise NotImplementedError
|
|
|
|
def track(self, image):
|
|
"""Track in the current frame.
|
|
|
|
args:
|
|
image: Current image
|
|
|
|
returns:
|
|
State of the target, usually a bounding box [x, y, w, h]
|
|
"""
|
|
raise NotImplementedError
|