简体中文 | English
PaddleDetection中提出了全新的轻量级系列模型PP-PicoDet
,在移动端具有卓越的性能,成为全新SOTA轻量级模型。详细的技术细节可以参考我们的arXiv技术报告。
PP-PicoDet模型有如下特点:
mAP(0.5:0.95)
超越30+(输入416像素时)。模型 | 输入尺寸 | mAPval 0.5:0.95 | mAPval 0.5 | 参数量 (M) | FLOPS (G) | 预测时延NCNN (ms) 预测时延Lite |
(ms) 下载 |
配置文件 |
PicoDet-XS |
320*320 |
23.5 |
36.1 |
0.70 |
0.67 |
10.9ms |
7.81ms |
model | log |
config |
PicoDet-XS |
416*416 |
26.2 |
39.3 |
0.70 |
1.13 |
15.4ms |
12.38ms |
model | log |
config |
PicoDet-S |
320*320 |
29.1 |
43.4 |
1.18 |
0.97 |
12.6ms |
9.56ms |
model | log |
config |
PicoDet-S |
416*416 |
32.5 |
47.6 |
1.18 |
1.65 |
17.2ms |
15.20 |
model | log |
config |
PicoDet-M |
320*320 |
34.4 |
50.0 |
3.46 |
2.57 |
14.5ms |
17.68ms |
model | log |
config |
PicoDet-M |
416*416 |
37.5 |
53.4 |
3.46 |
4.34 |
19.5ms |
28.39ms |
model | log |
config |
PicoDet-L |
320*320 |
36.1 |
52.0 |
5.80 |
4.20 |
18.3ms |
25.21ms |
model | log |
config |
PicoDet-L |
416*416 |
39.4 |
55.7 |
5.80 |
7.10 |
22.1ms |
42.23ms |
model | log |
config |
PicoDet-L |
640*640 |
42.3 |
59.2 |
5.80 |
16.81 |
43.1ms |
108.1ms |
model | log |
config |
|
---|
模型 | 输入尺寸 | mAPval 0.5:0.95 | mAPval 0.5 | 参数量 (M) | FLOPS (G) | 预测时延NCNN (ms) |
---|---|---|---|---|---|---|
YOLOv3-Tiny | 416*416 | 16.6 | 33.1 | 8.86 | 5.62 | 25.42 |
YOLOv4-Tiny | 416*416 | 21.7 | 40.2 | 6.06 | 6.96 | 23.69 |
PP-YOLO-Tiny | 320*320 | 20.6 | - | 1.08 | 0.58 | 6.75 |
PP-YOLO-Tiny | 416*416 | 22.7 | - | 1.08 | 1.02 | 10.48 |
Nanodet-M | 320*320 | 20.6 | - | 0.95 | 0.72 | 8.71 |
Nanodet-M | 416*416 | 23.5 | - | 0.95 | 1.2 | 13.35 |
Nanodet-M 1.5x | 416*416 | 26.8 | - | 2.08 | 2.42 | 15.83 |
YOLOX-Nano | 416*416 | 25.8 | - | 0.91 | 1.08 | 19.23 |
YOLOX-Tiny | 416*416 | 32.8 | - | 5.06 | 6.45 | 32.77 |
YOLOv5n | 640*640 | 28.4 | 46.0 | 1.9 | 4.5 | 40.35 |
YOLOv5s | 640*640 | 37.2 | 56.0 | 7.2 | 16.5 | 78.05 |
模型 | 输入尺寸 | ONNX | Paddle Lite(fp32) | Paddle Lite(fp16) |
---|---|---|---|---|
PicoDet-S | 320*320 | model | model | model |
PicoDet-S | 416*416 | model | model | model |
PicoDet-M | 320*320 | model | model | model |
PicoDet-M | 416*416 | model | model | model |
PicoDet-L | 320*320 | model | model | model |
PicoDet-L | 416*416 | model | model | model |
PicoDet-L | 640*640 | model | model | model |
PicoDet-Shufflenetv2 1x | 416*416 | model | model | model |
PicoDet-MobileNetv3-large 1x | 416*416 | model | model | model |
PicoDet-LCNet 1.5x | 416*416 | model | model | model |
Android demo可视化:
依赖包:
安装:
pip install paddleslim==2.2.1
量化训练 (点击展开)
开始量化训练:
python tools/train.py -c configs/picodet/picodet_s_320_coco_lcnet.yml \
--slim_config configs/slim/quant/picodet_s_quant.yml --eval
离线量化 (点击展开)
校准及导出量化模型:
python tools/post_quant.py -c configs/picodet/picodet_s_320_coco_lcnet.yml \
--slim_config configs/slim/post_quant/picodet_s_ptq.yml
教程:
训练及部署细节请参考非结构化剪枝文档。
行人检测: PicoDet-S-Pedestrian
行人检测模型请参考PP-TinyPose
主体检测: PicoDet-L-Mainbody
主体检测模型请参考主体检测文档
显存爆炸(Out of memory error)
请减小配置文件中TrainReader
的batch_size
。
如何迁移学习
请重新设置配置文件中的pretrain_weights
字段,比如利用COCO上训好的模型在自己的数据上继续训练:
pretrain_weights: https://paddledet.bj.bcebos.com/models/picodet_l_640_coco_lcnet.pdparams
transpose
算子在某些硬件上耗时验证
请使用PicoDet-LCNet
模型,transpose
较少。
如何计算模型参数量。
可以将以下代码插入:trainer.py 来计算参数量。
params = sum([
p.numel() for n, p in self.model. named_parameters()
if all([x not in n for x in ['_mean', '_variance']])
]) # exclude BatchNorm running status
print('params: ', params)
如果需要在你的研究中使用PP-PicoDet,请通过一下方式引用我们的技术报告:
@misc{yu2021pppicodet,
title={PP-PicoDet: A Better Real-Time Object Detector on Mobile Devices},
author={Guanghua Yu and Qinyao Chang and Wenyu Lv and Chang Xu and Cheng Cui and Wei Ji and Qingqing Dang and Kaipeng Deng and Guanzhong Wang and Yuning Du and Baohua Lai and Qiwen Liu and Xiaoguang Hu and Dianhai Yu and Yanjun Ma},
year={2021},
eprint={2111.00902},
archivePrefix={arXiv},
primaryClass={cs.CV}
}