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

Function write_results

tutorials/ctracker/test_byte.py:25–34  ·  view source on GitHub ↗
(filename, results)

Source from the content-addressed store, hash-verified

23
24
25def write_results(filename, results):
26 save_format = '{frame},{id},{x1},{y1},{w},{h},{s},-1,-1,-1\n'
27 with open(filename, 'w') as f:
28 for frame_id, tlwhs, track_ids, scores in results:
29 for tlwh, track_id, score in zip(tlwhs, track_ids, scores):
30 if track_id < 0:
31 continue
32 x1, y1, w, h = tlwh
33 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))
34 f.write(line)
35
36def write_results_no_score(filename, results):
37 save_format = '{frame},{id},{x1},{y1},{w},{h},-1,-1,-1,-1\n'

Callers 1

run_each_datasetFunction · 0.70

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected