(filename, results)
| 23 | |
| 24 | |
| 25 | def 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 | |
| 36 | def write_results_no_score(filename, results): |
| 37 | save_format = '{frame},{id},{x1},{y1},{w},{h},-1,-1,-1,-1\n' |
no test coverage detected