diff --git a/README.md b/README.md index fe5edde..4d2b997 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ SORT ===== 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 diff --git a/sort.py b/sort.py index 6502947..4b2ca8a 100644 --- a/sort.py +++ b/sort.py @@ -46,7 +46,7 @@ def linear_assignment(cost_matrix): 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_test = np.expand_dims(bb_test, 1) @@ -292,9 +292,9 @@ if __name__ == '__main__': min_hits=args.min_hits, iou_threshold=args.iou_threshold) #create instance of the SORT tracker 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)) for frame in range(int(seq_dets[:,0].max())): frame += 1 #detection and frame numbers begin at 1 @@ -303,7 +303,7 @@ if __name__ == '__main__': total_frames += 1 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) ax1.imshow(im) plt.title(seq + ' Tracked Targets')