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

Method __init__

tutorials/motr/eval.py:288–316  ·  view source on GitHub ↗
(self, args, model=None, seq_num=2)

Source from the content-addressed store, hash-verified

286
287class Detector(object):
288 def __init__(self, args, model=None, seq_num=2):
289
290 self.args = args
291 self.detr = model
292
293 self.seq_num = seq_num
294 img_list = os.listdir(os.path.join(self.args.mot_path, self.seq_num, 'img1'))
295 img_list = [os.path.join(self.args.mot_path, self.seq_num, 'img1', _) for _ in img_list if
296 ('jpg' in _) or ('png' in _)]
297
298 self.img_list = sorted(img_list)
299 self.img_len = len(self.img_list)
300 self.tr_tracker = MOTR()
301
302 '''
303 common settings
304 '''
305 self.img_height = 800
306 self.img_width = 1536
307 self.mean = [0.485, 0.456, 0.406]
308 self.std = [0.229, 0.224, 0.225]
309
310 self.save_path = os.path.join(self.args.output_dir, 'results/{}'.format(seq_num))
311 os.makedirs(self.save_path, exist_ok=True)
312
313 self.predict_path = os.path.join(self.args.output_dir, 'preds', self.seq_num)
314 os.makedirs(self.predict_path, exist_ok=True)
315 if os.path.exists(os.path.join(self.predict_path, 'gt.txt')):
316 os.remove(os.path.join(self.predict_path, 'gt.txt'))
317
318 def load_img_from_file(self,f_path):
319 label_path = f_path.replace('images', 'labels_with_ids').replace('.png', '.txt').replace('.jpg', '.txt')

Callers

nothing calls this directly

Calls 1

MOTRClass · 0.70

Tested by

no test coverage detected