未验证 提交 2b20f174 编写于 作者: G Guanghua Yu 提交者: GitHub

add PPYOLOE+ act demo (#1573)

上级 044909e7
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
| :-------- |:-------- |:--------: | :---------------------: | :----------------: | :----------------: | :---------------: | :----------------------: | :---------------------: | | :-------- |:-------- |:--------: | :---------------------: | :----------------: | :----------------: | :---------------: | :----------------------: | :---------------------: |
| PP-YOLOE-l | 50.9 | - | 50.6 | 11.2ms | 7.7ms | **6.7ms** | [config](https://github.com/PaddlePaddle/PaddleSlim/blob/develop/example/auto_compression/detection/configs/ppyoloe_l_qat_dis.yaml) | [Model](https://bj.bcebos.com/v1/paddle-slim-models/act/ppyoloe_crn_l_300e_coco_quant.tar) | | PP-YOLOE-l | 50.9 | - | 50.6 | 11.2ms | 7.7ms | **6.7ms** | [config](https://github.com/PaddlePaddle/PaddleSlim/blob/develop/example/auto_compression/detection/configs/ppyoloe_l_qat_dis.yaml) | [Model](https://bj.bcebos.com/v1/paddle-slim-models/act/ppyoloe_crn_l_300e_coco_quant.tar) |
| PP-YOLOE-s | 43.1 | 41.2 | 42.6 | 6.51ms | 2.77ms | **2.12ms** | [config](https://github.com/PaddlePaddle/PaddleSlim/blob/develop/example/auto_compression/detection/configs/ppyoloe_s_qat_dis.yaml) | [Model](https://bj.bcebos.com/v1/paddle-slim-models/act/ppyoloe_s_quant.tar) | | PP-YOLOE-s | 43.1 | 41.2 | 42.6 | 6.51ms | 2.77ms | **2.12ms** | [config](https://github.com/PaddlePaddle/PaddleSlim/blob/develop/example/auto_compression/detection/configs/ppyoloe_s_qat_dis.yaml) | [Model](https://bj.bcebos.com/v1/paddle-slim-models/act/ppyoloe_s_quant.tar) |
| PP-YOLOE+ s | 43.7 | - | 42.7 | - | - | - | [config](https://github.com/PaddlePaddle/PaddleSlim/blob/develop/example/auto_compression/detection/configs/ppyoloe_plus_s_qat_dis.yaml) | [Model](https://bj.bcebos.com/v1/paddle-slim-models/act/ppyoloe_plus_crn_s_80e_coco_no_nms_quant.tar) |
- mAP的指标均在COCO val2017数据集中评测得到,IoU=0.5:0.95。 - mAP的指标均在COCO val2017数据集中评测得到,IoU=0.5:0.95。
- PP-YOLOE-l模型在Tesla V100的GPU环境下测试,并且开启TensorRT,batch_size=1,包含NMS,测试脚本是[benchmark demo](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.4/deploy/python) - PP-YOLOE-l模型在Tesla V100的GPU环境下测试,并且开启TensorRT,batch_size=1,包含NMS,测试脚本是[benchmark demo](https://github.com/PaddlePaddle/PaddleDetection/tree/release/2.4/deploy/python)
......
Global: Global:
reader_config: configs/yolo_reader.yml reader_config: configs/yolo_reader.yml
arch: YOLO arch: PPYOLOE
include_nms: True
Evaluation: True Evaluation: True
model_dir: ./ppyoloe_crn_l_300e_coco model_dir: ./ppyoloe_crn_l_300e_coco
model_filename: model.pdmodel model_filename: model.pdmodel
......
metric: COCO
num_classes: 80
# Datset configuration
TrainDataset:
!COCODataSet
image_dir: train2017
anno_path: annotations/instances_train2017.json
dataset_dir: dataset/coco/
EvalDataset:
!COCODataSet
image_dir: val2017
anno_path: annotations/instances_val2017.json
dataset_dir: dataset/coco/
worker_num: 0
# preprocess reader in test
EvalReader:
sample_transforms:
- Decode: {}
- Resize: {target_size: [640, 640], keep_ratio: False, interp: 2}
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
- Permute: {}
batch_size: 4
Global:
reader_config: configs/ppyoloe_plus_reader.yml
arch: PPYOLOE
include_nms: False
Evaluation: True
model_dir: ./ppyoloe_plus_crn_s_80e_coco_no_nms # https://bj.bcebos.com/v1/paddle-slim-models/act/ppyoloe_plus_crn_s_80e_coco_no_nms.tar
model_filename: model.pdmodel
params_filename: model.pdiparams
Distillation:
alpha: 1.0
loss: soft_label
QuantAware:
onnx_format: true
use_pact: true
activation_quantize_type: 'moving_average_abs_max'
quantize_op_types:
- conv2d
- depthwise_conv2d
TrainConfig:
train_iter: 5000
eval_iter: 1000
learning_rate:
type: CosineAnnealingDecay
learning_rate: 0.00003
T_max: 6000
optimizer_builder:
optimizer:
type: SGD
weight_decay: 4.0e-05
Global: Global:
reader_config: configs/yolo_reader.yml reader_config: configs/yolo_reader.yml
arch: PPYOLOE # When export exclude_nms=True, need set arch: PPYOLOE arch: PPYOLOE
include_nms: False
Evaluation: True Evaluation: True
model_dir: ./ppyoloe_crn_s_300e_coco model_dir: ./ppyoloe_crn_s_300e_coco
model_filename: model.pdmodel model_filename: model.pdmodel
......
...@@ -85,9 +85,13 @@ def eval(): ...@@ -85,9 +85,13 @@ def eval():
if 'arch' in global_config and global_config['arch'] == 'keypoint': if 'arch' in global_config and global_config['arch'] == 'keypoint':
res = keypoint_post_process(data, data_input, exe, val_program, res = keypoint_post_process(data, data_input, exe, val_program,
fetch_targets, outs) fetch_targets, outs)
if 'arch' in global_config and global_config['arch'] == 'PPYOLOE': elif 'include_nms' in global_config and not global_config[
postprocess = PPYOLOEPostProcess( 'include_nms']:
score_threshold=0.01, nms_threshold=0.6) if 'arch' in global_config and global_config['arch'] == 'PPYOLOE':
postprocess = PPYOLOEPostProcess(
score_threshold=0.01, nms_threshold=0.6)
else:
assert "Not support arch={} now.".format(global_config['arch'])
res = postprocess(np.array(outs[0]), data_all['scale_factor']) res = postprocess(np.array(outs[0]), data_all['scale_factor'])
else: else:
for out in outs: for out in outs:
......
...@@ -100,9 +100,13 @@ def eval_function(exe, compiled_test_program, test_feed_names, test_fetch_list): ...@@ -100,9 +100,13 @@ def eval_function(exe, compiled_test_program, test_feed_names, test_fetch_list):
res = keypoint_post_process(data, data_input, exe, res = keypoint_post_process(data, data_input, exe,
compiled_test_program, test_fetch_list, compiled_test_program, test_fetch_list,
outs) outs)
if 'arch' in global_config and global_config['arch'] == 'PPYOLOE': elif 'include_nms' in global_config and not global_config[
postprocess = PPYOLOEPostProcess( 'include_nms']:
score_threshold=0.01, nms_threshold=0.6) if 'arch' in global_config and global_config['arch'] == 'PPYOLOE':
postprocess = PPYOLOEPostProcess(
score_threshold=0.01, nms_threshold=0.6)
else:
assert "Not support arch={} now.".format(global_config['arch'])
res = postprocess(np.array(outs[0]), data_all['scale_factor']) res = postprocess(np.array(outs[0]), data_all['scale_factor'])
else: else:
for out in outs: for out in outs:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册