未验证 提交 e567dfe3 编写于 作者: F Feng Ni 提交者: GitHub

fix mtmct pptracking doc (#6747)

* fix mtmct pptracking doc, test=document_fix

* fix doc, test=document_fix
上级 52e110e1
# PP-Tracking Python端预测部署
## 内容
- [简介](#简介)
- [1-FairMOT模型导出和预测](#1-FairMOT模型导出和预测)
- [2-DeepSORT模型导出和预测](#2-DeepSORT模型导出和预测)
- [3-ByteTrack和OC_SORT模型导出和预测](#3-ByteTrack和OC_SORT模型导出和预测)
- [4-车辆跨镜头跟踪模型导出和预测](#4-车辆跨镜头跟踪模型导出和预测)
- [5-参数说明](#5-参数说明)
## 简介
在PaddlePaddle中预测引擎和训练引擎底层有着不同的优化方法, 预测引擎使用了AnalysisPredictor,专门针对推理进行了优化,是基于[C++预测库](https://www.paddlepaddle.org.cn/documentation/docs/zh/advanced_guide/inference_deployment/inference/native_infer.html)的Python接口,该引擎可以对模型进行多项图优化,减少不必要的内存拷贝。如果用户在部署已训练模型的过程中对性能有较高的要求,我们提供了独立于PaddleDetection的预测脚本,方便用户直接集成部署。
主要包含两个步骤:
......@@ -11,7 +20,7 @@ PaddleDetection在训练过程包括网络的前向和优化器相关参数,
PP-Tracking也提供了AI Studio公开项目案例,教程请参考[PP-Tracking之手把手玩转多目标跟踪](https://aistudio.baidu.com/aistudio/projectdetail/3022582)
## 1. 对FairMOT模型的导出和预测
## 1-FairMOT模型导出和预测
### 1.1 导出预测模型
```bash
# 命令行导出PaddleDetection发布的权重
......@@ -66,7 +75,7 @@ python deploy/pptracking/python/mot_jde_infer.py --model_dir=output_inference/fa
## 2. 对DeepSORT模型的导出和预测
## 2-DeepSORT模型导出和预测
### 2.1 导出预测模型
Step 1:导出检测模型
```bash
......@@ -117,7 +126,7 @@ python deploy/pptracking/python/mot_sde_infer.py --model_dir=mot_ppyoloe_l_36e_p
## 3. 对ByteTrack和OC_SORT模型的导出和预测
## 3-ByteTrack和OC_SORT模型导出和预测
### 3.1 导出预测模型
```bash
# 导出PPYOLOe行人检测模型
......@@ -145,7 +154,7 @@ python deploy/pptracking/python/mot_sde_infer.py --model_dir=output_inference/pp
## 4. 跨境跟踪模型的导出和预测
## 4-车辆跨镜头跟踪模型导出和预测
### 4.1 导出预测模型
Step 1:下载导出的检测模型
```bash
......@@ -166,10 +175,11 @@ wget https://paddledet.bj.bcebos.com/data/mot/demo/mtmct-demo.tar
tar -xvf mtmct-demo.tar
# 用导出的PPYOLOE车辆检测模型和PPLCNet车辆ReID模型
python deploy/pptracking/python/mot_sde_infer.py --model_dir=mot_ppyoloe_l_36e_ppvehicle/ --reid_model_dir=deepsort_pplcnet_vehicle/ --mtmct_dir=mtmct-demo --mtmct_cfg=mtmct_cfg.yml --device=GPU --threshold=0.5 --save_mot_txts --save_images
python deploy/pptracking/python/mot_sde_infer.py --model_dir=mot_ppyoloe_l_36e_ppvehicle/ --reid_model_dir=deepsort_pplcnet_vehicle/ --tracker_config=deploy/pptracking/python/tracker_config.yml --mtmct_dir=mtmct-demo --mtmct_cfg=deploy/pptracking/python/mtmct_cfg.yml --device=GPU --threshold=0.5 --save_mot_txts --save_images
```
**注意:**
- 运行前需要手动修改`tracker_config.yml`的跟踪器类型为`type: DeepSORTTracker`,跨镜头跟踪仅支持DeepSORT。
- 跟踪模型是对视频进行预测,不支持单张图的预测,默认保存跟踪结果可视化后的视频,可添加`--save_mot_txts`(对每个视频保存一个txt),或`--save_images`表示保存跟踪结果可视化图片。
- 跨镜头跟踪结果txt文件每行信息是`camera_id,frame,id,x1,y1,w,h,-1,-1`
- `--threshold`表示结果可视化的置信度阈值,默认为0.5,低于该阈值的结果会被过滤掉,为了可视化效果更佳,可根据实际情况自行修改。
......@@ -178,7 +188,7 @@ python deploy/pptracking/python/mot_sde_infer.py --model_dir=mot_ppyoloe_l_36e_p
- `--mtmct_cfg`是MTMCT预测的某个场景的配置文件,里面包含该一些trick操作的开关和该场景摄像头相关设置的文件路径,用户可以自行更改相关路径以及设置某些操作是否启用。
## 5. 参数说明:
## 5-参数说明
| 参数 | 是否必须|含义 |
|-------|-------|----------|
......
# config of tracker for MOT SDE Detector, use 'JDETracker' as default.
# config of tracker for MOT SDE Detector, use 'OCSORTTracker' as default, 'JDETracker' here is just BYTETracker.
# The tracker of MOT JDE Detector (such as FairMOT) is exported together with the model.
# Here 'min_box_area' and 'vertical_ratio' are set for pedestrian, you can modify for other objects tracking.
type: OCSORTTracker # choose one tracker in ['JDETracker', 'OCSORTTracker', 'DeepSORTTracker']
# When using for MTMCT(Multi-Target Multi-Camera Tracking), you should modify to 'DeepSORTTracker'
# BYTETracker
# just as BYTETracker, used for FairMOT in PP-Tracking project and for ByteTrack in PP-Humanv1 project
JDETracker:
use_byte: True
det_thresh: 0.3
......@@ -15,6 +17,7 @@ JDETracker:
vertical_ratio: 0 # 1.6 for pedestrian
# used for OC-SORT in PP-Humanv2 project and PP-Vehicle project
OCSORTTracker:
det_thresh: 0.4
max_age: 30
......@@ -27,8 +30,9 @@ OCSORTTracker:
use_byte: False
# used for DeepSORT and MTMCT in PP-Tracking project
DeepSORTTracker:
input_size: [64, 192]
input_size: [64, 192] # An unique operation to scale the sub-image of the selected detected boxes to a fixed size
min_box_area: 0
vertical_ratio: -1
budget: 100
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册