这个小项目的目的是将对象跟踪添加到yolov2并实现实时多个对象跟踪。
当前的体系结构仅设置为仅跟踪一种类型的对象,但是应该易于概括所有对象。
目前支持人们跟踪(因为Deep_sort提供的权重接受了人们跟踪的培训)
python
numpy
opencv 3
tensorflow 1.0
Cython.
sklean.
用于使用排序:
scikit-learn
scikit-image
FilterPy
1-克隆此存储库: git clone https://github.com/bendidi/Tracking-with-darkflow.git
2-初始化所有子模型: git submodule update --init --recursive
3-转到DarkFlow目录并进行到位构建: python3 setup.py build_ext --inplace
下载权重:
在此处阅读有关Yolo(在DarkNet中)的更多信息,并在此处下载权重文件,如果找不到重量文件,Trieu已将其上载在此处,其中包括V1.0的yolo-full和yolo-tiny ,V1.1的tiny-yolo-v1.1和yolo的Tiny-Yolo-V1.1和Yolo,Yolo, tiny-yolo-voc v2 v2。
我在此项目中使用/测试的Artchituction是cfg/yolo.cfg ,重物bin/yolo.weights 。
接下来,您需要在此处下载deep_sort权重(网络文件夹),由nwojke提供
NWOJKE提供的Deep_sort权重已取消。您可以从这里获得它们(感谢 @louxy126)
提取文件夹并将其复制到deep_sort/resources
在run.py中编辑标志以下配置:
demo :要使用的视频文件的路径,如果您想使用相机,请将“相机”设置为“相机”
model :用于Yolo的模型配置,您可以在此处获取更多信息和.cfg文件(将它们放入DarkFlof/ cfg/文件夹中)
load :与所选型号一起使用的相应权重(将它们放入DarkFlow/bin/)更多信息。
threshold :Yolo检测的信心阈值
gpu :要使用多少GPU,0表示使用CPU
track :激活跟踪是否
trackObj :哪些对象可以跟踪为列表(请注意,Deep_sort的编码器仅受到人的培训,因此您需要训练自己的编码器,其中更多信息)
saveVideo :是否保存视频
BK_MOG :添加OpenCV的MOG背景减法模块,仅当Yolo无法检测到视频中的人(低质量,...)时使用它来检测围绕移动对象的框
tracker :要使用的跟踪器:“ deep_sort”或“ sort”
**NOTE** : "deep_sort" only supports people tracking as it was only trained to track people(the code for training is not yet published)
**TODO** : add support for GOTURN tracker(tensorflow implementation)
**TODO** : add support for opencv trackers (MIL,KCF,TLD,MEDIANFLOW)
skip :跳过框架以增加FPS,可能会降低准确性!
csv :以格式保存检测的CSV文件(frame_id,object_id,x,y,w,h)
display :处理是否在处理时显示视频
接下来,您只需要运行python run.py ,然后享受!
`使用yolo.cfg的速度:
YOLO with track Flag set to False : 30fps
YOLO with track Flag set to True (deep_sort) : 14 fps
YOLO with track and background subtraction Flags set to True : 10.5 fps
在(1024,1280,3)NVIDIA GTX 1080上的分辨率视频上进行的测试
跳过多达3帧可以提高速度,同时保持跟踪的准确性
该项目使用的代码来自以下方式:
Trieu/DarkFlow:用于实时对象检测和分类。
nwojke/deep_sort:使用深层关联度量的简单在线实时跟踪。
请关注链接以了解每个项目的所有功能。
@article{redmon2016yolo9000,
title={YOLO9000: Better, Faster, Stronger},
author={Redmon, Joseph and Farhadi, Ali},
journal={arXiv preprint arXiv:1612.08242},
year={2016}
}
@article{Wojke2017simple,
title={Simple Online and Realtime Tracking with a Deep Association Metric},
author={Wojke, Nicolai and Bewley, Alex and Paulus, Dietrich},
journal={arXiv preprint arXiv:1703.07402},
year={2017}
}
@inproceedings{Bewley2016_sort,
author={Bewley, Alex and Ge, Zongyuan and Ott, Lionel and Ramos, Fabio and Upcroft, Ben},
booktitle={2016 IEEE International Conference on Image Processing (ICIP)},
title={Simple online and realtime tracking},
year={2016},
pages={3464-3468},
keywords={Benchmark testing;Complexity theory;Detectors;Kalman filters;Target tracking;Visualization;Computer Vision;Data Association;Detection;Multiple Object Tracking},
doi={10.1109/ICIP.2016.7533003}
}