# 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 ../../..
```
5. Run demo
```
usage: python yolov3_deepsort.py VIDEO_PATH
[--help]
[--frame_interval FRAME_INTERVAL]
[--config_detection CONFIG_DETECTION]
[--config_deepsort CONFIG_DEEPSORT]
[--ignore_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
```
If you dont support X server, use `--ignore_display` to disable display.
Results will be saved to `./demo/demo.avi`.
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.org/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/)
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ssd_deepsort.zip (82个子文件)
ssd_deep_sort_pytorch
.gitignore 83B
README.md 4KB
utils
draw.py 1KB
tool.py 1KB
parser.py 976B
__pycache__
__init__.cpython-37.pyc 170B
draw.cpython-37.pyc 1KB
parser.cpython-37.pyc 1KB
tool.cpython-37.pyc 987B
__init__.py 0B
test.py 1KB
configs
yolov3_tiny.yaml 200B
deep_sort.yaml 191B
yolov3.yaml 192B
LICENSE 34KB
SSD_deepsort.py 4KB
deep_sort
README.md 65B
sort
kalman_filter.py 8KB
nn_matching.py 6KB
preprocessing.py 2KB
track.py 5KB
detection.py 1KB
tracker.py 5KB
__pycache__
nn_matching.cpython-37.pyc 6KB
__init__.cpython-37.pyc 179B
iou_matching.cpython-37.pyc 3KB
track.cpython-37.pyc 5KB
preprocessing.cpython-37.pyc 2KB
tracker.cpython-37.pyc 5KB
kalman_filter.cpython-37.pyc 7KB
linear_assignment.cpython-37.pyc 7KB
detection.cpython-37.pyc 2KB
linear_assignment.py 8KB
__init__.py 0B
iou_matching.py 3KB
__pycache__
__init__.cpython-37.pyc 624B
deep_sort.cpython-37.pyc 4KB
__init__.py 500B
deep_sort.py 4KB
deep
test.py 2KB
train.py 6KB
evaluate.py 308B
original_model.py 3KB
model.py 3KB
__pycache__
__init__.cpython-37.pyc 179B
model.cpython-37.pyc 3KB
feature_extractor.cpython-37.pyc 2KB
__init__.py 0B
feature_extractor.py 2KB
checkpoint
.gitkeep 0B
ckpt.t7 43.9MB
original_ckpt.t7 11.02MB
train.jpg 59KB
requirements.txt 81B
.git
HEAD 23B
packed-refs 107B
index 7KB
objects
pack
pack-3e294921a78ef5d81a07f514b8deb1830a8361f8.pack 23.59MB
pack-3e294921a78ef5d81a07f514b8deb1830a8361f8.idx 15KB
info
description 73B
config 271B
info
exclude 240B
hooks
pre-applypatch.sample 424B
pre-commit.sample 2KB
applypatch-msg.sample 478B
pre-rebase.sample 5KB
commit-msg.sample 896B
prepare-commit-msg.sample 1KB
update.sample 4KB
pre-receive.sample 544B
post-update.sample 189B
pre-push.sample 1KB
logs
HEAD 197B
refs
heads
master 197B
remotes
origin
HEAD 197B
refs
tags
heads
master 41B
remotes
origin
HEAD 32B
branches
demo
test.mp4 9.04MB
2.jpg 275KB
1.jpg 248KB
demo.gif 5.23MB
demo.avi 518KB
共 82 条
- 1
资源评论
爽歪歪和哇哈哈哈
- 粉丝: 1383
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 80632180.jpg
- 李旭国体注入追踪[5.0](1).zip
- semantic.c
- C语言基础-C语言编程基础之Leetcode编程题解之第39题组合总和.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第38题外观数列.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第37题解数独.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第36题有效的数独.zip
- C语言基础-C语言编程基础之Leetcode编程题解之第35题搜索插入位置.zip
- index.wxml
- C语言基础-C语言编程基础之Leetcode编程题解之第33题搜索旋转排序数组.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功