MOTchallenge评测工具和deepsort跟踪结果可视化

MOTchallenge评测工具:https://bitbucket.org/amilan/motchallenge-devkit/
deepsort多目标跟踪代码:https://github.com/nwojke/deep_sort
MOTchallenge2016下载地址:https://motchallenge.net/data/MOT16/
参考链接:https://blog.youkuaiyun.com/u012435142/article/details/85255005

MOTchallenge评测工具

参考工具中的readme.md文件
1、编译工具包运行compile.m
2、编辑demo_evalMOT16.m,例如:
在这里插入图片描述第二行第一个参数是MOT2016的训练数据集列表,不需要修改
第二个参数是某个多目标跟踪算法生成的跟踪结果,作为实例供使用者测试,测试自己算法结果时需要替换修改
第三个是MOT2016的文件地址,注意最后的 \ 不能省略
第四个是测试集的名称
3、运行demo,结果如图
在这里插入图片描述
备注:MOTchallenge评测工具本身没有可视化脚本

deepsort跟踪结果可视化

参考主页运行代码
1、generating_detections.py
运行命令

python tools/generate_detections.py \
    --model=resources/networks/mars-small128.pb \
    --mot_dir=./MOT16/train \
    --output_dir=./resources/detections/MOT16_train

也可以在pycharm中打开修改,例如:
在这里插入图片描述记得把‘requested=True’删掉
运行之后如图:
在这里插入图片描述2、deep_sort_app.py
运行命令 ,注意要在工程目录下新建一个tmp文件夹

python deep_sort_app.py \
    --sequence_dir=./MOT16/test/MOT16-06 \
    --detection_file=./resources/detections/MOT16_POI_test/MOT16-06.npy \
    --min_confidence=0.3 \
    --nn_budget=100 \
    --display=True

也可以在pycharm中修改代码,例如
在这里插入图片描述在这里插入图片描述运行之后会在tmp文件中生成文件,如图:
在这里插入图片描述
3、show_results.py
1、修改代码,例如
在这里插入图片描述2、运行
在这里插入图片描述

使用MOTchallenge评测工具评测deepsort的跟踪结果

修改demo_evalMOT16.m
在这里插入图片描述最后结果:
在这里插入图片描述在这里插入图片描述
和原作者的评测结果怎么不一样,MOTA怎么这么低?
原因是原作者使用的检测文件不是MOT2016提供的

### 使用 DeepSORT 算法处理 MOT17 数据集 为了使用 DeepSORT 算法对 MOT17 数据集进行多目标跟踪,需准备环境并配置必要的参数。安装依赖库之后,重点在于调整检测模型特征提取网络。 #### 准备工作 确保已下载并解压了MOT17数据集到指定目录。该数据集中包含了多个视频序列以及对应的标注文件。对于DeepSORT而言,这些标注可以用于评估性能或者作为初始化输入的一部分[^1]。 #### 配置检测器 通常情况下,会先利用预训练的目标检测模型来获取每一帧中的候选框位置信息。可以选择YOLOv3、FairMOT等高效实时性强的检测框架,并将其集成至`deep_sort_yolov3`项目中以便于后续操作。 #### 特征提取模块设置 DeepSORT的核心之一就是通过Re-ID(重识别)技术获得高质量的人体外观描述子向量。此部分涉及到加载之前提到过的`ckpt.t7`权重文件,在`deep_sort/deep/checkpoint/`路径下找到它即可完成迁移学习过程。 #### 运行脚本编写 最后一步是创建Python脚本来串联上述组件: ```python from deep_sort import nn_matching from deep_sort.detection import Detection from deep_sort.tracker import Tracker import numpy as np import os.path import cv2 def gather_sequence_info(sequence_dir, detection_file): """Gathers information about the given sequence and track set. Parameters ---------- sequence_dir : str Path to the sequence directory (usually one of the train/test folders). detection_file : str Filename of the detection file containing bounding boxes. Returns ------- Dict A dictionary with keys 'image_filenames', 'detections' etc., holding relevant data structures. """ image_dir = os.path.join(sequence_dir, "img1") image_filenames = { int(os.path.splitext(f)[0]): os.path.join(image_dir, f) for f in os.listdir(image_dir)} detections = None if detection_file is not None: detections = np.load(detection_file) return {"image_filenames": image_filenames, "detections": detections} if __name__ == "__main__": metric = nn_matching.NearestNeighborDistanceMetric( "cosine", max_cosine_distance=0.2, budget=None) tracker = Tracker(metric) # Load model weights from ckpt.t7 here... sequences_root = './path/to/MOT17/train' output_path = './results' for seq_name in sorted(os.listdir(sequences_root)): seq_info = gather_sequence_info( os.path.join(sequences_root, seq_name), os.path.join('./path/to/detections/', '%s.npy'%seq_name)) # Process each frame... ```
评论 24
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值