Skip to content

Commit

Permalink
Use os.path.join and update video link.
Browse files Browse the repository at this point in the history
  • Loading branch information
abewley committed Nov 28, 2020
1 parent 3f548c0 commit bce9f0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -292,9 +292,9 @@ def parse_args():
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
Expand All @@ -303,7 +303,7 @@ def parse_args():
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')
Expand Down

0 comments on commit bce9f0d

Please sign in to comment.