Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change BaseTrack attributes to Object attributes #190

Merged
merged 1 commit into from
Jun 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions yolox/tracker/basetrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,4 +49,4 @@ def mark_lost(self):
self.state = TrackState.Lost

def mark_removed(self):
self.state = TrackState.Removed
self.state = TrackState.Removed