-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
833 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
from .byte_tracker import BYTETracker as ByteTracker | ||
|
||
__all__ = ['ByteTracker'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import numpy as np | ||
from collections import OrderedDict | ||
|
||
|
||
class TrackState(object): | ||
New = 0 | ||
Tracked = 1 | ||
Lost = 2 | ||
Removed = 3 | ||
|
||
|
||
class BaseTrack(object): | ||
_count = 0 | ||
|
||
track_id = 0 | ||
is_activated = False | ||
state = TrackState.New | ||
|
||
history = OrderedDict() | ||
features = [] | ||
curr_feature = None | ||
score = 0 | ||
start_frame = 0 | ||
frame_id = 0 | ||
time_since_update = 0 | ||
|
||
# multi-camera | ||
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 activate(self, *args): | ||
raise NotImplementedError | ||
|
||
def predict(self): | ||
raise NotImplementedError | ||
|
||
def update(self, *args, **kwargs): | ||
raise NotImplementedError | ||
|
||
def mark_lost(self): | ||
self.state = TrackState.Lost | ||
|
||
def mark_removed(self): | ||
self.state = TrackState.Removed |
Oops, something went wrong.