README.md 18.6 KB
Newer Older
G
Guanghua Yu 已提交
1 2
English | [简体中文](README_cn.md)

G
Guanghua Yu 已提交
3
# PP-PicoDet
G
Guanghua Yu 已提交
4

G
Guanghua Yu 已提交
5
![](../../docs/images/picedet_demo.jpeg)
G
Guanghua Yu 已提交
6 7 8

## News

G
Guanghua Yu 已提交
9 10 11 12 13 14
- Released a new series of PP-PicoDet models, it was used TAL/Task-aligned-Head and optimized PAN, which improved the accuracy and optimized CPU prediction speed. Moreover the training speed is greatly improved. **(2022.03.20)**

### Legacy Model

- Please refer to: [PicoDet 2021.10版本](./legacy_model/)

G
Guanghua Yu 已提交
15 16
## Introduction

G
Guanghua Yu 已提交
17
We developed a series of lightweight models, named `PP-PicoDet`. Because of the excellent performance, our models are very suitable for deployment on mobile or CPU. For more details, please refer to our [report on arXiv](https://arxiv.org/abs/2111.00902).
G
Guanghua Yu 已提交
18

G
Guanghua Yu 已提交
19
- 🌟 Higher mAP: the **first** object detectors that surpass mAP(0.5:0.95) **30+** within 1M parameters when the input size is 416.
G
Guanghua Yu 已提交
20
- 🚀 Faster latency: 150FPS on mobile ARM CPU.
21
- 😊 Deploy friendly: support PaddleLite/MNN/NCNN/OpenVINO and provide C++/Python/Android implementation.
G
Guanghua Yu 已提交
22
- 😍 Advanced algorithm: use the most advanced algorithms and offer innovation, such as ESNet, CSP-PAN, SimOTA with VFL, etc.
23

G
Guanghua Yu 已提交
24 25 26 27 28

<div align="center">
  <img src="../../docs/images/picodet_map.png" width='600'/>
</div>

G
Guanghua Yu 已提交
29
## Benchmark
G
Guanghua Yu 已提交
30

G
Guanghua Yu 已提交
31 32
| Model     | Input size | mAP<sup>val<br>0.5:0.95 | mAP<sup>val<br>0.5 | Params<br><sup>(M) | FLOPS<br><sup>(G) | Latency<sup><small>[NCNN](#latency)</small><sup><br><sup>(ms) | Latency<sup><small>[Lite](#latency)</small><sup><br><sup>(ms) |  Download  | Config |
| :-------- | :--------: | :---------------------: | :----------------: | :----------------: | :---------------: | :-----------------------------: | :-----------------------------: | :----------------------------------------: | :--------------------------------------- |
G
Guanghua Yu 已提交
33 34 35 36 37 38 39 40 41
| PicoDet-XS |  320*320   |          23.5           |        36.1       |        -        |       -        |              -              |            -             | [model](https://paddledet.bj.bcebos.com/models/picodet_xs_320_coco_lcnet.pdparams) &#124; [log](https://paddledet.bj.bcebos.com/logs/train_picodet_xs_320_coco_lcnet.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_xs_320_coco_lcnet.yml) |
| PicoDet-XS |  416*416   |          26.2           |        39.3        |        -        |       -        |              -              |            -             | [model](https://paddledet.bj.bcebos.com/models/picodet_xs_416_coco_lcnet.pdparams) &#124; [log](https://paddledet.bj.bcebos.com/logs/train_picodet_xs_416_coco_lcnet.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_xs_416_coco_lcnet.yml) |
| PicoDet-S |  320*320   |          29.1           |        43.4        |        -       |       -       |             -              |            -             | [model](https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams) &#124; [log](https://paddledet.bj.bcebos.com/logs/train_picodet_s_320_coco_lcnet.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_s_320_coco_lcnet.yml) |
| PicoDet-S |  416*416   |          32.5           |        47.6        |        -        |       -       |              -              |            -             | [model](https://paddledet.bj.bcebos.com/models/picodet_s_416_coco_lcnet.pdparams) &#124; [log](https://paddledet.bj.bcebos.com/logs/train_picodet_s_416_coco_lcnet.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_s_416_coco_lcnet.yml) |
| PicoDet-M |  320*320   |          34.4           |        50.0        |        -        |       -       |              -              |            -             | [model](https://paddledet.bj.bcebos.com/models/picodet_m_320_coco_lcnet.pdparams) &#124; [log](https://paddledet.bj.bcebos.com/logs/train_picodet_m_320_coco_lcnet.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_m_320_coco_lcnet.yml) |
| PicoDet-M |  416*416   |          37.5           |        53.4       |        -        |       -        |              -              |            -            | [model](https://paddledet.bj.bcebos.com/models/picodet_m_416_coco_lcnet.pdparams) &#124; [log](https://paddledet.bj.bcebos.com/logs/train_picodet_m_416_coco_lcnet.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_m_416_coco_lcnet.yml) |
| PicoDet-L |  320*320   |          36.1           |        52.0        |        -       |       -        |              -             |            -           | [model](https://paddledet.bj.bcebos.com/models/picodet_l_320_coco_lcnet.pdparams) &#124; [log](https://paddledet.bj.bcebos.com/logs/train_picodet_l_320_coco_lcnet.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_l_320_coco_lcnet.yml) |
| PicoDet-L |  416*416   |          39.4           |        55.7        |        -        |       -       |              -              |            -            | [model](https://paddledet.bj.bcebos.com/models/picodet_l_416_coco_lcnet.pdparams) &#124; [log](https://paddledet.bj.bcebos.com/logs/train_picodet_l_416_coco_lcnet.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_l_416_coco_lcnet.yml) |
| PicoDet-L |  640*640   |          42.3           |        59.2        |        -        |       -        |              -              |            -           | [model](https://paddledet.bj.bcebos.com/models/picodet_l_640_coco_lcnet.pdparams) &#124; [log](https://paddledet.bj.bcebos.com/logs/train_picodet_l_640_coco_lcnet.log) | [config](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/picodet_l_640_coco_lcnet.yml) |
42

G
Guanghua Yu 已提交
43 44 45
<details open>
<summary><b>Table Notes:</b></summary>

G
Guanghua Yu 已提交
46
- <a name="latency">Latency:</a> All our models test on `Qualcomm Snapdragon 865(4xA77+4xA55)` with 4 threads by arm8 and with FP16. In the above table, test latency on [NCNN](https://github.com/Tencent/ncnn) and `Lite`->[Paddle-Lite](https://github.com/PaddlePaddle/Paddle-Lite).  And testing latency with code: [MobileDetBenchmark](https://github.com/JiweiMaster/MobileDetBenchmark).
G
Guanghua Yu 已提交
47 48 49 50
- 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 with default settings and hyperparameters.

</details>
51

G
Guanghua Yu 已提交
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
#### Benchmark of Other Models

| Model     | Input size | mAP<sup>val<br>0.5:0.95 | mAP<sup>val<br>0.5 | Params<br><sup>(M) | FLOPS<br><sup>(G) | Latency<sup><small>[NCNN](#latency)</small><sup><br><sup>(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                          |

G
Guanghua Yu 已提交
68

G
Guanghua Yu 已提交
69 70 71 72 73
## Quick Start

<details open>
<summary>Requirements:</summary>

G
Guanghua Yu 已提交
74
- PaddlePaddle >= 2.2.1
G
Guanghua Yu 已提交
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93

</details>

<details>
<summary>Installation</summary>

- [Installation guide](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/docs/tutorials/INSTALL.md)
- [Prepare dataset](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/docs/tutorials/PrepareDataSet_en.md)

</details>

<details>
<summary>Training and Evaluation</summary>

- Training model on single-GPU:

```shell
# training on single-GPU
export CUDA_VISIBLE_DEVICES=0
G
Guanghua Yu 已提交
94
python tools/train.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --eval
G
Guanghua Yu 已提交
95 96 97 98 99 100 101 102
```

- Training model on multi-GPU:


```shell
# training on single-GPU
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
G
Guanghua Yu 已提交
103
python -m paddle.distributed.launch --gpus 0,1,2,3,4,5,6,7 tools/train.py -c configs/picodet/picodet_s_320_coco_lcnet.yml --eval
G
Guanghua Yu 已提交
104 105 106 107 108
```

- Evaluation:

```shell
G
Guanghua Yu 已提交
109 110
python tools/eval.py -c configs/picodet/picodet_s_320_coco_lcnet.yml \
              -o weights=https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams
G
Guanghua Yu 已提交
111 112 113 114 115
```

- Infer:

```shell
G
Guanghua Yu 已提交
116 117
python tools/infer.py -c configs/picodet/picodet_s_320_coco_lcnet.yml \
              -o weights=https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams
G
Guanghua Yu 已提交
118 119 120 121 122 123 124
```

Detail also can refer to [Quick start guide](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/docs/tutorials/GETTING_STARTED.md).

</details>


G
Guanghua Yu 已提交
125 126
## Deployment

G
Guanghua Yu 已提交
127
### Export and Convert Model
G
Guanghua Yu 已提交
128 129

<details>
G
Guanghua Yu 已提交
130
<summary>1. Export model (click to expand)</summary>
G
Guanghua Yu 已提交
131 132 133

```shell
cd PaddleDetection
G
Guanghua Yu 已提交
134 135
python tools/export_model.py -c configs/picodet/picodet_s_320_coco_lcnet.yml \
              -o weights=https://paddledet.bj.bcebos.com/models/picodet_s_320_coco_lcnet.pdparams \
G
Guanghua Yu 已提交
136
              --output_dir=inference_model
G
Guanghua Yu 已提交
137 138 139 140 141
```

</details>

<details>
G
Guanghua Yu 已提交
142
<summary>2. Convert to PaddleLite (click to expand)</summary>
G
Guanghua Yu 已提交
143

G
Guanghua Yu 已提交
144
- Install Paddlelite>=2.10:
G
Guanghua Yu 已提交
145 146 147 148 149 150 151 152 153

```shell
pip install paddlelite
```

- Convert model:

```shell
# FP32
G
Guanghua Yu 已提交
154
paddle_lite_opt --model_dir=inference_model/picodet_s_320_coco_lcnet --valid_targets=arm --optimize_out=picodet_s_320_coco_fp32
G
Guanghua Yu 已提交
155
# FP16
G
Guanghua Yu 已提交
156
paddle_lite_opt --model_dir=inference_model/picodet_s_320_coco_lcnet --valid_targets=arm --optimize_out=picodet_s_320_coco_fp16 --enable_fp16=true
G
Guanghua Yu 已提交
157 158 159 160 161
```

</details>

<details>
G
Guanghua Yu 已提交
162
<summary>3. Convert to ONNX (click to expand)</summary>
G
Guanghua Yu 已提交
163 164 165 166 167 168 169 170 171 172 173

- 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)

```shell
pip install onnx
pip install paddle2onnx
```

- Convert model:

```shell
G
Guanghua Yu 已提交
174
paddle2onnx --model_dir output_inference/picodet_s_320_coco_lcnet/ \
G
Guanghua Yu 已提交
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
            --model_filename model.pdmodel  \
            --params_filename model.pdiparams \
            --opset_version 11 \
            --save_file picodet_s_320_coco.onnx
```

- Simplify ONNX model: use onnx-simplifier to simplify onnx model.

  - Install onnx-simplifier >= 0.3.6:
  ```shell
  pip install onnx-simplifier
  ```
  - simplify onnx model:
  ```shell
  python -m onnxsim picodet_s_320_coco.onnx picodet_s_processed.onnx
  ```

</details>

G
Guanghua Yu 已提交
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
- Deploy models

| Model     | Input size | ONNX  | Paddle Lite(fp32) | Paddle Lite(fp16) |
| :-------- | :--------: | :---------------------: | :----------------: | :----------------: |
| PicoDet-S |  320*320   | [model](https://paddledet.bj.bcebos.com/deploy/third_engine/picodet_s_320_coco.onnx) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_s_320.tar) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_s_320_fp16.tar) |
| PicoDet-S |  416*416   |  [model](https://paddledet.bj.bcebos.com/deploy/third_engine/picodet_s_416_coco.onnx) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_s_416.tar) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_s_416_fp16.tar) |
| PicoDet-M |  320*320   | [model](https://paddledet.bj.bcebos.com/deploy/third_engine/picodet_m_320_coco.onnx) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_m_320.tar) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_m_320_fp16.tar) |
| PicoDet-M |  416*416   | [model](https://paddledet.bj.bcebos.com/deploy/third_engine/picodet_m_416_coco.onnx) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_m_416.tar) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_m_416_fp16.tar) |
| PicoDet-L |  320*320   | [model](https://paddledet.bj.bcebos.com/deploy/third_engine/picodet_l_320_coco.onnx) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_l_320.tar) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_l_320_fp16.tar) |
| PicoDet-L |  416*416   | [model](https://paddledet.bj.bcebos.com/deploy/third_engine/picodet_l_416_coco.onnx) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_l_416.tar) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_l_416_fp16.tar) |
| PicoDet-L |  640*640   | [model](https://paddledet.bj.bcebos.com/deploy/third_engine/picodet_l_640_coco.onnx) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_l_640.tar) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_l_640_fp16.tar) |
| PicoDet-Shufflenetv2 1x      |  416*416   | [model](https://paddledet.bj.bcebos.com/deploy/third_engine/picodet_shufflenetv2_1x_416_coco.onnx) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_shufflenetv2_1x.tar) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_shufflenetv2_1x_fp16.tar) |
| PicoDet-MobileNetv3-large 1x |  416*416   | [model](https://paddledet.bj.bcebos.com/deploy/third_engine/picodet_mobilenetv3_large_1x_416_coco.onnx) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_mobilenetv3_large_1x.tar) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_mobilenetv3_large_1x_fp16.tar) |
| PicoDet-LCNet 1.5x           |  416*416   | [model](https://paddledet.bj.bcebos.com/deploy/third_engine/picodet_lcnet_1_5x_416_coco.onnx) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_lcnet_1_5x.tar) | [model](https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_lcnet_1_5x_fp16.tar) |


G
Guanghua Yu 已提交
210 211 212 213
### Deploy

- PaddleInference demo [Python](../../deploy/python) & [C++](../../deploy/cpp)
- [PaddleLite C++ demo](../../deploy/lite)
G
Guanghua Yu 已提交
214 215
- [NCNN C++/Python demo](../../deploy/third_engine/demo_ncnn)
- [MNN C++/Python demo](../../deploy/third_engine/demo_mnn)
G
Guanghua Yu 已提交
216
- [OpenVINO C++ demo](../../deploy/third_engine/demo_openvino)
L
lilithzhou 已提交
217 218
- [Android demo(NCNN)](https://github.com/JiweiMaster/PP-PicoDet-Android-Demo)(Thank @[Jewel](https://github.com/JiweiMaster) for his contribution to PaddleDetection)
- [Android demo(Paddle Lite)](https://github.com/marsplus-wjh/Picodet-PaddleLite-AndroidDemo)(Thank @[JiaHui-Wang](https://github.com/marsplus-wjh) for his contribution to PaddleDetection)
G
Guanghua Yu 已提交
219 220


G
Guanghua Yu 已提交
221
Android demo visualization:
G
Guanghua Yu 已提交
222 223 224 225
<div align="center">
  <img src="../../docs/images/picodet_android_demo1.jpg" height="500px" ><img src="../../docs/images/picodet_android_demo2.jpg" height="500px" ><img src="../../docs/images/picodet_android_demo3.jpg" height="500px" ><img src="../../docs/images/picodet_android_demo4.jpg" height="500px" >
</div>

G
Guanghua Yu 已提交
226

G
Guanghua Yu 已提交
227
## Quantization
G
Guanghua Yu 已提交
228

G
Guanghua Yu 已提交
229 230 231
<details open>
<summary>Requirements:</summary>

G
Guanghua Yu 已提交
232 233
- PaddlePaddle >= 2.2.2
- PaddleSlim >= 2.2.1
G
Guanghua Yu 已提交
234 235 236 237

**Install:**

```shell
G
Guanghua Yu 已提交
238
pip install paddleslim==2.2.1
G
Guanghua Yu 已提交
239 240 241 242
```

</details>

G
Guanghua Yu 已提交
243
<details>
G
Guanghua Yu 已提交
244
<summary>Quant aware (click to expand)</summary>
G
Guanghua Yu 已提交
245 246 247 248

Configure the quant config and start training:

```shell
G
Guanghua Yu 已提交
249
python tools/train.py -c configs/picodet/picodet_s_320_coco_lcnet.yml \
G
Guanghua Yu 已提交
250 251 252
          --slim_config configs/slim/quant/picodet_s_quant.yml --eval
```

G
Guanghua Yu 已提交
253 254
- More detail can refer to [slim document](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/slim)

G
Guanghua Yu 已提交
255 256 257
</details>

<details>
G
Guanghua Yu 已提交
258
<summary>Post quant (click to expand)</summary>
G
Guanghua Yu 已提交
259 260 261 262

Configure the post quant config and start calibrate model:

```shell
G
Guanghua Yu 已提交
263
python tools/post_quant.py -c configs/picodet/picodet_s_320_coco_lcnet.yml \
G
Guanghua Yu 已提交
264
          --slim_config configs/slim/post_quant/picodet_s_ptq.yml
G
Guanghua Yu 已提交
265 266
```

G
Guanghua Yu 已提交
267
- Notes: Now the accuracy of post quant is abnormal and this problem is being solved.
G
Guanghua Yu 已提交
268

G
Guanghua Yu 已提交
269
</details>
G
Guanghua Yu 已提交
270

M
minghaoBD 已提交
271 272 273 274 275
## Unstructured Pruning

<details open>
<summary>Toturial:</summary>

G
Guanghua Yu 已提交
276
Please refer this [documentation](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/picodet/pruner/README.md) for details such as requirements, training and deployment.
M
minghaoBD 已提交
277 278 279

</details>

G
Guanghua Yu 已提交
280 281 282 283
## Application

- **Pedestrian detection:** model zoo of `PicoDet-S-Pedestrian` please refer to [PP-TinyPose](https://github.com/PaddlePaddle/PaddleDetection/tree/develop/configs/keypoint/tiny_pose#%E8%A1%8C%E4%BA%BA%E6%A3%80%E6%B5%8B%E6%A8%A1%E5%9E%8B)

littletomatodonkey's avatar
littletomatodonkey 已提交
284 285
- **Mainbody detection:** model zoo of `PicoDet-L-Mainbody` please refer to [mainbody detection](./application/mainbody_detection/README.md)

G
Guanghua Yu 已提交
286 287 288 289 290 291 292 293 294
## FAQ

<details>
<summary>Out of memory error.</summary>

Please reduce the `batch_size` of `TrainReader` in config.

</details>

G
Guanghua Yu 已提交
295 296 297 298 299
<details>
<summary>How to transfer learning.</summary>

Please reset `pretrain_weights` in config, which trained on coco. Such as:
```yaml
G
Guanghua Yu 已提交
300
pretrain_weights: https://paddledet.bj.bcebos.com/models/picodet_l_640_coco_lcnet.pdparams
G
Guanghua Yu 已提交
301 302 303 304 305 306 307 308 309 310 311 312
```

</details>

<details>
<summary>The transpose operator is time-consuming on some hardware.</summary>

Please use `PicoDet-LCNet` model, which has fewer `transpose` operators.

</details>


W
Wenyu 已提交
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327
<details>
<summary>How to count model parameters.</summary>

You can insert below code at [here](https://github.com/PaddlePaddle/PaddleDetection/blob/develop/ppdet/engine/trainer.py#L141) to count learnable parameters.

```python
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)
```

</details>

G
Guanghua Yu 已提交
328 329
## Cite PP-PicoDet
If you use PicoDet in your research, please cite our work by using the following BibTeX entry:
G
Guanghua Yu 已提交
330
```
G
Guanghua Yu 已提交
331 332 333 334 335 336 337 338
@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}
}
G
Guanghua Yu 已提交
339 340

```