| 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' |
| 38 | with open(filename, 'w') as f: |
| 39 | for frame_id, tlwhs, track_ids in results: |
| 40 | for tlwh, track_id in zip(tlwhs, track_ids): |
| 41 | if track_id < 0: |
| 42 | continue |
| 43 | x1, y1, w, h = tlwh |
| 44 | 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)) |
| 45 | f.write(line) |
| 46 | |
| 47 | def run_each_dataset(model_dir, retinanet, dataset_path, subset, cur_dataset): |
| 48 | print(cur_dataset) |