Skip to content

Commit 97fc377

Browse files
committed
fix some bugs of reid model in bytetrack
1 parent 70921cd commit 97fc377

20 files changed

+3
-153
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

run_yolov7.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,5 @@ train:
5959
CUDA_VISIBLE_DEVICES=0 python train_aux.py --dataset mot17 --workers 8 --device 0 --batch-size 16 --data data/mot17.yaml --img 1280 1280 --cfg cfg/training/yolov7-w6.yaml --weights './weights/yolov7-w6_training.pt' --name yolov7-w6-custom --hyp data/hyp.scratch.custom.yaml
6060

6161
track:
62-
python tracker/track.py --dataset mot17 --data_format yolo --tracker sort --model_path runs/train/yolov7-w6-custom3/weights/best.pt --save_images
62+
python tracker/track.py --dataset mot17 --data_format yolo --tracker sort --model_path runs/train/yolov7-w6-custom3/weights/best.pt --save_images
63+
python tracker/track.py --dataset mot17 --data_format yolo --tracker bytetrack --model_path weights/best.pt --save_images
0 Bytes
Binary file not shown.
-66 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

tracker/basetrack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def update(self, new_track, frame_id):
303303
self.mean, self.cov, measurement)
304304

305305
# update feature
306-
if self.has_feature:
306+
if new_track.has_feature:
307307
feature = new_track.features[0] / np.linalg.norm(new_track.features[0]) # (512, )
308308
if self.use_avg_of_feature:
309309
smooth_feat = 0.9 * self.features[-1] + (1 - 0.9) * feature

tracker/botsort.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,6 @@ def update(self, det_results, ori_img):
400400
IoU_dist = matching.iou_distance(strack_pool, D_high) # IoU dist
401401
if self.use_apperance_model:
402402
Apperance_dist = 0.5*matching.embedding_distance(strack_pool, D_high, metric='cosine')
403-
Dist_mat = self.gamma*IoU_dist + (1. - self.gamma)*Apperance_dist
404403
# equation (12)-(13) in paper
405404
Apperance_dist[IoU_dist > self.theta_iou] = 1
406405
Apperance_dist[Apperance_dist > self.theta_emb] = 1
@@ -455,7 +454,6 @@ def update(self, det_results, ori_img):
455454
IoU_dist = matching.iou_distance(unconfirmed, u_dets0)
456455
if self.use_apperance_model:
457456
Apperance_dist = 0.5*matching.embedding_distance(unconfirmed, u_dets0, metric='cosine')
458-
Dist_mat = self.gamma*IoU_dist + (1. - self.gamma)*Apperance_dist
459457
# equation (12)-(13) in paper
460458
Apperance_dist[IoU_dist > self.theta_iou] = 1
461459
Apperance_dist[Apperance_dist > self.theta_emb] = 1

0 commit comments

Comments
 (0)