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

Function write_results

tools/demo_track.py:104–114  ·  view source on GitHub ↗
(filename, results)

Source from the content-addressed store, hash-verified

102
103
104def write_results(filename, results):
105 save_format = '{frame},{id},{x1},{y1},{w},{h},{s},-1,-1,-1\n'
106 with open(filename, 'w') as f:
107 for frame_id, tlwhs, track_ids, scores in results:
108 for tlwh, track_id, score in zip(tlwhs, track_ids, scores):
109 if track_id < 0:
110 continue
111 x1, y1, w, h = tlwh
112 line = save_format.format(frame=frame_id, id=track_id, x1=round(x1, 1), y1=round(y1, 1), w=round(w, 1), h=round(h, 1), s=round(score, 2))
113 f.write(line)
114 logger.info('save results to {}'.format(filename))
115
116
117class Predictor(object):

Callers

nothing calls this directly

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected