# 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 git@github.com: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+UCMCTrack/DeepSort+注意力机制的多目标跟踪系统
共697个文件
png:260个
py:194个
pyc:162个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 117 浏览量
2024-05-15
17:36:22
上传
评论
收藏 46.86MB ZIP 举报
温馨提示
【作品名称】:基于Yolov8+UCMCTrack/DeepSort+注意力机制的多目标跟踪系统 【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【项目介绍】: 功能 多目标跟踪:可以实现对视频中的多目标进行跟踪。 目标检测:可以实现对视频中的目标进行检测,检测的目标会在视频中进行标注,同时会在视频中显示目标的id,方便进行目标的跟踪。 视频流输入:支持mp4文件,本地摄像头,网络rtsp视频流。 模型参数修改:可以修改跟踪算法和置信度。 多种额外功能:实现了包括越线计数,区域计数,热力图,速度估计,距离估计,单目标跟踪功能。
资源推荐
资源详情
资源评论
收起资源包目录
基于Yolov8+UCMCTrack/DeepSort+注意力机制的多目标跟踪系统 (697个子文件)
demo.gif 43.76MB
.gitignore 89B
.gitkeep 0B
icon.ico 210KB
demo.jpg 197KB
bus.jpg 134KB
demo_cam_para.jpg 102KB
train.jpg 59KB
zidane.jpg 49KB
fold.json 78B
ip.json 45B
id.json 16B
LICENSE 34KB
LICENSE 1KB
README.md 5KB
README.md 1KB
README.md 65B
result.png 132KB
PyDracula_vertical.png 29KB
PyDracula_horizontal.png 10KB
picture.png 3KB
PyDracula.png 3KB
cil-movie.png 2KB
cil-fingerprint.png 2KB
cil-size-grip.png 2KB
cil-airplane-mode-off.png 2KB
cil-volume-high.png 2KB
cil-low-vision.png 2KB
cil-layers.png 2KB
cil-mood-very-bad.png 2KB
cil-gamepad.png 2KB
cil-truck.png 2KB
cil-at.png 2KB
cil-people.png 2KB
cil-alarm.png 2KB
cil-mug-tea.png 2KB
cil-wifi-signal-4.png 2KB
cil-face-dead.png 2KB
cil-share-boxed.png 2KB
cil-arrow-circle-top.png 2KB
cil-print.png 2KB
cil-x-circle.png 2KB
cil-settings.png 2KB
cil-arrow-circle-bottom.png 2KB
cil-arrow-circle-right.png 2KB
cil-mood-very-good.png 2KB
cil-envelope-open.png 2KB
cil-mood-bad.png 2KB
cil-smile.png 2KB
cil-arrow-circle-left.png 2KB
cil-envelope-letter.png 2KB
cil-history.png 2KB
cil-check-circle.png 2KB
cil-speedometer.png 2KB
cil-image-plus.png 2KB
cil-mood-good.png 2KB
cil-frown.png 2KB
cil-meh.png 2KB
cil-chevron-circle-down-alt.png 2KB
cil-chevron-double-down.png 2KB
cil-rss.png 2KB
cil-voice-over-record.png 2KB
cil-chevron-circle-left-alt.png 2KB
cil-camera-roll.png 2KB
cil-chevron-circle-up-alt.png 2KB
cil-wifi-signal-off.png 2KB
cil-chat-bubble.png 2KB
cil-paint-bucket.png 2KB
cil-3d.png 2KB
cil-chevron-circle-right-alt.png 2KB
cil-clock.png 2KB
cil-task.png 2KB
cil-equalizer.png 2KB
cil-image1.png 2KB
cil-airplane-mode.png 2KB
cil-fire.png 2KB
cil-av-timer.png 2KB
cil-chevron-double-right.png 2KB
cil-chart-pie.png 2KB
cil-loop-1.png 2KB
cil-4k.png 2KB
cil-house.png 2KB
cil-cloud-upload.png 2KB
cil-dog.png 2KB
cil-library-add.png 2KB
cil-zoom-in.png 2KB
cil-volume-off.png 2KB
cil-wifi-signal-2.png 2KB
cil-satelite.png 2KB
cil-thumb-up.png 2KB
cil-speaker.png 2KB
cil-user-unfollow.png 2KB
cil-tags.png 2KB
cil-view-module.png 2KB
cil-thumb-down.png 2KB
cil-chevron-double-left.png 2KB
cil-briefcase.png 2KB
cil-hdr.png 2KB
cil-cloud-download.png 2KB
cil-zoom-out.png 2KB
共 697 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
MarcoPage
- 粉丝: 3083
- 资源: 3405
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Screenshot_20240601_132255.jpg
- Screenshot_20240601_132403.jpg
- Swift语言优质学习资料资源工具与案列应用场景开发文档教程资料.txt
- Screenshot_20240601_132415.jpg
- Fortran语言优质学习资源工具与案列应用场景开发文档.txt
- Oracle ASM + 12c R1 + Linux 6.5安装
- SQL语言优质学习资源工具与案列应用场景开发文档.txt
- PHP语言优质学习资源和工具与案列应用场景和开发文档.txt
- go语言优质学习资源和工具与案列应用场景.txt
- 23957825633dCar.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功