Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
20b2f101
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
20b2f101
编写于
4月 08, 2022
作者:
G
Guanghua Yu
提交者:
GitHub
4月 08, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[cherry-pick]add picodet quant model (#5618)
上级
6b525e00
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
46 addition
and
38 deletion
+46
-38
configs/picodet/README.md
configs/picodet/README.md
+12
-19
configs/picodet/README_en.md
configs/picodet/README_en.md
+12
-19
configs/slim/quant/picodet_s_416_lcnet_quant.yml
configs/slim/quant/picodet_s_416_lcnet_quant.yml
+22
-0
未找到文件。
configs/picodet/README.md
浏览文件 @
20b2f101
...
...
@@ -219,9 +219,10 @@ paddle2onnx --model_dir output_inference/picodet_s_320_coco_lcnet/ \
### 部署
-
PaddleInference demo
[
Python
](
../../deploy/python
)
&
[
C++
](
../../deploy/cpp
)
-
OpenVINO demo
[
Python
](
../../deploy/third_engine/demo/openvino/python
)
-
[
PaddleLite C++ demo
](
../../deploy/lite
)
-
[
Android demo(Paddle Lite)
](
https://github.com/PaddlePaddle/Paddle-Lite-Demo/tree/develop/object_detection/android/app/cxx/picodet_detection_demo
)
-
PaddleInference demo
[
Python
](
../../deploy/python
)
&
[
C++
](
../../deploy/cpp
)
Android demo可视化:
...
...
@@ -236,43 +237,35 @@ Android demo可视化:
<summary>
依赖包:
</summary>
-
PaddlePaddle >= 2.2.2
-
PaddleSlim >= 2.2.
1
-
PaddleSlim >= 2.2.
2
**安装:**
```
shell
pip
install
paddleslim
==
2.2.
1
pip
install
paddleslim
==
2.2.
2
```
</details>
<details>
<summary>
量化训练
(点击展开)
</summary>
<details
open
>
<summary>
量化训练
</summary>
开始量化训练:
```
shell
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/train.py
-c
configs/picodet/picodet_s_
416
_coco_lcnet.yml
\
--slim_config
configs/slim/quant/picodet_s_
416_lcnet_
quant.yml
--eval
```
-
更多细节请参考
[
slim文档
](
https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.4/configs/slim
)
</details>
<details>
<summary>
离线量化 (点击展开)
</summary>
校准及导出量化模型:
-
量化训练Model ZOO:
```
shell
python tools/post_quant.py
-c
configs/picodet/picodet_s_320_coco_lcnet.yml
\
--slim_config
configs/slim/post_quant/picodet_s_ptq.yml
```
-
注意: 离线量化模型精度问题正在解决中.
</details>
| 量化模型 | 输入尺寸 | mAP
<sup>
val
<br>
0.5:0.95 | Configs | Weight | Inference Model | Paddle Lite(INT8) |
| :-------- | :--------: | :--------------------: | :-------: | :----------------: | :----------------: | :----------------: |
| PicoDet-S | 416
*
416 | 31.5 |
[
config
](
./picodet_s_416_coco_lcnet.yml
)
|
[
slim config
](
../slim/quant/picodet_s_416_lcnet_quant.yml
)
|
[
model
](
https://paddledet.bj.bcebos.com/models/picodet_s_416_coco_lcnet_quant.pdparams
)
|
[
w/ 后处理
](
https://paddledet.bj.bcebos.com/deploy/Inference/picodet_s_416_coco_lcnet_quant.tar
)
|
[
w/o 后处理
](
https://paddledet.bj.bcebos.com/deploy/Inference/picodet_s_416_coco_lcnet_quant_non_postprocess.tar
)
|
[
w/ 后处理
](
https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_s_416_coco_lcnet_quant.nb
)
|
[
w/o 后处理
](
https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_s_416_coco_lcnet_quant_non_postprocess.nb
)
|
## 非结构化剪枝
...
...
configs/picodet/README_en.md
浏览文件 @
20b2f101
...
...
@@ -216,9 +216,10 @@ paddle2onnx --model_dir output_inference/picodet_s_320_coco_lcnet/ \
### Deploy
-
PaddleInference demo
[
Python
](
../../deploy/python
)
&
[
C++
](
../../deploy/cpp
)
-
OpenVINO demo
[
Python
](
../../deploy/third_engine/demo/openvino/python
)
-
[
PaddleLite C++ demo
](
../../deploy/lite
)
-
[
Android demo(Paddle Lite)
](
https://github.com/PaddlePaddle/Paddle-Lite-Demo/tree/develop/object_detection/android/app/cxx/picodet_detection_demo
)
-
PaddleInference demo
[
Python
](
../../deploy/python
)
&
[
C++
](
../../deploy/cpp
)
Android demo visualization:
...
...
@@ -233,43 +234,35 @@ Android demo visualization:
<summary>
Requirements:
</summary>
-
PaddlePaddle >= 2.2.2
-
PaddleSlim >= 2.2.
1
-
PaddleSlim >= 2.2.
2
**Install:**
```
shell
pip
install
paddleslim
==
2.2.
1
pip
install
paddleslim
==
2.2.
2
```
</details>
<details>
<summary>
Quant aware
(click to expand)
</summary>
<details
open
>
<summary>
Quant aware
</summary>
Configure the quant config and start training:
```
shell
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/train.py
-c
configs/picodet/picodet_s_
416
_coco_lcnet.yml
\
--slim_config
configs/slim/quant/picodet_s_
416_lcnet_
quant.yml
--eval
```
-
More detail can refer to
[
slim document
](
https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.4/configs/slim
)
</details>
<details>
<summary>
Post quant (click to expand)
</summary>
Configure the post quant config and start calibrate model:
-
Quant Aware Model ZOO:
```
shell
python tools/post_quant.py
-c
configs/picodet/picodet_s_320_coco_lcnet.yml
\
--slim_config
configs/slim/post_quant/picodet_s_ptq.yml
```
-
Notes: Now the accuracy of post quant is abnormal and this problem is being solved.
</details>
| Quant Model | Input size | mAP
<sup>
val
<br>
0.5:0.95 | Configs | Weight | Inference Model | Paddle Lite(INT8) |
| :-------- | :--------: | :--------------------: | :-------: | :----------------: | :----------------: | :----------------: |
| PicoDet-S | 416
*
416 | 31.5 |
[
config
](
./picodet_s_416_coco_lcnet.yml
)
|
[
slim config
](
../slim/quant/picodet_s_416_lcnet_quant.yml
)
|
[
model
](
https://paddledet.bj.bcebos.com/models/picodet_s_416_coco_lcnet_quant.pdparams
)
|
[
w/ postprocess
](
https://paddledet.bj.bcebos.com/deploy/Inference/picodet_s_416_coco_lcnet_quant.tar
)
|
[
w/o postprocess
](
https://paddledet.bj.bcebos.com/deploy/Inference/picodet_s_416_coco_lcnet_quant_non_postprocess.tar
)
|
[
w/ postprocess
](
https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_s_416_coco_lcnet_quant.nb
)
|
[
w/o postprocess
](
https://paddledet.bj.bcebos.com/deploy/paddlelite/picodet_s_416_coco_lcnet_quant_non_postprocess.nb
)
|
## Unstructured Pruning
...
...
configs/slim/quant/picodet_s_416_lcnet_quant.yml
0 → 100644
浏览文件 @
20b2f101
pretrain_weights
:
https://paddledet.bj.bcebos.com/models/picodet_s_416_coco_lcnet.pdparams
slim
:
QAT
QAT
:
quant_config
:
{
'
activation_preprocess_type'
:
'
PACT'
,
'
weight_quantize_type'
:
'
channel_wise_abs_max'
,
'
activation_quantize_type'
:
'
moving_average_abs_max'
,
'
weight_bits'
:
8
,
'
activation_bits'
:
8
,
'
dtype'
:
'
int8'
,
'
window_size'
:
10000
,
'
moving_rate'
:
0.9
,
'
quantizable_layer_type'
:
[
'
Conv2D'
,
'
Linear'
]}
print_model
:
False
TrainReader
:
batch_size
:
48
LearningRate
:
base_lr
:
0.024
schedulers
:
-
!CosineDecay
max_epochs
:
300
-
!LinearWarmup
start_factor
:
0.1
steps
:
300
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录