diff --git a/README.md b/README.md index d55a8bc..dc1f791 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,21 @@ # YOLO v7 + 各种tracker实现多目标跟踪 +**** + +本人在写这个代码的时候, 没想到会有这么多人看到. 然而, 必须承认我这份代码是以尽量整合为目的, 加了我自己的理解, 所以有的部分也许和原论文有出入, 导致效果不一定是最好的. + +为此, 给大家推荐一个成熟的repo: (https://github.com/mikel-brostrom/yolo_tracking)[https://github.com/mikel-brostrom/yolo_tracking] + +我这个代码大家可以作为学习之用, 也就是熟悉MOT的流程. 如果追求更好的效果, 我建议采纳更成熟的那些. + +我会不断听取大家的问题和建议, 希望和大家一起学习! + +**** + ## 0. 近期更新 +**2023.10.24**: 对于botsort(`tracker/botsort.py line 358`)和bytetrack(`tracker/bytetrack.py line 89`), 在低置信度检测列表初始化, 改正原有错误 (原本写错了, 写的用`det_high`初始化). + **2023.9.16**: 对于`track_demo.py`, 由于`yolov7`的`non_maximum_supress`函数中已经对类别做了筛选, 因此删去了主程序中类别计算的部分, 并修复了一些小bug **2023.5.6[大更新]**: 对于v5, v7, 改变前处理和后处理方式(采用原有方式), ***解决了部分边界框近大远小的bug, 边界框更加精确***. 此外, 对于v8, 弃用了resize步骤, 直接推理. diff --git a/tracker/botsort.py b/tracker/botsort.py index b8108a6..c3cc65c 100644 --- a/tracker/botsort.py +++ b/tracker/botsort.py @@ -355,7 +355,7 @@ def update(self, det_results, ori_img): if det_low.shape[0] > 0: D_low = [STrack(cls, STrack.tlbr2tlwh(tlbr), score, kalman_format=self.opts.kalman_format) - for (cls, tlbr, score) in zip(det_high[:, -1], det_high[:, :4], det_high[:, 4])] + for (cls, tlbr, score) in zip(det_low[:, -1], det_low[:, :4], det_low[:, 4])] else: D_low = [] diff --git a/tracker/bytetrack.py b/tracker/bytetrack.py index 61eeee9..19cf74b 100644 --- a/tracker/bytetrack.py +++ b/tracker/bytetrack.py @@ -86,7 +86,7 @@ def update(self, det_results, ori_img): if det_low.shape[0] > 0: D_low = [STrack(cls, STrack.tlbr2tlwh(tlbr), score, kalman_format=self.opts.kalman_format) - for (cls, tlbr, score) in zip(det_high[:, -1], det_high[:, :4], det_high[:, 4])] + for (cls, tlbr, score) in zip(det_low[:, -1], det_low[:, :4], det_low[:, 4])] else: D_low = [] diff --git a/tracker/track_yolov8.py b/tracker/track_yolov8.py index f3aaa75..5765f51 100644 --- a/tracker/track_yolov8.py +++ b/tracker/track_yolov8.py @@ -176,7 +176,7 @@ def main(opts, cfgs): timer.toc() # end timing this image if opts.save_images: - plot_img(img0, frame_id, [cur_tlwh, cur_id, cur_cls], save_dir=os.path.join(DATASET_ROOT, 'reuslt_images', seq)) + plot_img(img0, frame_id, [cur_tlwh, cur_id, cur_cls], save_dir=os.path.join(DATASET_ROOT, 'result_images', seq)) frame_id += 1 @@ -305,7 +305,7 @@ def save_videos(seq_names): seq_names = [seq_names] for seq in seq_names: - images_path = os.path.join(DATASET_ROOT, 'reuslt_images', seq) + images_path = os.path.join(DATASET_ROOT, 'result_images', seq) images_name = sorted(os.listdir(images_path)) to_video_path = os.path.join(images_path, '../', seq + '.mp4')