|
1 |
| -hello |
| 1 | +# YOLOv4 + Deep_SORT |
| 2 | + |
| 3 | +<img src="https://github.com/yehengchen/video_demo/blob/master/video_demo/output.gif" width="40%" height="40%"> <img src="https://github.com/yehengchen/video_demo/blob/master/video_demo/TownCentreXVID_output.gif" width="40%" height="40%"> |
| 4 | +<img src="https://github.com/yehengchen/Object-Detection-and-Tracking/blob/master/OneStage/yolo/yolo_img/output_person_315_1120_s.gif" width="40%" height="40%"> <img src="https://github.com/yehengchen/Object-Detection-and-Tracking/blob/master/img/output_car_143.gif" width="40%" height="40%"> |
| 5 | + |
| 6 | +__Object Tracking & Counting Demo - [[YouTube]](https://www.youtube.com/watch?v=ALw3OfrGWGo) [[BiliBili_V1]](https://www.bilibili.com/video/av55778717) [[BiliBili_V2]](https://www.bilibili.com/video/av59547404) [[Chinese Version]](https://blog.csdn.net/weixin_38107271/article/details/96741706)__ |
| 7 | +## Requirement |
| 8 | +__Development Environment: [Deep-Learning-Environment-Setup](https://github.com/yehengchen/Ubuntu-16.04-Deep-Learning-Environment-Setup)__ |
| 9 | + |
| 10 | +* OpenCV |
| 11 | +* sklean |
| 12 | +* pillow |
| 13 | +* numpy 1.15.0 |
| 14 | +* tensorflow-gpu 1.13.1 |
| 15 | +* CUDA 10.0 |
| 16 | +*** |
| 17 | + |
| 18 | +It uses: |
| 19 | + |
| 20 | +* __Detection__: [YOLOv4](https://github.com/yehengchen/ObjectDetection/tree/master/OneStage/yolo/yolov3) to detect objects on each of the video frames. - 用自己的数据训练YOLOv3模型 |
| 21 | + |
| 22 | +* __Tracking__: [Deep_SORT](https://github.com/nwojke/deep_sort) to track those objects over different frames. |
| 23 | + |
| 24 | +*This repository contains code for Simple Online and Realtime Tracking with a Deep Association Metric (Deep SORT). We extend the original SORT algorithm to integrate appearance information based on a deep appearance descriptor. See the [arXiv preprint](https://arxiv.org/abs/1703.07402) for more information.* |
| 25 | + |
| 26 | +## Quick Start |
| 27 | + |
| 28 | +__0.Requirements__ |
| 29 | + |
| 30 | + pip install -r requirements.txt |
| 31 | + |
| 32 | +__1. Download the code to your computer.__ |
| 33 | + |
| 34 | + git clone https://github.com/yehengchen/Object-Detection-and-Tracking.git |
| 35 | + |
| 36 | +__2. Download [[yolov4.weights]](https://pjreddie.com/media/files/yolov3.weights)__ and place it in `deep_sort_yolov3/model_data/` |
| 37 | + |
| 38 | +*Here you can download my trained [[yolo-spp.h5]](https://pan.baidu.com/s/1DoiifwXrss1QgSQBp2vv8w&shfl=shareset) - `t13k` weights for detecting person/car/bicycle,etc.* |
| 39 | + |
| 40 | +__3. Convert the Darknet YOLO model to a Keras model:__ |
| 41 | +``` |
| 42 | +$ python convert.py model_data/yolov3.cfg model_data/yolov3.weights model_data/yolo.h5 |
| 43 | +``` |
| 44 | +__4. Run the YOLO_DEEP_SORT:__ |
| 45 | + |
| 46 | +``` |
| 47 | +$ python main.py -c [CLASS NAME] -i [INPUT VIDEO PATH] |
| 48 | +
|
| 49 | +$ python main.py -c person -i ./test_video/testvideo.avi |
| 50 | +``` |
| 51 | + |
| 52 | +__5. Can change [deep_sort_yolov3/yolo.py] `__Line 100__` to your tracking object__ |
| 53 | + |
| 54 | +*DeepSORT pre-trained weights using people-ReID datasets only for person* |
| 55 | +``` |
| 56 | + if predicted_class != args["class"]: |
| 57 | + continue |
| 58 | + |
| 59 | + if predicted_class != 'person' and predicted_class != 'car': |
| 60 | + continue |
| 61 | +``` |
| 62 | + |
| 63 | +## Train on Market1501 & MARS |
| 64 | +*People Re-identification model* |
| 65 | + |
| 66 | +[cosine_metric_learning](https://github.com/nwojke/cosine_metric_learning) for training a metric feature representation to be used with the deep_sort tracker. |
| 67 | + |
| 68 | +## Citation |
| 69 | + |
| 70 | +### YOLOv3 : |
| 71 | + |
| 72 | + @article{yolov3, |
| 73 | + title={YOLOv3: An Incremental Improvement}, |
| 74 | + author={Redmon, Joseph and Farhadi, Ali}, |
| 75 | + journal = {arXiv}, |
| 76 | + year={2018} |
| 77 | + } |
| 78 | + |
| 79 | +### Deep_SORT : |
| 80 | + |
| 81 | + @inproceedings{Wojke2017simple, |
| 82 | + title={Simple Online and Realtime Tracking with a Deep Association Metric}, |
| 83 | + author={Wojke, Nicolai and Bewley, Alex and Paulus, Dietrich}, |
| 84 | + booktitle={2017 IEEE International Conference on Image Processing (ICIP)}, |
| 85 | + year={2017}, |
| 86 | + pages={3645--3649}, |
| 87 | + organization={IEEE}, |
| 88 | + doi={10.1109/ICIP.2017.8296962} |
| 89 | + } |
| 90 | + |
| 91 | + @inproceedings{Wojke2018deep, |
| 92 | + title={Deep Cosine Metric Learning for Person Re-identification}, |
| 93 | + author={Wojke, Nicolai and Bewley, Alex}, |
| 94 | + booktitle={2018 IEEE Winter Conference on Applications of Computer Vision (WACV)}, |
| 95 | + year={2018}, |
| 96 | + pages={748--756}, |
| 97 | + organization={IEEE}, |
| 98 | + doi={10.1109/WACV.2018.00087} |
| 99 | + } |
| 100 | + |
| 101 | +## Reference |
| 102 | +#### Github:deep_sort@[Nicolai Wojke nwojke](https://github.com/nwojke/deep_sort) |
| 103 | +#### Github:deep_sort_yolov3@[Qidian213 ](https://github.com/Qidian213/deep_sort_yolov3) |
| 104 | + |
| 105 | + |
| 106 | + |
0 commit comments