Skip to content

Commit e25bbc7

Browse files
authored
[MOT] fix bytetrack yolox modelzoo doc (PaddlePaddle#6262)
* fix bytetrack_yolox modelzoo doc, test=document_fix * add mot16test leaderboard, test=document_fix
1 parent 8d21f78 commit e25bbc7

File tree

7 files changed

+163
-21
lines changed

7 files changed

+163
-21
lines changed

configs/mot/bytetrack/README_cn.md

+29-11
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,39 @@
1313

1414
## 模型库
1515

16-
### ByteTrack在MOT-17 half Val Set上结果
16+
### 基于不同检测器的ByteTrack在MOT-17 half Val Set上结果
1717

18-
| 检测训练数据集 | 检测器 | 输入尺度 | ReID | 检测mAP | MOTA | IDF1 | FPS | 配置文件 |
18+
| 检测训练数据集 | 检测器 | 输入尺度 | ReID | 检测mAP(0.5:0.95) | MOTA | IDF1 | FPS | 配置文件 |
1919
| :-------- | :----- | :----: | :----:|:------: | :----: |:-----: |:----:|:----: |
20-
| MOT-17 half train | YOLOv3 | 608x608 | - | 42.7 | 49.3 | 55.5 | - |[配置文件](./bytetrack_yolov3.yml) |
21-
| MOT-17 half train | PPYOLOe | 640x640 | - | 52.7 | 50.4 | 59.7 | - |[配置文件](./bytetrack_ppyoloe.yml) |
22-
| MOT-17 half train | PPYOLOe | 640x640 |PPLCNet| 52.7 | 51.7 | 58.8 | - |[配置文件](./bytetrack_ppyoloe_pplcnet.yml) |
23-
| mix_det | YOLOX-x | 800x1440| - | 61.9 | 77.3 | 71.6 | - |[配置文件](./bytetrack_yolox.yml) |
20+
| MOT-17 half train | YOLOv3 | 608x608 | - | 42.7 | 49.5 | 54.8 | - |[配置文件](./bytetrack_yolov3.yml) |
21+
| MOT-17 half train | PP-YOLOE-l | 640x640 | - | 52.9 | 50.4 | 59.7 | - |[配置文件](./bytetrack_ppyoloe.yml) |
22+
| MOT-17 half train | PP-YOLOE-l | 640x640 |PPLCNet| 52.9 | 51.7 | 58.8 | - |[配置文件](./bytetrack_ppyoloe_pplcnet.yml) |
23+
| **mot17_ch** | YOLOX-x | 800x1440| - | 61.9 | 77.3 | 71.6 | - |[配置文件](./bytetrack_yolox.yml) |
24+
| **mix_det** | YOLOX-x | 800x1440| - | 65.4 | 84.5 | 77.4 | - |[配置文件](./bytetrack_yolox.yml) |
25+
26+
27+
**注意:**
28+
- 检测任务相关配置和文档请查看[detector](detector/)
29+
30+
31+
### YOLOX-x ByteTrack(mix_det)
32+
33+
[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/pp-yoloe-an-evolved-version-of-yolo/multi-object-tracking-on-mot16)](https://paperswithcode.com/sota/multi-object-tracking-on-mot16?p=pp-yoloe-an-evolved-version-of-yolo)
34+
35+
| 网络 | 测试集 | MOTA | IDF1 | IDS | FP | FN | FPS | 下载链接 | 配置文件 |
36+
| :---------: | :-------: | :----: | :----: | :----: | :----: | :----: | :------: | :----: |:-----: |
37+
| ByteTrack-x| MOT-17 Train | 84.4 | 72.8 | 837 | 5653 | 10985 | - |[下载链接](https://paddledet.bj.bcebos.com/models/mot/yolox_x_24e_800x1440_mix_det.pdparams) | [配置文件](./bytetrack_yolox.yml) |
38+
| ByteTrack-x| MOT-17 Test | 78.4 | 69.7 | 4974 | 37551 | 79524 | - |[下载链接](https://paddledet.bj.bcebos.com/models/mot/yolox_x_24e_800x1440_mix_det.pdparams) | [配置文件](./bytetrack_yolox.yml) |
39+
| ByteTrack-x| MOT-16 Train | 83.5 | 72.7 | 800 | 6973 | 10419 | - |[下载链接](https://paddledet.bj.bcebos.com/models/mot/yolox_x_24e_800x1440_mix_det.pdparams) | [配置文件](./bytetrack_yolox.yml) |
40+
| ByteTrack-x| MOT-16 Test | 77.7 | 70.1 | 1570 | 15695 | 23304 | - |[下载链接](https://paddledet.bj.bcebos.com/models/mot/yolox_x_24e_800x1440_mix_det.pdparams) | [配置文件](./bytetrack_yolox.yml) |
41+
2442

2543
**注意:**
26-
- 模型权重下载链接在配置文件中的```det_weights``````reid_weights```,运行```tools/eval_mot.py```评估的命令即可自动下载。
27-
- **MOT17-half train**是MOT17的train序列(共7个)每个视频的前一半帧的图片和标注组成的数据集,而为了验证精度可以都用**MOT17-half val**数据集去评估,它是每个视频的后一半帧组成的,数据集可以从[此链接](https://dataset.bj.bcebos.com/mot/MOT17.zip)下载,并解压放在`dataset/mot/`文件夹下。
28-
- **mix_det**是MOT17、crowdhuman、Cityscapes、ETHZ组成的联合数据集,数据集整理的格式和目录可以参考[此链接](https://github.com/ifzhang/ByteTrack#data-preparation),最终放置于`dataset/mot/`目录下。为了验证精度可以都用**MOT17-half val**数据集去评估。
29-
- ByteTrack的训练是单独的检测器训练MOT数据集,推理是组装跟踪器去评估MOT指标,单独的检测模型也可以评估检测指标。
30-
- ByteTrack的导出部署,是单独导出检测模型,再组装跟踪器运行的,参照[PP-Tracking](../../../deploy/pptracking/python/README.md)
44+
- 模型权重下载链接在配置文件中的```det_weights``````reid_weights```,运行```tools/eval_mot.py```评估的命令即可自动下载```reid_weights```若为None则表示不需要使用,ByteTrack默认不使用ReID权重
45+
- **MOT17-half train**是MOT17的train序列(共7个)每个视频的前一半帧的图片和标注组成的数据集,而为了验证精度可以都用**MOT17-half val**数据集去评估,它是每个视频的后一半帧组成的,数据集可以从[此链接](https://dataset.bj.bcebos.com/mot/MOT17.zip)下载,并解压放在`dataset/mot/`文件夹下。
46+
- **mix_det**是MOT17、crowdhuman、Cityscapes、ETHZ组成的联合数据集,数据集整理的格式和目录可以参考[此链接](https://github.com/ifzhang/ByteTrack#data-preparation),最终放置于`dataset/mot/`目录下。为了验证精度可以都用**MOT17-half val**数据集去评估。
47+
- ByteTrack的训练是单独的检测器训练MOT数据集,推理是组装跟踪器去评估MOT指标,单独的检测模型也可以评估检测指标。
48+
- ByteTrack的导出部署,是单独导出检测模型,再组装跟踪器运行的,参照[PP-Tracking](../../../deploy/pptracking/python/README.md)
3149

3250

3351
## 快速开始
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
metric: COCO
2+
num_classes: 1
3+
4+
# Detection Dataset for training
5+
TrainDataset:
6+
!COCODataSet
7+
image_dir: ""
8+
anno_path: annotations/train.json
9+
dataset_dir: dataset/mot/mix_mot_ch
10+
data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd']
11+
12+
EvalDataset:
13+
!COCODataSet
14+
image_dir: images/train
15+
anno_path: annotations/val_half.json
16+
dataset_dir: dataset/mot/MOT17
17+
18+
TestDataset:
19+
!ImageFolder
20+
anno_path: annotations/val_half.json
21+
dataset_dir: dataset/mot/MOT17
22+
23+
24+
# MOTDataset for MOT evaluation and inference
25+
EvalMOTDataset:
26+
!MOTImageFolder
27+
dataset_dir: dataset/mot
28+
data_root: MOT17/images/half
29+
keep_ori_im: True # set as True in DeepSORT and ByteTrack
30+
31+
TestMOTDataset:
32+
!MOTImageFolder
33+
dataset_dir: dataset/mot
34+
keep_ori_im: True # set True if save visualization images or video

configs/mot/bytetrack/bytetrack_yolox_ht21.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ YOLOXHead:
5050
use_vfl: False
5151
nms:
5252
name: MultiClassNMS
53-
nms_top_k: 1000
54-
keep_top_k: 100
53+
nms_top_k: 30000
54+
keep_top_k: 1000
5555
score_threshold: 0.01
5656
nms_threshold: 0.7
5757
# For speed while keep high mAP, you can modify 'nms_top_k' to 1000 and 'keep_top_k' to 100, the mAP will drop about 0.1%.
@@ -62,7 +62,7 @@ YOLOXHead:
6262
JDETracker:
6363
use_byte: True
6464
match_thres: 0.9
65-
conf_thres: 0.6
66-
low_conf_thres: 0.2
65+
conf_thres: 0.7
66+
low_conf_thres: 0.1
6767
min_box_area: 0
6868
vertical_ratio: 0 # 1.6 for pedestrian

configs/mot/bytetrack/detector/README_cn.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,28 @@
1212
| :-------------- | :------------- | :--------: | :---------: | :-----------: | :-----: | :------: | :-----: |
1313
| DarkNet-53 | YOLOv3 | 608X608 | 40e | ---- | 42.7 | [下载链接](https://paddledet.bj.bcebos.com/models/mot/deepsort/yolov3_darknet53_40e_608x608_mot17half.pdparams) | [配置文件](./yolov3_darknet53_40e_608x608_mot17half.yml) |
1414
| CSPResNet | PPYOLOe | 640x640 | 36e | ---- | 52.9 | [下载链接](https://paddledet.bj.bcebos.com/models/mot/deepsort/ppyoloe_crn_l_36e_640x640_mot17half.pdparams) | [配置文件](./ppyoloe_crn_l_36e_640x640_mot17half.yml) |
15-
| CSPDarkNet | YOLOX-x | 800x1440 | 24e | ---- | 61.9 | [下载链接](https://paddledet.bj.bcebos.com/models/mot/deepsort/yolox_x_24e_800x1440_mix_det.pdparams) | [配置文件](./yolox_x_24e_800x1440_mix_det.yml) |
15+
| CSPDarkNet | YOLOX-x(mix_mot_ch) | 800x1440 | 24e | ---- | 61.9 | [下载链接](https://paddledet.bj.bcebos.com/models/mot/deepsort/yolox_x_24e_800x1440_mix_mot_ch.pdparams) | [配置文件](./yolox_x_24e_800x1440_mix_mot_ch.yml) |
16+
| CSPDarkNet | YOLOX-x(mix_det) | 800x1440 | 24e | ---- | 65.4 | [下载链接](https://paddledet.bj.bcebos.com/models/mot/deepsort/yolox_x_24e_800x1440_mix_det.pdparams) | [配置文件](./yolox_x_24e_800x1440_mix_det.yml) |
1617

1718
**注意:**
1819
- 以上模型除YOLOX外采用**MOT17-half train**数据集训练,数据集可以从[此链接](https://dataset.bj.bcebos.com/mot/MOT17.zip)下载。
1920
- **MOT17-half train**是MOT17的train序列(共7个)每个视频的前一半帧的图片和标注组成的数据集,而为了验证精度可以都用**MOT17-half val**数据集去评估,它是每个视频的后一半帧组成的,数据集可以从[此链接](https://paddledet.bj.bcebos.com/data/mot/mot17half/annotations.zip)下载,并解压放在`dataset/mot/MOT17/images/`文件夹下。
20-
- YOLOX采用**mix_det**数据集,是MOT17、crowdhuman、Cityscapes、ETHZ组成的联合数据集,数据集整理的格式和目录可以参考[此链接](https://github.com/ifzhang/ByteTrack#data-preparation),最终放置于`dataset/mot/`目录下。为了验证精度可以都用**MOT17-half val**数据集去评估。
21+
- YOLOX-x(mix_mot_ch)采用**mix_mot_ch**数据集,是MOT17、CrowdHuman组成的联合数据集;YOLOX-x(mix_det)采用**mix_det**数据集,是MOT17、CrowdHuman、Cityscapes、ETHZ组成的联合数据集,数据集整理的格式和目录可以参考[此链接](https://github.com/ifzhang/ByteTrack#data-preparation),最终放置于`dataset/mot/`目录下。为了验证精度可以都用**MOT17-half val**数据集去评估。
2122
- 行人跟踪请使用行人检测器结合行人ReID模型。车辆跟踪请使用车辆检测器结合车辆ReID模型。
2223
- 用于ByteTrack跟踪时,这些模型的NMS阈值等后处理设置会与纯检测任务的设置不同。
2324

2425

2526
## 快速开始
2627

27-
通过如下命令一键式启动训练和评估
28+
通过如下命令一键式启动评估、评估和导出
2829
```bash
2930
job_name=ppyoloe_crn_l_36e_640x640_mot17half
3031
config=configs/mot/bytetrack/detector/${job_name}.yml
3132
log_dir=log_dir/${job_name}
3233
# 1. training
3334
python -m paddle.distributed.launch --log_dir=${log_dir} --gpus 0,1,2,3,4,5,6,7 tools/train.py -c ${config} --eval --amp
3435
# 2. evaluation
35-
CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c ${config} -o weights=https://paddledet.bj.bcebos.com/models/mot/${job_name}.pdparams
36+
CUDA_VISIBLE_DEVICES=0 python tools/eval.py -c ${config} -o weights=output/${job_name}/model_final.pdparams
37+
# 3. export
38+
CUDA_VISIBLE_DEVICES=0 python tools/export_model.py -c ${config} -o weights=output/${job_name}/model_final.pdparams
3639
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# This config is an assembled config for ByteTrack MOT, used as eval/infer mode for MOT.
2+
_BASE_: [
3+
'../../../yolox/yolox_x_300e_coco.yml',
4+
'../_base_/mix_mot_ch.yml',
5+
]
6+
weights: output/yolox_x_24e_800x1440_mix_mot_ch/model_final
7+
log_iter: 20
8+
snapshot_epoch: 2
9+
10+
# schedule configuration for fine-tuning
11+
epoch: 24
12+
LearningRate:
13+
base_lr: 0.00075 # fintune
14+
schedulers:
15+
- !CosineDecay
16+
max_epochs: 24
17+
min_lr_ratio: 0.05
18+
last_plateau_epochs: 4
19+
- !ExpWarmup
20+
epochs: 1
21+
22+
OptimizerBuilder:
23+
optimizer:
24+
type: Momentum
25+
momentum: 0.9
26+
use_nesterov: True
27+
regularizer:
28+
factor: 0.0005
29+
type: L2
30+
31+
32+
TrainReader:
33+
batch_size: 6
34+
mosaic_epoch: 20
35+
36+
# detector configuration
37+
architecture: YOLOX
38+
pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/yolox_x_300e_coco.pdparams
39+
norm_type: sync_bn
40+
use_ema: True
41+
ema_decay: 0.9999
42+
ema_decay_type: "exponential"
43+
act: silu
44+
find_unused_parameters: True
45+
depth_mult: 1.33
46+
width_mult: 1.25
47+
48+
YOLOX:
49+
backbone: CSPDarkNet
50+
neck: YOLOCSPPAN
51+
head: YOLOXHead
52+
input_size: [800, 1440]
53+
size_stride: 32
54+
size_range: [18, 30] # multi-scale range [576*1024 ~ 800*1440], w/h ratio=1.8
55+
56+
CSPDarkNet:
57+
arch: "X"
58+
return_idx: [2, 3, 4]
59+
depthwise: False
60+
61+
YOLOCSPPAN:
62+
depthwise: False
63+
64+
# Tracking requires higher quality boxes, so NMS score_threshold will be higher
65+
YOLOXHead:
66+
l1_epoch: 20
67+
depthwise: False
68+
loss_weight: {cls: 1.0, obj: 1.0, iou: 5.0, l1: 1.0}
69+
assigner:
70+
name: SimOTAAssigner
71+
candidate_topk: 10
72+
use_vfl: False
73+
nms:
74+
name: MultiClassNMS
75+
nms_top_k: 1000
76+
keep_top_k: 100
77+
score_threshold: 0.01
78+
nms_threshold: 0.7
79+
# For speed while keep high mAP, you can modify 'nms_top_k' to 1000 and 'keep_top_k' to 100, the mAP will drop about 0.1%.
80+
# For high speed demo, you can modify 'score_threshold' to 0.25 and 'nms_threshold' to 0.45, but the mAP will drop a lot.

configs/mot/headtracking21/README_cn.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
| 模型 | 输入尺寸 | MOTA | IDF1 | IDS | FP | FN | FPS | 下载链接 | 配置文件 |
1515
| :--------------| :------- | :----: | :----: | :---: | :----: | :---: | :------: | :----: |:----: |
1616
| FairMOT DLA-34 | 1088x608 | 64.7 | 69.0 | 8533 | 148817 | 234970 | - | [下载链接](https://paddledet.bj.bcebos.com/models/mot/fairmot_dla34_30e_1088x608_headtracking21.pdparams) | [配置文件](./fairmot_dla34_30e_1088x608_headtracking21.yml) |
17-
| ByteTrack-x | 1440x800 | 62.2 | 59.9 | 5736 | 222583 | 191737 | - | [下载链接](https://paddledet.bj.bcebos.com/models/mot/bytetrack_yolox_ht21.pdparams) | [配置文件](../bytetrack/bytetrack_yolox_ht21.yml) |
17+
| ByteTrack-x | 1440x800 | 64.1 | 63.4 | 4191 | 185162 | 210240 | - | [下载链接](https://paddledet.bj.bcebos.com/models/mot/bytetrack_yolox_ht21.pdparams) | [配置文件](../bytetrack/bytetrack_yolox_ht21.yml) |
1818

1919
### FairMOT在HT-21 Test Set上结果
2020
| 骨干网络 | 输入尺寸 | MOTA | IDF1 | IDS | FP | FN | FPS | 下载链接 | 配置文件 |

ppdet/engine/tracker.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import glob
2121
import re
2222
import paddle
23+
import paddle.nn as nn
2324
import numpy as np
2425
from tqdm import tqdm
2526
from collections import defaultdict
@@ -29,7 +30,7 @@
2930
from ppdet.modeling.mot.utils import Detection, get_crops, scale_coords, clip_box
3031
from ppdet.modeling.mot.utils import MOTTimer, load_det_results, write_mot_results, save_vis_results
3132
from ppdet.modeling.mot.tracker import JDETracker, DeepSORTTracker
32-
33+
from ppdet.modeling.architectures import YOLOX
3334
from ppdet.metrics import Metric, MOTMetric, KITTIMOTMetric, MCMOTMetric
3435
import ppdet.utils.stats as stats
3536

@@ -60,6 +61,12 @@ def __init__(self, cfg, mode='eval'):
6061
# build model
6162
self.model = create(cfg.architecture)
6263

64+
if isinstance(self.model.detector, YOLOX):
65+
for k, m in self.model.named_sublayers():
66+
if isinstance(m, nn.BatchNorm2D):
67+
m._epsilon = 1e-3 # for amp(fp16)
68+
m._momentum = 0.97 # 0.03 in pytorch
69+
6370
self.status = {}
6471
self.start_epoch = 0
6572

0 commit comments

Comments
 (0)