# Deep Sort with PyTorch
![](demo/demo.gif)
## Update(1-1-2020)
Changes
- fix bugs
- refactor code
- accerate detection by adding nms on gpu
## Latest Update(07-22)
Changes
- bug fix (Thanks @JieChen91 and @yingsen1 for bug reporting).
- using batch for feature extracting for each frame, which lead to a small speed up.
- code improvement.
Futher improvement direction
- Train detector on specific dataset rather than the official one.
- Retrain REID model on pedestrain dataset for better performance.
- Replace YOLOv3 detector with advanced ones.
**Any contributions to this repository is welcome!**
## Introduction
This is an implement of MOT tracking algorithm deep sort. Deep sort is basicly the same with sort but added a CNN model to extract features in image of human part bounded by a detector. This CNN model is indeed a RE-ID model and the detector used in [PAPER](https://arxiv.org/abs/1703.07402) is FasterRCNN , and the original source code is [HERE](https://github.com/nwojke/deep_sort).
However in original code, the CNN model is implemented with tensorflow, which I'm not familier with. SO I re-implemented the CNN feature extraction model with PyTorch, and changed the CNN model a little bit. Also, I use **YOLOv3** to generate bboxes instead of FasterRCNN.
## Dependencies
- python 3 (python2 not sure)
- numpy
- scipy
- opencv-python
- sklearn
- torch >= 0.4
- torchvision >= 0.1
- pillow
- vizer
- edict
## Quick Start
0. Check all dependencies installed
```bash
pip install -r requirements.txt
```
for user in china, you can specify pypi source to accelerate install like:
```bash
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
```
1. Clone this repository
```
git clone [email protected]:ZQPei/deep_sort_pytorch.git
```
2. Download YOLOv3 parameters
```
cd detector/YOLOv3/weight/
wget https://pjreddie.com/media/files/yolov3.weights
wget https://pjreddie.com/media/files/yolov3-tiny.weights
cd ../../../
```
3. Download deepsort parameters ckpt.t7
```
cd deep_sort/deep/checkpoint
# download ckpt.t7 from
https://drive.google.com/drive/folders/1xhG0kRH1EX5B9_Iz8gQJb7UNnn_riXi6 to this folder
cd ../../../
```
4. Compile nms module
```bash
cd detector/YOLOv3/nms
sh build.sh
cd ../../..
```
Notice:
If compiling failed, the simplist way is to **Upgrade your pytorch >= 1.1 and torchvision >= 0.3" and you can avoid the troublesome compiling problems which are most likely caused by either `gcc version too low` or `libraries missing`.
5. Run demo
```
usage: python yolov3_deepsort.py VIDEO_PATH
[--help]
[--frame_interval FRAME_INTERVAL]
[--config_detection CONFIG_DETECTION]
[--config_deepsort CONFIG_DEEPSORT]
[--display]
[--display_width DISPLAY_WIDTH]
[--display_height DISPLAY_HEIGHT]
[--save_path SAVE_PATH]
[--cpu]
# yolov3 + deepsort
python yolov3_deepsort.py [VIDEO_PATH]
# yolov3_tiny + deepsort
python yolov3_deepsort.py [VIDEO_PATH] --config_detection ./configs/yolov3_tiny.yaml
# yolov3 + deepsort on webcam
python3 yolov3_deepsort.py /dev/video0 --camera 0
# yolov3_tiny + deepsort on webcam
python3 yolov3_deepsort.py /dev/video0 --config_detection ./configs/yolov3_tiny.yaml --camera 0
```
Use `--display` to enable display.
Results will be saved to `./output/results.avi` and `./output/results.txt`.
All files above can also be accessed from BaiduDisk!
linker:[BaiduDisk](https://pan.baidu.com/s/1YJ1iPpdFTlUyLFoonYvozg)
passwd:fbuw
## Training the RE-ID model
The original model used in paper is in original_model.py, and its parameter here [original_ckpt.t7](https://drive.google.com/drive/folders/1xhG0kRH1EX5B9_Iz8gQJb7UNnn_riXi6).
To train the model, first you need download [Market1501](http://www.liangzheng.com.cn/Project/project_reid.html) dataset or [Mars](http://www.liangzheng.com.cn/Project/project_mars.html) dataset.
Then you can try [train.py](deep_sort/deep/train.py) to train your own parameter and evaluate it using [test.py](deep_sort/deep/test.py) and [evaluate.py](deep_sort/deep/evalute.py).
![train.jpg](deep_sort/deep/train.jpg)
## Demo videos and images
[demo.avi](https://drive.google.com/drive/folders/1xhG0kRH1EX5B9_Iz8gQJb7UNnn_riXi6)
[demo2.avi](https://drive.google.com/drive/folders/1xhG0kRH1EX5B9_Iz8gQJb7UNnn_riXi6)
![1.jpg](demo/1.jpg)
![2.jpg](demo/2.jpg)
## References
- paper: [Simple Online and Realtime Tracking with a Deep Association Metric](https://arxiv.org/abs/1703.07402)
- code: [nwojke/deep_sort](https://github.com/nwojke/deep_sort)
- paper: [YOLOv3](https://pjreddie.com/media/files/papers/YOLOv3.pdf)
- code: [Joseph Redmon/yolov3](https://pjreddie.com/darknet/yolo/)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
《计算机毕业设计:基于YOLOv8-DeepSORT实现的智能车辆目标检测系统》是一项结合深度学习技术和计算机视觉算法的综合性计算机毕业设计项目。该项目旨在利用先进的YOLOv8目标检测算法和DeepSORT多目标跟踪算法,实现智能车辆对道路目标的准确检测与跟踪,为智能交通、自动驾驶等领域提供技术支持。 该项目以YOLOv8算法为核心,该算法以其出色的实时性和准确性在目标检测领域崭露头角。结合DeepSORT算法,系统能够实现对检测到的目标进行连续、稳定的跟踪,即使在目标遮挡、交叉等复杂情况下也能保持较高的跟踪精度。 在实现过程中,该项目充分利用了深度学习框架的强大功能,通过训练和优化模型,使系统能够适应不同场景下的目标检测需求。同时,项目还提供了完整的源码和详细的说明文档,方便学习者进行深入研究和实践。 源码编写规范,注释清晰,易于理解,有助于学习者快速掌握系统的实现原理和技术细节。说明文档则对项目的背景、目标、实现过程以及技术难点进行了全面阐述,为学习者提供了宝贵的参考资料。 此外,该项目还附赠了计算机答辩PPT模板,为学习者的毕业设计答辩提供了便利。
资源推荐
资源详情
资源评论
收起资源包目录
计算机毕业设计:基于YOLOv8-DeepSORT实现的智能车辆目标检测系统(源码+说明),保证可靠运行,赠计算机答辩PPT模板 (326个子文件)
setup.cfg 2KB
.gitignore 2KB
.gitignore 89B
.gitkeep 0B
MANIFEST.in 113B
YOLOv8_Detection_Tracking_CustomData_Complete.ipynb 21.58MB
YOLOv8_DeepSORT_TRACKING_SCRIPT.ipynb 15.85MB
train.jpg 59KB
LICENSE 1KB
predict.log 655B
CONTRIBUTING.md 6KB
README.md 5KB
README.md 3KB
README.md 2KB
README.md 65B
test3.mp4 14.96MB
test3.mp4 4.75MB
test3.mp4 44B
PKG-INFO 5KB
figure3.png 2.81MB
figure1.png 2.68MB
figure2.png 2.51MB
yolov8l.pt 83.7MB
v5loader.py 55KB
exporter.py 40KB
augment.py 31KB
modules.py 30KB
ops.py 25KB
trainer.py 25KB
metrics.py 23KB
autobackend.py 20KB
tasks.py 18KB
v5augmentations.py 17KB
torch_utils.py 16KB
plotting.py 14KB
__init__.py 14KB
utils.py 13KB
predict.py 12KB
val.py 12KB
predictor.py 11KB
json_logger.py 11KB
instance.py 11KB
stream_loaders.py 11KB
checks.py 10KB
train.py 10KB
tal.py 10KB
dataset.py 10KB
validator.py 9KB
base.py 9KB
model.py 8KB
linear_assignment.py 8KB
linear_assignment.py 8KB
kalman_filter.py 8KB
kalman_filter.py 8KB
utils.py 7KB
downloads.py 6KB
train.py 6KB
nn_matching.py 6KB
nn_matching.py 6KB
tracker.py 5KB
__init__.py 5KB
build.py 5KB
track.py 5KB
session.py 5KB
io.py 4KB
files.py 4KB
deep_sort.py 4KB
hydra_patch.py 4KB
evaluation.py 3KB
model.py 3KB
original_model.py 3KB
base.py 3KB
autobatch.py 3KB
iou_matching.py 3KB
iou_matching.py 3KB
hub.py 3KB
auth.py 2KB
test.py 2KB
setup.py 2KB
dist.py 2KB
loss.py 2KB
preprocessing.py 2KB
preprocessing.py 2KB
clearml.py 2KB
cli.py 2KB
feature_extractor.py 2KB
comet.py 2KB
detection.py 1KB
dataset_wrappers.py 1KB
__init__.py 1KB
draw.py 1KB
parser.py 1KB
tensorboard.py 752B
tools.py 734B
__init__.py 500B
log.py 480B
asserts.py 316B
evaluate.py 307B
__init__.py 271B
__init__.py 268B
共 326 条
- 1
- 2
- 3
- 4
资源评论
小新要变强
- 粉丝: 2w+
- 资源: 539
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于opencv的人脸识别考勤系统python源码+数据.zip
- IOT安装包 iotech-iot-1.5-dev-1.5.0-amd64.deb
- 基于物品的协同过滤算法(推荐视频)工具类(见仁见智)
- 21信管2班 武学芹组+独立样本T检验数据分析案例.zip
- demo_ccms_global_open_wlan.py
- 小程序项目源码-小契约(交友互动小程序).zip
- 小程序项目源码-健身房预约课程小程序.zip
- 小程序项目源码-wechat-app-xiaoyima-master小程序.zip
- 小程序项目源码-滑动选项卡小程序.zip
- 小程序项目源码-学习Demo影视推荐、音乐播放、地图小程序.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功