Use os.path.join and update video link.

This commit is contained in:
Alex Bewley 2020-11-28 20:29:29 +01:00
parent 3f548c04e7
commit bce9f0d1fc
2 changed files with 5 additions and 5 deletions

View file

@ -2,7 +2,7 @@ SORT
===== =====
A simple online and realtime tracking algorithm for 2D multiple object tracking in video sequences. A simple online and realtime tracking algorithm for 2D multiple object tracking in video sequences.
See an example [video here](https://motchallenge.net/movies/ETH-Linthescher-SORT.mp4). See an example [video here](https://alex.bewley.ai/misc/SORT-MOT17-06-FRCNN.webm).
By Alex Bewley By Alex Bewley

View file

@ -46,7 +46,7 @@ def linear_assignment(cost_matrix):
def iou_batch(bb_test, bb_gt): def iou_batch(bb_test, bb_gt):
""" """
From SORT: Computes IUO between two bboxes in the form [x1,y1,x2,y2] From SORT: Computes IOU between two bboxes in the form [x1,y1,x2,y2]
""" """
bb_gt = np.expand_dims(bb_gt, 0) bb_gt = np.expand_dims(bb_gt, 0)
bb_test = np.expand_dims(bb_test, 1) bb_test = np.expand_dims(bb_test, 1)
@ -292,9 +292,9 @@ if __name__ == '__main__':
min_hits=args.min_hits, min_hits=args.min_hits,
iou_threshold=args.iou_threshold) #create instance of the SORT tracker iou_threshold=args.iou_threshold) #create instance of the SORT tracker
seq_dets = np.loadtxt(seq_dets_fn, delimiter=',') seq_dets = np.loadtxt(seq_dets_fn, delimiter=',')
seq = seq_dets_fn[pattern.find('*'):].split('/')[0] seq = seq_dets_fn[pattern.find('*'):].split(os.path.sep)[0]
with open('output/%s.txt'%(seq),'w') as out_file: with open(os.path.join('output', '%s.txt'%(seq)),'w') as out_file:
print("Processing %s."%(seq)) print("Processing %s."%(seq))
for frame in range(int(seq_dets[:,0].max())): for frame in range(int(seq_dets[:,0].max())):
frame += 1 #detection and frame numbers begin at 1 frame += 1 #detection and frame numbers begin at 1
@ -303,7 +303,7 @@ if __name__ == '__main__':
total_frames += 1 total_frames += 1
if(display): if(display):
fn = 'mot_benchmark/%s/%s/img1/%06d.jpg'%(phase, seq, frame) fn = os.path.join('mot_benchmark', phase, seq, 'img1', '%06d.jpg'%(frame))
im =io.imread(fn) im =io.imread(fn)
ax1.imshow(im) ax1.imshow(im)
plt.title(seq + ' Tracked Targets') plt.title(seq + ' Tracked Targets')