|
| 1 | +English | [简体中文](README_cn.md) |
| 2 | + |
| 3 | +# BOT_SORT (BoT-SORT: Robust Associations Multi-Pedestrian Tracking) |
| 4 | + |
| 5 | +## content |
| 6 | +- [introduction](#introduction) |
| 7 | +- [model zoo](#modelzoo) |
| 8 | +- [Quick Start](#QuickStart) |
| 9 | +- [Citation](Citation) |
| 10 | + |
| 11 | +## introduction |
| 12 | +[BOT_SORT](https://arxiv.org/pdf/2206.14651v2.pdf)(BoT-SORT: Robust Associations Multi-Pedestrian Tracking). The configuration of common detectors is provided here for reference. Because different training data sets, input scales, number of training epochs, NMS threshold settings, etc. will lead to differences in model accuracy and performance, please adapt according to your needs |
| 13 | + |
| 14 | +## modelzoo |
| 15 | + |
| 16 | +### BOT_SORT在MOT-17 half Val Set |
| 17 | + |
| 18 | +| Dataset | detector | input size | detector mAP | MOTA | IDF1 | config | |
| 19 | +| :-------- | :----- | :----: | :------: | :----: |:-----: |:----: | |
| 20 | +| MOT-17 half train | PP-YOLOE-l | 640x640 | 52.7 | 55.5 | 64.2 |[config](./botsort_ppyoloe.yml) | |
| 21 | + |
| 22 | + |
| 23 | +**Attention:** |
| 24 | + - Model weight download link in the configuration file ` ` ` det_ Weights ` ` `, run the verification command to automatically download. |
| 25 | + - **MOT17-half train** is a data set composed of pictures and labels of the first half frames of each video in the MOT17 train sequence (7 in total). To verify the accuracy, we can use the **MOT17-half val** to eval,It is composed of the second half frame of each video,download [link](https://bj.bcebos.com/v1/paddledet/data/mot/MOT17.zip),decompression `dataset/mot/` |
| 26 | + |
| 27 | + - BOT_ SORT training is a separate detector training MOT dataset, reasoning is to assemble a tracker to evaluate MOT indicators, and a separate detection model can also evaluate detection indicators. |
| 28 | + - BOT_SORT export deployment is to export the detection model separately and then assemble the tracker for operation. Refer to [PP-Tracking](../../../deploy/pptracking/python)。 |
| 29 | + - BOT_SORT is the main scheme for PP Human, PP Vehicle and other pipelines to analyze the project tracking direction. For specific use, please refer to [Pipeline](../../../deploy/pipeline) and [MOT](../../../deploy/pipeline/docs/tutorials/pphuman_mot.md). |
| 30 | + |
| 31 | + |
| 32 | +## QuickStart |
| 33 | + |
| 34 | +### 1. train |
| 35 | +Start training and evaluation with the following command |
| 36 | +```bash |
| 37 | +#Single gpu |
| 38 | +CUDA_VISIBLE_DEVICES=0 python tools/train.py -c configs/mot/bytetrack/detector/ppyoloe_crn_l_36e_640x640_mot17half.yml --eval --amp |
| 39 | + |
| 40 | +#Multi gpu |
| 41 | +python -m paddle.distributed.launch --log_dir=ppyoloe --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/mot/bytetrack/detector/ppyoloe_crn_l_36e_640x640_mot17half.yml --eval --amp |
| 42 | +``` |
| 43 | + |
| 44 | +### 2. evaluate |
| 45 | +#### 2.1 detection |
| 46 | +```bash |
| 47 | +CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c configs/mot/bytetrack/detector/ppyoloe_crn_l_36e_640x640_mot17half.yml |
| 48 | +``` |
| 49 | + |
| 50 | +**Attention:** |
| 51 | + - eval detection use ```tools/eval.py```,eval mot use ```tools/eval_mot.py```. |
| 52 | + |
| 53 | +#### 2.2 mot |
| 54 | +```bash |
| 55 | +CUDA_VISIBLE_DEVICES=0 python tools/eval_mot.py -c configs/mot/botsort/botsort_ppyoloe.yml --scaled=True |
| 56 | +``` |
| 57 | +**Attention:** |
| 58 | + - `--scaled` indicates whether the coordinates of the output results of the model have been scaled back to the original drawing. If the detection model used is JDE YOLOv3, it is false. If the universal detection model is used, it is true. The default value is false. |
| 59 | + - mot result save `{output_dir}/mot_results/`,each video sequence in it corresponds to a txt, and each line of information in each txt file is `frame,id,x1,y1,w,h,score,-1,-1,-1`, and `{output_dir}` could use `--output_dir` to set. |
| 60 | + |
| 61 | +### 3. export detection model |
| 62 | + |
| 63 | +```bash |
| 64 | +python tools/export_model.py -c configs/mot/bytetrack/detector/ppyoloe_crn_l_36e_640x640_mot17half.yml --output_dir=output_inference -o weights=https://bj.bcebos.com/v1/paddledet/models/mot/ppyoloe_crn_l_36e_640x640_mot17half.pdparams |
| 65 | +``` |
| 66 | + |
| 67 | +### 4. Use the export model to predict |
| 68 | + |
| 69 | +```bash |
| 70 | +# download demo video |
| 71 | +wget https://bj.bcebos.com/v1/paddledet/data/mot/demo/mot17_demo.mp4 |
| 72 | + |
| 73 | +CUDA_VISIBLE_DEVICES=0 python deploy/pptracking/python/mot_sde_infer.py --model_dir=output_inference/ppyoloe_crn_l_36e_640x640_mot17half --tracker_config=deploy/pptracking/python/tracker_config.yml --video_file=mot17_demo.mp4 --device=GPU --threshold=0.5 |
| 74 | +``` |
| 75 | +**Attention:** |
| 76 | + - You must fix `tracker_config.yml` tracker `type: BOTSORTTracker`,if you want to use BOT_SORT. |
| 77 | + - The tracking model is used to predict videos. It does not support prediction of a single image. By default, the videos with visualized tracking results are saved. You can add `--save_mot_txts` (save a txt for each video) or `--save_mot_txt_per_img`(Save a txt for each image) or `--save_images` save the visualization picture of tracking results. |
| 78 | + - Each line of the trace result txt file format `frame,id,x1,y1,w,h,score,-1,-1,-1`。 |
| 79 | + |
| 80 | + |
| 81 | +## Citation |
| 82 | +``` |
| 83 | +@article{aharon2022bot, |
| 84 | + title={BoT-SORT: Robust Associations Multi-Pedestrian Tracking}, |
| 85 | + author={Aharon, Nir and Orfaig, Roy and Bobrovsky, Ben-Zion}, |
| 86 | + journal={arXiv preprint arXiv:2206.14651}, |
| 87 | + year={2022} |
| 88 | +} |
| 89 | +``` |
0 commit comments