diff --git a/yolox/tracker/basetrack.py b/yolox/tracker/basetrack.py index a7130b5c..d5837b05 100644 --- a/yolox/tracker/basetrack.py +++ b/yolox/tracker/basetrack.py @@ -10,31 +10,31 @@ class TrackState(object): class BaseTrack(object): - _count = 0 + def __init__(self): + self._count = 0 - track_id = 0 - is_activated = False - state = TrackState.New + self.track_id = 0 + self.is_activated = False + self.state = TrackState.New - history = OrderedDict() - features = [] - curr_feature = None - score = 0 - start_frame = 0 - frame_id = 0 - time_since_update = 0 + 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 - # multi-camera - location = (np.inf, np.inf) + # multi-camera + self.location = (np.inf, np.inf) @property def end_frame(self): return self.frame_id - @staticmethod - def next_id(): - BaseTrack._count += 1 - return BaseTrack._count + def next_id(self): + self._count += 1 + return self._count def activate(self, *args): raise NotImplementedError @@ -49,4 +49,4 @@ def mark_lost(self): self.state = TrackState.Lost def mark_removed(self): - self.state = TrackState.Removed \ No newline at end of file + self.state = TrackState.Removed