MCPcopy Index your code
hub / github.com/FoundationVision/ByteTrack / write_results

Method write_results

tutorials/motr/eval.py:351–360  ·  view source on GitHub ↗
(txt_path, frame_id, bbox_xyxy, identities)

Source from the content-addressed store, hash-verified

349
350 @staticmethod
351 def write_results(txt_path, frame_id, bbox_xyxy, identities):
352 save_format = '{frame},{id},{x1},{y1},{w},{h},1,-1,-1,-1\n'
353 with open(txt_path, 'a') as f:
354 for xyxy, track_id in zip(bbox_xyxy, identities):
355 if track_id < 0 or track_id is None:
356 continue
357 x1, y1, x2, y2 = xyxy
358 w, h = x2 - x1, y2 - y1
359 line = save_format.format(frame=int(frame_id), id=int(track_id), x1=x1, y1=y1, w=w, h=h)
360 f.write(line)
361
362 def eval_seq(self):
363 data_root = os.path.join(self.args.mot_path)

Callers 1

detectMethod · 0.95

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected