README.md 5.5 KB
Newer Older
Y
Yang Zhang 已提交
1
[English](README_en.md) | 简体中文
2

Y
Yang Zhang 已提交
3
# 移动端模型库
4 5


Y
Yang Zhang 已提交
6
## 模型
7

Y
Yang Zhang 已提交
8 9
PaddleDetection目前提供一系列针对移动应用进行优化的模型,主要支持以下结构:

10 11 12 13 14 15 16 17
| 骨干网络                 | 结构                   | 输入大小 | 图片/gpu <sup>1</sup>  | 学习率策略    | Box AP | 下载 | PaddleLite模型下载 |
| :----------------------- | :------------------------ | :---: | :--------------------: | :------------ | :----: | :--- | :----------------- |
| MobileNetV3 Small        | SSDLite                   | 320   | 64                     | 400K (cosine) | 16.6   | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/ssdlite_mobilenet_v3_small.tar) | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/lite/ssdlite_mobilenet_v3_small.tar) |
| MobileNetV3 Large        | SSDLite                   | 320   | 64                     | 400K (cosine) | 22.8   | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/ssdlite_mobilenet_v3_large.tar) | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/lite/ssdlite_mobilenet_v3_large.tar) |
| MobileNetV3 Large w/ FPN | Cascade RCNN              | 320   | 2                      | 500k (cosine) | 25.0   | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/cascade_rcnn_mobilenetv3_fpn_320.tar) | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/lite/cascade_rcnn_mobilenetv3_fpn_320.tar) |
| MobileNetV3 Large w/ FPN | Cascade RCNN              | 640   | 2                      | 500k (cosine) | 30.2   | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/cascade_rcnn_mobilenetv3_fpn_640.tar) | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/lite/cascade_rcnn_mobilenetv3_fpn_640.tar) |
| MobileNetV3 Large        | YOLOv3                    | 320   | 8                      | 500K          | 27.1   | [链接](https://paddlemodels.bj.bcebos.com/object_detection/yolov3_mobilenet_v3.pdparams) | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/lite/yolov3_mobilenet_v3.tar) |
| MobileNetV3 Large        | YOLOv3 Prune <sup>2</sup> | 320   | 8                      | -             | 24.6   | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/yolov3_mobilenet_v3_prune75875_FPGM_distillby_r34.pdparams) | [链接](https://paddlemodels.bj.bcebos.com/object_detection/mobile_models/lite/yolov3_mobilenet_v3_prune86_FPGM_320.tar) |
18

Y
Yang Zhang 已提交
19
**注意**:
20

Y
Yang Zhang 已提交
21
-   <a name="gpu">[1]</a> 模型统一使用8卡训练.
22
-   <a name="prune">[2]</a> 参考下面关于YOLO剪裁的说明
23 24


Y
Yang Zhang 已提交
25
## 评测结果
26

Y
Yang Zhang 已提交
27
-   模型使用 [Paddle-Lite](https://github.com/PaddlePaddle/Paddle-Lite) 2.6 (即将发布) 在下列平台上进行了测试
28 29 30 31 32 33
    -   Qualcomm Snapdragon 625
    -   Qualcomm Snapdragon 835
    -   Qualcomm Snapdragon 845
    -   Qualcomm Snapdragon 855
    -   HiSilicon Kirin 970
    -   HiSilicon Kirin 980
34

Y
Yang Zhang 已提交
35
-   单CPU线程 (单位: ms)
36

37 38 39 40 41 42 43 44 45
|                  | SD625   | SD835   | SD845   | SD855   | Kirin 970 | Kirin 980 |
|------------------|---------|---------|---------|---------|-----------|-----------|
| SSDLite Large    | 289.071 | 134.408 | 91.933  | 48.2206 | 144.914   | 55.1186   |
| SSDLite Small    | 122.932 | 57.1914 | 41.003  | 22.0694 | 61.5468   | 25.2106   |
| YOLOv3 baseline  | 1082.5  | 435.77  | 317.189 | 155.948 | 536.987   | 178.999   |
| YOLOv3 prune     | 253.98  | 131.279 | 89.4124 | 48.2856 | 122.732   | 55.8626   |
| Cascade RCNN 320 | 286.526 | 125.635 | 87.404  | 46.184  | 149.179   | 52.9994   |
| Cascade RCNN 640 | 1115.66 | 495.926 | 351.361 | 189.722 | 573.558   | 207.917   |

Y
Yang Zhang 已提交
46
-   4 CPU线程 (单位: ms)
47

48 49 50 51 52 53 54 55
|                  | SD625   | SD835   | SD845   | SD855   | Kirin 970 | Kirin 980 |
|------------------|---------|---------|---------|---------|-----------|-----------|
| SSDLite Large    | 107.535 | 51.1382 | 34.6392 | 20.4978 | 50.5598   | 24.5318   |
| SSDLite Small    | 51.5704 | 24.5156 | 18.5486 | 11.4218 | 24.9946   | 16.7158   |
| YOLOv3 baseline  | 413.486 | 184.248 | 133.624 | 75.7354 | 202.263   | 126.435   |
| YOLOv3 prune     | 98.5472 | 53.6228 | 34.4306 | 21.3112 | 44.0722   | 31.201    |
| Cascade RCNN 320 | 131.515 | 59.6026 | 39.4338 | 23.5802 | 58.5046   | 36.9486   |
| Cascade RCNN 640 | 473.083 | 224.543 | 156.205 | 100.686 | 231.108   | 138.391   |
56 57


Y
Yang Zhang 已提交
58
## YOLOv3剪裁说明
59

Y
Yang Zhang 已提交
60
首先对YOLO检测头进行剪裁,然后再使用 YOLOv3-ResNet34 作为teacher网络对剪裁后的模型进行蒸馏, teacher网络在COCO的mAP为31.4 (输入大小320\*320).
61

Y
Yang Zhang 已提交
62
可以使用如下两种方式进行剪裁:
63

Y
Yang Zhang 已提交
64
-   固定比例剪裁, 整体剪裁率是86%
65 66 67 68 69

    ```shell
    --pruned_params="yolo_block.0.0.0.conv.weights,yolo_block.0.0.1.conv.weights,yolo_block.0.1.0.conv.weights,yolo_block.0.1.1.conv.weights,yolo_block.0.2.conv.weights,yolo_block.0.tip.conv.weights,yolo_block.1.0.0.conv.weights,yolo_block.1.0.1.conv.weights,yolo_block.1.1.0.conv.weights,yolo_block.1.1.1.conv.weights,yolo_block.1.2.conv.weights,yolo_block.1.tip.conv.weights,yolo_block.2.0.0.conv.weights,yolo_block.2.0.1.conv.weights,yolo_block.2.1.0.conv.weights,yolo_block.2.1.1.conv.weights,yolo_block.2.2.conv.weights,yolo_block.2.tip.conv.weights" \
    --pruned_ratios="0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.75,0.875,0.875,0.875,0.875,0.875,0.875"
    ```
Y
Yang Zhang 已提交
70
-   使用 [FPGM](https://arxiv.org/abs/1811.00250) 算法剪裁:
71 72 73 74 75 76

    ```shell
    --prune_criterion=geometry_median
    ```


Y
Yang Zhang 已提交
77
## 敬请关注后续发布
78

Y
Yang Zhang 已提交
79 80
-   [ ] 更多模型
-   [ ] 量化模型