MCPcopy Create free account
hub / github.com/FoundationVision/ByteTrack / __init__

Method __init__

tutorials/fairmot/byte_tracker.py:157–182  ·  view source on GitHub ↗
(self, opt, frame_rate=30)

Source from the content-addressed store, hash-verified

155
156class BYTETracker(object):
157 def __init__(self, opt, frame_rate=30):
158 self.opt = opt
159 if opt.gpus[0] >= 0:
160 opt.device = torch.device('cuda')
161 else:
162 opt.device = torch.device('cpu')
163 print('Creating model...')
164 self.model = create_model(opt.arch, opt.heads, opt.head_conv)
165 self.model = load_model(self.model, opt.load_model)
166 self.model = self.model.to(opt.device)
167 self.model.eval()
168
169 self.tracked_stracks = [] # type: list[STrack]
170 self.lost_stracks = [] # type: list[STrack]
171 self.removed_stracks = [] # type: list[STrack]
172
173 self.frame_id = 0
174 #self.det_thresh = opt.conf_thres
175 self.det_thresh = opt.conf_thres + 0.1
176 self.buffer_size = int(frame_rate / 30.0 * opt.track_buffer)
177 self.max_time_lost = self.buffer_size
178 self.max_per_image = opt.K
179 self.mean = np.array(opt.mean, dtype=np.float32).reshape(1, 1, 3)
180 self.std = np.array(opt.std, dtype=np.float32).reshape(1, 1, 3)
181
182 self.kalman_filter = KalmanFilter()
183
184 def post_process(self, dets, meta):
185 dets = dets.detach().cpu().numpy()

Callers

nothing calls this directly

Calls 2

KalmanFilterClass · 0.90
evalMethod · 0.45

Tested by

no test coverage detected