# 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-deepsort 实现智能车辆跟踪+计数系统: - 本工程包含源码及详细操作视频 - 里边也包含了环境搭建+demo运行的详细教程 适合研究小白等
资源推荐
资源详情
资源评论
收起资源包目录
目标跟踪+YOLOv8-deepsort 实现智能车辆跟踪+计数系统 (553个子文件)
0127f24b4f28e2dfd794f72c7f26f9168082f9 710B
0179407181933d59809b25400d115cfa789867 1KB
0297995eed8cfa7f08d0f6e0436a7f4d0bef54 822B
02ddf6ad922442782c9e78aff0a4d757812d6c 4KB
0322c8dc15adb02033b86120e8a2f1df72b7da 3KB
0502e102f9b76330eaac6715bc17b738fa3c5a 22KB
06224c1f81d678403be7f53cd4d27630541d5d 6KB
062fa55411c45848d8778dbdc1a027abcb77c6 490B
093039288327fdcf73435b3b52a0dbf0ff78c3 514B
09abf29c334943710967c52fcec05a3bfb5e5d 9KB
0a431e12f401690c9c77d3815285486211a7fb 495B
0aea50e7996a55af80c952310f2b0860d93ac1 253B
0b69fd477df0527c7a82ac087e260bd2157879 1004B
10ae22a41d5ca74396e8578fa5efceabbcf2df 210B
11a02a7599e520f9f14a4703f4991237d6ce50 77.69MB
126cb81149381f0445a1843f2a5ff87a7aee01 206B
128b9b8d4f0763ae0f5dfd8b973180cc45a3a4 128B
14a8bf9352fd9f0c1896517f7855dd36c4d94d 4KB
17affcb61800e70f29bd30b08fb980c9254b19 528B
188594ed54b8b5dca0829486fc9025143b7b73 13KB
19a10dc5144579130500cfaaa83bba29210687 246B
1a9c1ac5d2b1d4e3030d42f4f9d4c3476738e3 169B
1cdd19f8a416f0dedd3e92a3ae8334bc42fc52 2KB
1cec05af1ef612af6926d59cfae8957498ddfe 12.07MB
1d4bd28dcff828114c35247a95440685c7c5ad 942B
1f13e13adf28bafaf96e74d80076df3173b995 2KB
238be980b1bf6efe073a1a2b290cd530e02eb7 1KB
240ed9547f64ca19fa34de4f71adea150e4fe1 772B
261af297378f35e8d2ea5569ff9ac54282ad95 1KB
286f3d26fb82825fccf7844291f37b10a2c93a 3KB
2b5fc178c7e97471c48def34fdc7f8e7e7e32c 228B
2d14cbb9eab73d9d30d1787a7439a3c7220285 370B
2df1f1ce81f4bd588e7f7f8442d4978789aaa3 2.68MB
33cbbe3b367da59f8c5d13ca619a4e8740a1b1 628B
35a614738828b880aa862bc52423848ac8e472 50KB
35ec154384b8857c15841c27f1845f90d6b988 97B
3a22a5746a1d04ee126cdccb95e26303d2c1af 6KB
3a85d364e84c90cf6df6457ecd51791baa7040 524B
3b7b783d6fbd4fef157ff58abcfdfe64a2952d 602B
3ccaf09a1bd350f0ac79dba10a1b72acd462c3 411B
410e9b75348c749743ed67fb4760a8f543967a 1KB
4128921edb22ccefd783c6d8a033e0186ef750 115B
414da64f8bf85a6bf537dd8034f6d81b46c1f1 9KB
423f2f6e6c679c22ff3d74c6fb84c318efda84 54B
42cf5b6021dcc009ea7e4d35f6f28e298bda65 835B
430c64dee3f2150a3a7c96e7f3e58c666430ef 7KB
43c14a57c9f3a9502d2687621579e253dca493 6KB
458ace6993dcae9f820e076f8c5dcc62d592ca 202B
45f8f6f79bb3dafeebcb88f0e07750aa5ada2f 3KB
46d7f237f9f361526d5e0b4c9af5aa24b4b491 249B
46f659761c1239c4fc4afa5bbf5a2473f136be 1KB
47a024837a3d039143ac896e407603ec6e8dae 135B
481ad53af41e431d2809281cf253462bc8cc1e 3KB
48757dca88f35e9ea2cd1ca16e41bac9976a45 256B
48f7faa2b151867368341ed76269b2774f53de 701B
4974883c2b3e4a0d922a17689dc2e6d6f6365b 167B
4a6414470e150ac1ac55241f8a6a22aa1f4c0e 576B
4adb3bbfc20ca1e0da147b2c7f5afd182dd050 71B
4bccca9d1aff53c920eb4378428544bc39fad4 2.81MB
4d01e2562f04a248c761059196b81705d2604f 2KB
4d2cdd35800630aa1331f4d5a1a6cfe8880b4b 167B
4d992cd2cbd7b0f1f975180305f945f3f337f4 9KB
4da78b2dd984b762825c7ff94faad0808a524e 168B
4e071550dd4917658b93524dd3a1cf5a330468 4KB
4e1cac22cb83c4b48e0904aba7f1050e6049eb 59B
4fa0de30342d1bddb62cb8a2c8e1b8327f6872 5KB
4ff58db885ef9aca59450ccdbeb9762f94ddd0 159B
532d44d04fd8d6099dcb011d7b2c2f10874a9c 2KB
53cbeef193f443c97750847fe0db432d1ebcb5 4KB
53ec33bf337b7b3ad8c0f8d13413a6e9f49f9e 2KB
5405e84011fc8a01826f2d9254944d17fedd8f 4.74MB
55d2ee3a5ef689567aa9ffe679613b47bb41f9 165B
5a616fd6b917a26c6f932d87b0a87842f9f52b 3KB
5ad23ef40e5639df2733974b9527c94d8e0ee4 4KB
5b672a0b477ddcec78084d1df33ba0f34580eb 7KB
5ce2da2d6447d11dfe32bfb846c3d5b199fc99 142B
5dc761eb3680955c33887000dc6ba8e32c8cd4 500B
5de9b637b809910590ab144dcaeec1431a62a0 68B
5fb69c2df41510fd740a4ab57d8fc7b81012de 372B
60ca77b8189c86a27fb4be786bfe0ca526a1e7 2KB
60ee9e618de22ad055e521e22faced0263c74e 151B
63349f9aa68d654bc9e55a19102e704ca32de9 525B
64d0bc3dd917926892c55e3706cc116d5b165e 53B
65cb0fa50ad1ad3781051c412975cf8f6d0d1c 4KB
6794f1d02e16563355c26aab7c96967941c92e 571B
6a9bd9529b611553eb512745620476a5902098 905B
6c18dcffbf64ac98c0d3b48fc7f78ba081d6b7 41.12MB
6e9a5a026a5169a37770c304a0d920ec7be2a0 3KB
6f3860d1569843696bb3c7c4709fdc4e862057 304B
6fa1b0c03834cdbb78229275c15ecc35904f8c 4KB
72283c987401b0f1a270a9a129f40fa0f51860 505B
726576fa52c402217d98845d41dec0a7ea969d 959B
7271eb30f2b56be16936b778943e81a0cc98b8 3KB
730613a5b99d680a4925fdca1069e4b1a797ca 1KB
734ad52b3b02d815416d998bae145a93dbf519 1010B
73f8064faeaa5dfe6ec9642830b5506d02276f 2KB
747c5ca147b318fd7243ca7682aa104b4f9815 5KB
75fa28fcf5f120caa66ca16a41ffde8e706fc9 2KB
7714561d644ab80069e710a0118ae2ae654a7b 216B
78f702ef2b1bb55f6c554d53e363184d4c7a5d 159B
共 553 条
- 1
- 2
- 3
- 4
- 5
- 6
明月醉窗台
- 粉丝: 2w+
- 资源: 47
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页