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

Method __init__

tutorials/fairmot/tracker.py:179–204  ·  view source on GitHub ↗
(self, opt, frame_rate=30)

Source from the content-addressed store, hash-verified

177
178class JDETracker(object):
179 def __init__(self, opt, frame_rate=30):
180 self.opt = opt
181 if opt.gpus[0] >= 0:
182 opt.device = torch.device('cuda')
183 else:
184 opt.device = torch.device('cpu')
185 print('Creating model...')
186 self.model = create_model(opt.arch, opt.heads, opt.head_conv)
187 self.model = load_model(self.model, opt.load_model)
188 self.model = self.model.to(opt.device)
189 self.model.eval()
190
191 self.tracked_stracks = [] # type: list[STrack]
192 self.lost_stracks = [] # type: list[STrack]
193 self.removed_stracks = [] # type: list[STrack]
194
195 self.frame_id = 0
196 #self.det_thresh = opt.conf_thres
197 self.det_thresh = opt.conf_thres + 0.1
198 self.buffer_size = int(frame_rate / 30.0 * opt.track_buffer)
199 self.max_time_lost = self.buffer_size
200 self.max_per_image = opt.K
201 self.mean = np.array(opt.mean, dtype=np.float32).reshape(1, 1, 3)
202 self.std = np.array(opt.std, dtype=np.float32).reshape(1, 1, 3)
203
204 self.kalman_filter = KalmanFilter()
205
206 def post_process(self, dets, meta):
207 dets = dets.detach().cpu().numpy()

Callers

nothing calls this directly

Calls 2

KalmanFilterClass · 0.90
evalMethod · 0.45

Tested by

no test coverage detected