diff --git a/configs/picodet/README.md b/configs/picodet/README.md index 9e807f6686125b920d4003e6ebd01f6a95cb3e89..f01544f9f3291ab5172f72f74e6474b77716e124 100644 --- a/configs/picodet/README.md +++ b/configs/picodet/README.md @@ -6,7 +6,7 @@ We developed a series of lightweight models, which named `PicoDet`. Because of its excellent performance, it is very suitable for deployment on mobile or CPU. - 🌟 Higher mAP: the **first** object detectors that surpass mAP(0.5:0.95) **30+** within 1M parameters when the input size is 416. -- 🚀 Faster latency: 114FPS on mobile ARM CPU. +- 🚀 Faster latency: 129FPS on mobile ARM CPU. - 😊 Deploy friendly: support PaddleLite/MNN/NCNN/OpenVINO and provide C++/Python/Android implementation. - 😍 Advanced algorithm: use the most advanced algorithms and innovate, such as ESNet, CSP-PAN, SimOTA with VFL, etc. @@ -19,30 +19,42 @@ We developed a series of lightweight models, which named `PicoDet`. Because of i - PaddlePaddle >= 2.1.2 - PaddleSlim >= 2.1.1 -## Model Zoo +## Benchmark -| Model | Input size | mAPval
0.5:0.95 | mAPval
0.5 | FLOPS
(G) | Params
(M) | Latency
(ms) | download | config | +| Model | Input size | mAPval
0.5:0.95 | mAPval
0.5 | Params
(M) | FLOPS
(G) | Latency
(ms) | download | config | | :------------------------ | :-------: | :------: | :---: | :---: | :---: | :------------: | :-------------------------------------------------: | :-----: | -| PicoDet-S | 320*320 | 27.1 | 41.4 | -- | 3.9M | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_s_320_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_s_320_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_s_320_coco.yml) | -| PicoDet-M | 320*320 | 30.9 | 45.7 | -- | 8.4M | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_m_320_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_m_320_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_m_320_coco.yml) | -| PicoDet-L | 320*320 | 32.6 | 47.9 | -- | 13M | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_l_320_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_l_320_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_l_320_coco.yml) | -| PicoDet-S | 416*416 | 30.6 | 45.5 | -- | 3.9M | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_s_416_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_s_416_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_s_416_coco.yml) | -| PicoDet-M | 416*416 | 34.3 | 49.8 | -- | 8.4M | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_m_416_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_m_416_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_m_416_coco.yml) | -| PicoDet-L | 416*416 | - | - | -- | 13M | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_l_416_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_l_416_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_l_416_coco.yml) | -| PicoDet-L | 640*640 | - | - | -- | 13M | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_l_640_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_l_640_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_l_640_coco.yml) | +| PicoDet-S | 320*320 | 27.1 | 41.4 | 0.99 | 0.73 | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_s_320_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_s_320_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_s_320_coco.yml) | +| PicoDet-S | 416*416 | 30.6 | 45.5 | 0.99 | 1.24 | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_s_416_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_s_416_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_s_416_coco.yml) | +| PicoDet-M | 320*320 | 30.9 | 45.7 | 2.15 | 1.48 | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_m_320_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_m_320_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_m_320_coco.yml) | +| PicoDet-M | 416*416 | 34.3 | 49.8 | 2.15 | 2.50 | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_m_416_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_m_416_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_m_416_coco.yml) | +| PicoDet-L | 320*320 | 32.6 | 47.9 | 3.24 | 2.18 | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_l_320_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_l_320_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_l_320_coco.yml) | +| PicoDet-L | 416*416 | 35.9 | 51.7 | 3.24 | 3.69 | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_l_416_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_l_416_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_l_416_coco.yml) | +| PicoDet-L | 640*640 | 40.3 | 57.1 | 3.24 | 8.74 | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_l_640_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_l_640_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_l_640_coco.yml) | -**Notes:** -- PicoDet inference speed is tested on Snapdragon 888(4xA78+4xA55) with 4 threads by arm8 and with FP16. -- PicoDet is trained on COCO train2017 dataset and evaluated on val2017. -- PicoDet used 4 or 8 GPUs for training. +
+Table Notes (click to expand) + +- PicoDet inference speed is tested on SD 888(1*X1+3*A78+4*A55) with 4 threads by arm8 and with FP16. +- PicoDet is trained on COCO train2017 dataset and evaluated on COCO val2017. +- PicoDet used 4 or 8 GPUs for training and all checkpoints are trained to 300 epochs with default settings and hyperparameters. + +
+ +## More config + +| Model | Input size | mAPval
0.5:0.95 | mAPval
0.5 | Params
(M) | FLOPS
(G) | Latency
(ms) | download | config | +| :------------------------ | :-------: | :------: | :---: | :---: | :---: | :------------: | :-------------------------------------------------: | :-----: | +| PicoDet-Shufflenetv2 1x | 416*416 | 30.0 | 44.6 | 1.17 | 1.53 | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_shufflenetv2_1x_416_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_shufflenetv2_1x_416_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/more_config/picodet_shufflenetv2_1x_416_coco.yml) | +| PicoDet-MobileNetv3-large 1x | 416*416 | 35.6 | 52.0 | 3.55 | 2.80 | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_mobilenetv3_large_1x_416_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_mobilenetv3_large_1x_416_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/more_config/picodet_mobilenetv3_large_1x_416_coco.yml) | +| PicoDet-LCNet 1.5x | 416*416 | 36.3 | 52.2 | 3.10 | 3.85 | -- | [model](https://paddledet.bj.bcebos.com/models/picodet_lcnet_1_5x_416_coco.pdparams) | [log](https://paddledet.bj.bcebos.com/logs/train_picodet_lcnet_1_5x_416_coco.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/more_config/picodet_lcnet_1_5x_416_coco.yml) | ## Deployment ### Export and Convert model
-1. Export model +1. Export model (click to expand) ```shell cd PaddleDetection @@ -53,7 +65,7 @@ python tools/export_model.py -c configs/picodet/picodet_s_320_coco.yml \
-2. Convert to PaddleLite +2. Convert to PaddleLite (click to expand) - Install Paddlelite>=2.10.rc: @@ -73,7 +85,7 @@ paddle_lite_opt --model_dir=inference_model/picodet_s_320_coco --valid_targets=a
-3. Convert to ONNX +3. Convert to ONNX (click to expand) - Install [Paddle2ONNX](https://github.com/PaddlePaddle/Paddle2ONNX) >= 0.7 and ONNX > 1.10.1, for details, please refer to [Tutorials of Export ONNX Model](../../deploy/EXPORT_ONNX_MODEL.md) @@ -109,9 +121,9 @@ paddle2onnx --model_dir output_inference/picodet_s_320_coco/ \ - PaddleInference demo [Python](../../deploy/python) & [C++](../../deploy/cpp) - [PaddleLite C++ demo](../../deploy/lite) -- [NCNN C++ demo]() -- [MNN C++ demo]() -- [OpenVINO C++ demo]() +- [NCNN C++/Python demo](../../deploy/third_engine/demo_ncnn) +- [MNN C++/Python demo](../../deploy/third_engine/demo_mnn) +- [OpenVINO C++/Python demo](../../deploy/third_engine/demo_openvino) - [Android demo]() ## Slim @@ -119,7 +131,7 @@ paddle2onnx --model_dir output_inference/picodet_s_320_coco/ \ ### quantization
-Quant aware +Quant aware (click to expand) Configure the quant config and start training: @@ -131,13 +143,13 @@ python tools/train.py -c configs/picodet/picodet_s_320_coco.yml \
-Post quant +Post quant (click to expand) Configure the post quant config and start calibrate model: ```shell -python tools/posy_quant.py -c configs/picodet/picodet_s_320_coco.yml \ - --slim_config configs/slim/posy_quant/picodet_s_quant.yml +python tools/post_quant.py -c configs/picodet/picodet_s_320_coco.yml \ + --slim_config configs/slim/post_quant/picodet_s_ptq.yml ```
diff --git a/configs/picodet/more_config/picodet_lcnet_416_coco.yml b/configs/picodet/more_config/picodet_lcnet_1_5x_416_coco.yml similarity index 57% rename from configs/picodet/more_config/picodet_lcnet_416_coco.yml rename to configs/picodet/more_config/picodet_lcnet_1_5x_416_coco.yml index cdfc59919a7a2d103c29c93a20ae0ea361130cac..02a30012e490a8a7666edecdb6af2bdf933cdd6e 100644 --- a/configs/picodet/more_config/picodet_lcnet_416_coco.yml +++ b/configs/picodet/more_config/picodet_lcnet_1_5x_416_coco.yml @@ -6,8 +6,8 @@ _BASE_: [ '../_base_/picodet_416_reader.yml', ] -pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/LCNet_x1_0_pretrained.pdparams -weights: output/picodet_lcnet_416_coco/model_final +pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/LCNet_x1_5_pretrained.pdparams +weights: output/picodet_lcnet_1_5x_416_coco/model_final find_unused_parameters: True use_ema: true cycle_epoch: 40 @@ -19,19 +19,5 @@ PicoDet: head: PicoHead LCNet: - scale: 1.0 + scale: 1.5 feature_maps: [3, 4, 5] - -CSPPAN: - out_channels: 96 - -PicoHead: - conv_feat: - name: PicoFeat - feat_in: 96 - feat_out: 96 - num_convs: 2 - num_fpn_stride: 4 - norm_type: bn - share_cls_reg: True - feat_in_chan: 96 diff --git a/configs/picodet/more_config/picodet_mobilenetv3_416_coco.yml b/configs/picodet/more_config/picodet_mobilenetv3_large_1x_416_coco.yml similarity index 90% rename from configs/picodet/more_config/picodet_mobilenetv3_416_coco.yml rename to configs/picodet/more_config/picodet_mobilenetv3_large_1x_416_coco.yml index fb4cc96ee1d0189e18d9c62774780a46c31f7bb1..bc8893e7759421e8ad7975ad847b193cecb60708 100644 --- a/configs/picodet/more_config/picodet_mobilenetv3_416_coco.yml +++ b/configs/picodet/more_config/picodet_mobilenetv3_large_1x_416_coco.yml @@ -7,11 +7,12 @@ _BASE_: [ ] pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/MobileNetV3_large_x1_0_ssld_pretrained.pdparams -weights: output/picodet_mobilenetv3_416_coco/model_final +weights: output/picodet_mobilenetv3_large_1x_416_coco/model_final find_unused_parameters: True use_ema: true cycle_epoch: 40 snapshot_epoch: 10 +epoch: 180 PicoDet: backbone: MobileNetV3 diff --git a/configs/picodet/more_config/picodet_shufflenetv2_416_coco.yml b/configs/picodet/more_config/picodet_shufflenetv2_1x_416_coco.yml similarity index 92% rename from configs/picodet/more_config/picodet_shufflenetv2_416_coco.yml rename to configs/picodet/more_config/picodet_shufflenetv2_1x_416_coco.yml index cefcf18efaf9ef453f54b8a4b3672ab5fad5b9e3..04b020a89c3c476a09f9e93bde9d475e5fda076d 100644 --- a/configs/picodet/more_config/picodet_shufflenetv2_416_coco.yml +++ b/configs/picodet/more_config/picodet_shufflenetv2_1x_416_coco.yml @@ -7,7 +7,7 @@ _BASE_: [ ] pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ShuffleNetV2_x1_0_pretrained.pdparams -weights: output/picodet_shufflenetv2_416_coco/model_final +weights: output/picodet_shufflenetv2_1x_416_coco/model_final find_unused_parameters: True use_ema: true cycle_epoch: 40 diff --git a/configs/picodet/picodet_l_320_coco.yml b/configs/picodet/picodet_l_320_coco.yml index 23320cd368989be9c4b9f9ae4b68b6d85a0ab4c3..ea9aef722adcdf982ecd7320e652b3ffd8329d74 100644 --- a/configs/picodet/picodet_l_320_coco.yml +++ b/configs/picodet/picodet_l_320_coco.yml @@ -12,6 +12,7 @@ find_unused_parameters: True use_ema: true cycle_epoch: 40 snapshot_epoch: 10 +epoch: 250 ESNet: scale: 1.25 diff --git a/configs/picodet/picodet_l_416_coco.yml b/configs/picodet/picodet_l_416_coco.yml index 720125179f765b28c04b7754d5da2f79606d6817..1a867d8b650c86d99d7ef75d8d923a756aa4762c 100644 --- a/configs/picodet/picodet_l_416_coco.yml +++ b/configs/picodet/picodet_l_416_coco.yml @@ -12,6 +12,7 @@ find_unused_parameters: True use_ema: true cycle_epoch: 40 snapshot_epoch: 10 +epoch: 250 ESNet: scale: 1.25 diff --git a/configs/picodet/picodet_l_640_coco.yml b/configs/picodet/picodet_l_640_coco.yml index 2578eedd343e07d75c8b67ac4e746d956c9bcbe0..1900aa55247b397c1e8aaacbdab450e2afd3fd54 100644 --- a/configs/picodet/picodet_l_640_coco.yml +++ b/configs/picodet/picodet_l_640_coco.yml @@ -12,6 +12,7 @@ find_unused_parameters: True use_ema: true cycle_epoch: 40 snapshot_epoch: 10 +epoch: 250 ESNet: scale: 1.25