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

Fix the inheritance problem of STrack, and import name #222

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
11 changes: 6 additions & 5 deletions yolox/tracker/basetrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class TrackState(object):


class BaseTrack(object):
def __init__(self):
self._count = 0
_count = 0

def __init__(self):
self.track_id = 0
self.is_activated = False
self.state = TrackState.New
Expand All @@ -32,9 +32,10 @@ def __init__(self):
def end_frame(self):
return self.frame_id

def next_id(self):
self._count += 1
return self._count
@staticmethod
def next_id():
BaseTrack._count += 1
return BaseTrack._count

def activate(self, *args):
raise NotImplementedError
Expand Down
4 changes: 2 additions & 2 deletions yolox/tracker/byte_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import torch.nn.functional as F

from .kalman_filter import KalmanFilter
from yolox.tracker import matching
from . import matching
from .basetrack import BaseTrack, TrackState

class STrack(BaseTrack):
shared_kalman = KalmanFilter()
def __init__(self, tlwh, score):

super().__init__()
# wait activate
self._tlwh = np.asarray(tlwh, dtype=np.float)
self.kalman_filter = None
Expand Down
2 changes: 1 addition & 1 deletion yolox/tracker/matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from scipy.spatial.distance import cdist

from cython_bbox import bbox_overlaps as bbox_ious
from yolox.tracker import kalman_filter
from . import kalman_filter
import time

def merge_matches(m1, m2, shape):
Expand Down