From 0054977f3655df379f5418c0f2f5fe8cd048b246 Mon Sep 17 00:00:00 2001
From: Feng Ni <nemonameless@qq.com>
Date: Wed, 8 Feb 2023 17:07:44 +0800
Subject: [PATCH] [doc] fix ppyoloe distill and semi-det configs and docs
 (#7704)

---
 configs/ppyoloe/README_cn.md                  |  2 +-
 configs/ppyoloe/distill/README.md             |  2 +-
 .../ppyoloe/ppyoloe_crn_t_p2_300e_coco.yml    |  2 +-
 .../ppyoloe_plus_crn_t_auxhead_300e_coco.yml  | 26 ++++++++++++++++++-
 ...pyoloe_plus_crn_t_p2_auxhead_300e_coco.yml | 26 ++++++++++++++++++-
 .../denseteacher_fcos_r50_fpn_coco_full.yml   |  5 ++++
 ...denseteacher_fcos_r50_fpn_coco_semi005.yml |  5 ++++
 ...denseteacher_fcos_r50_fpn_coco_semi010.yml |  5 ++++
 ...eacher_ppyoloe_plus_crn_l_coco_semi005.yml |  2 +-
 ...eacher_ppyoloe_plus_crn_l_coco_semi010.yml |  2 +-
 ...eacher_ppyoloe_plus_crn_s_coco_semi005.yml |  2 +-
 ...eacher_ppyoloe_plus_crn_s_coco_semi010.yml |  2 +-
 12 files changed, 72 insertions(+), 9 deletions(-)

diff --git a/configs/ppyoloe/README_cn.md b/configs/ppyoloe/README_cn.md
index bc75c48eca7..a599a8e582a 100644
--- a/configs/ppyoloe/README_cn.md
+++ b/configs/ppyoloe/README_cn.md
@@ -47,7 +47,7 @@ PP-YOLOE由以下方法组成
 
 |       模型        | Epoch |   GPU个数   | 每GPU图片个数 |  骨干网络  |    输入尺寸    | Box AP<sup>val<br>0.5:0.95 | Box AP<sup>test<br>0.5:0.95 | Params(M) | FLOPs(G) | V100 FP32(FPS) | V100 TensorRT FP16(FPS) |                                         模型下载                                         |                    配置文件                     |
 |:---------------:|:-----:|:---------:|:--------:|:----------:|:----------:|:--------------------------:|:---------------------------:|:---------:|:--------:|:---------------:| :---------------------: |:------------------------------------------------------------------------------------:|:-------------------------------------------:|
-|   PP-YOLOE+_t(aux)|  300   |     8     |    8     | cspresnet-t  |    640  |            39.5       |            51.7             |   4.85   |  19.15 |   -    |   344.8   | [model](https://paddledet.bj.bcebos.com/models/ppyoloe_plus_crn_t_auxhead_300e_coco.pdparams) | [config](./ppyoloe_plus_crn_t_auxhead_300e_coco.yml) |
+|   PP-YOLOE+_t(aux)|  300   |     8     |    8     | cspresnet-t  |    640  |            39.7       |            56.4             |   4.85   |  19.15 |   -    |   344.8   | [model](https://paddledet.bj.bcebos.com/models/ppyoloe_plus_crn_t_auxhead_300e_coco.pdparams) | [config](./ppyoloe_plus_crn_t_auxhead_300e_coco.yml) |
 |   PP-YOLOE-t-P2   |  300   |     8     |    8     | cspresnet-t  |    320  |            34.7       |            50.0             |   6.82   |  4.78  |   -    |   -   | [model](https://paddledet.bj.bcebos.com/models/ppyoloe_crn_t_p2_300e_coco.pdparams) | [config](./ppyoloe_crn_t_p2_300e_coco.yml) |
 |   PP-YOLOE+_t-P2(aux) |  300 |     8   |    8     | cspresnet-t  |    320  |            36.3       |            51.7             |   6.00   |  15.46 |   -    |   -   | [model](https://paddledet.bj.bcebos.com/models/ppyoloe_plus_crn_t_p2_auxhead_300e_coco.pdparams) | [config](./ppyoloe_plus_crn_t_p2_auxhead_300e_coco.yml) |
 
diff --git a/configs/ppyoloe/distill/README.md b/configs/ppyoloe/distill/README.md
index adc91e40b83..85b55ff5c7e 100644
--- a/configs/ppyoloe/distill/README.md
+++ b/configs/ppyoloe/distill/README.md
@@ -8,7 +8,7 @@ PaddleDetection提供了对PPYOLOE+ 进行模型蒸馏的方案,结合了logit
 | ----------------- | ----------- | ------ | :----: | :-----------: | :--------------: | :------------: |
 |   PP-YOLOE+_x     |  teacher   |  640     | 80e   |      54.7     | [config](../ppyoloe_plus_crn_x_80e_coco.yml) | [model](https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_x_80e_coco.pdparams) |
 |   PP-YOLOE+_l     |  student   |  640     | 80e   |      52.9     | [config](../ppyoloe_plus_crn_l_80e_coco.yml) | [model](https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_l_80e_coco.pdparams) |
-|   PP-YOLOE+_l     |  distill   |  640     | 80e   |   53.9(+1.0)  | [config](./ppyoloe_plus_crn_l_80e_coco_distill.yml),[slim_config](../../slim/distill/ppyoloe_plus_distill_x_distill_l.yml)  | [model](https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_l_80e_coco_distill.pdparams) |
+|   PP-YOLOE+_l     |  distill   |  640     | 80e   |   54.0(+1.1)  | [config](./ppyoloe_plus_crn_l_80e_coco_distill.yml),[slim_config](../../slim/distill/ppyoloe_plus_distill_x_distill_l.yml)  | [model](https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_l_80e_coco_distill.pdparams) |
 |   PP-YOLOE+_l     |  teacher   |  640     | 80e   |      52.9     | [config](../ppyoloe_plus_crn_l_80e_coco.yml) | [model](https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_l_80e_coco.pdparams) |
 |   PP-YOLOE+_m     |  student   |  640     | 80e   |      49.8     | [config](../ppyoloe_plus_crn_m_80e_coco.yml) | [model](https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_m_80e_coco.pdparams) |
 |   PP-YOLOE+_m     |  distill   |  640     | 80e   |    50.7(+0.9)    | [config](./ppyoloe_plus_crn_m_80e_coco_distill.yml),[slim_config](../../slim/distill/ppyoloe_plus_distill_l_distill_m.yml)  | [model](https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_m_80e_coco_distill.pdparams) |
diff --git a/configs/ppyoloe/ppyoloe_crn_t_p2_300e_coco.yml b/configs/ppyoloe/ppyoloe_crn_t_p2_300e_coco.yml
index 02dc0ddc9f6..b056ea7b962 100644
--- a/configs/ppyoloe/ppyoloe_crn_t_p2_300e_coco.yml
+++ b/configs/ppyoloe/ppyoloe_crn_t_p2_300e_coco.yml
@@ -3,7 +3,7 @@ _BASE_: [
   '../runtime.yml',
   './_base_/optimizer_300e.yml',
   './_base_/ppyoloe_crn.yml',
-  './_base_/ppyoloe_reader.yml',
+  './_base_/ppyoloe_plus_tiny_reader.yml', # 320*320
 ]
 
 log_iter: 100
diff --git a/configs/ppyoloe/ppyoloe_plus_crn_t_auxhead_300e_coco.yml b/configs/ppyoloe/ppyoloe_plus_crn_t_auxhead_300e_coco.yml
index 8bbf5b07ca8..e7477787d12 100644
--- a/configs/ppyoloe/ppyoloe_plus_crn_t_auxhead_300e_coco.yml
+++ b/configs/ppyoloe/ppyoloe_plus_crn_t_auxhead_300e_coco.yml
@@ -3,7 +3,7 @@ _BASE_: [
   '../runtime.yml',
   './_base_/optimizer_300e.yml',
   './_base_/ppyoloe_plus_crn_tiny_auxhead.yml',
-  './_base_/ppyoloe_plus_reader.yml', # 640
+  './_base_/ppyoloe_plus_reader.yml', # 640*640
 ]
 
 log_iter: 100
@@ -13,3 +13,27 @@ weights: output/ppyoloe_plus_crn_t_auxhead_300e_coco/model_final
 pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_t_pretrained.pdparams
 depth_mult: 0.33
 width_mult: 0.375
+
+
+worker_num: 4
+eval_height: &eval_height 640
+eval_width: &eval_width 640
+eval_size: &eval_size [*eval_height, *eval_width]
+
+EvalReader:
+  sample_transforms:
+    - Decode: {}
+    - Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
+    - NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
+    - Permute: {}
+  batch_size: 2
+
+TestReader:
+  inputs_def:
+    image_shape: [3, *eval_height, *eval_width]
+  sample_transforms:
+    - Decode: {}
+    - Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
+    - NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
+    - Permute: {}
+  batch_size: 1
diff --git a/configs/ppyoloe/ppyoloe_plus_crn_t_p2_auxhead_300e_coco.yml b/configs/ppyoloe/ppyoloe_plus_crn_t_p2_auxhead_300e_coco.yml
index 27f8f522014..434b6f4249f 100644
--- a/configs/ppyoloe/ppyoloe_plus_crn_t_p2_auxhead_300e_coco.yml
+++ b/configs/ppyoloe/ppyoloe_plus_crn_t_p2_auxhead_300e_coco.yml
@@ -3,7 +3,7 @@ _BASE_: [
   '../runtime.yml',
   './_base_/optimizer_300e.yml',
   './_base_/ppyoloe_plus_crn_tiny_auxhead.yml',
-  './_base_/ppyoloe_plus_tiny_reader.yml',
+  './_base_/ppyoloe_plus_tiny_reader.yml', # 320*320
 ]
 
 log_iter: 100
@@ -34,3 +34,27 @@ SimpleConvHead:
 
 PPYOLOEHead:
   fpn_strides: [32, 16, 8, 4]
+
+
+worker_num: 4
+eval_height: &eval_height 320
+eval_width: &eval_width 320
+eval_size: &eval_size [*eval_height, *eval_width]
+
+EvalReader:
+  sample_transforms:
+    - Decode: {}
+    - Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
+    - NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
+    - Permute: {}
+  batch_size: 2
+
+TestReader:
+  inputs_def:
+    image_shape: [3, *eval_height, *eval_width]
+  sample_transforms:
+    - Decode: {}
+    - Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
+    - NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
+    - Permute: {}
+  batch_size: 1
diff --git a/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_full.yml b/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_full.yml
index 56087d5282f..1b15b222387 100644
--- a/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_full.yml
+++ b/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_full.yml
@@ -9,6 +9,11 @@ weights: output/denseteacher_fcos_r50_fpn_coco_full/model_final
 
 
 ### pretrain and warmup config, choose one and comment another
+# pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/fcos_r50_fpn_iou_multiscale_2x_coco.pdparams # mAP=42.6
+# semi_start_iters: 0
+# ema_start_iters: 0
+# use_warmup: &use_warmup False
+
 pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_cos_pretrained.pdparams
 semi_start_iters: 5000
 ema_start_iters: 3000
diff --git a/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi005.yml b/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi005.yml
index 85afb83bb94..3efa1a04b82 100644
--- a/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi005.yml
+++ b/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi005.yml
@@ -9,6 +9,11 @@ weights: output/denseteacher_fcos_r50_fpn_coco_semi005/model_final
 
 
 ### pretrain and warmup config, choose one and comment another
+# pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/fcos_r50_fpn_2x_coco_sup005.pdparams # mAP=21.3
+# semi_start_iters: 0
+# ema_start_iters: 0
+# use_warmup: &use_warmup False
+
 pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_cos_pretrained.pdparams
 semi_start_iters: 5000
 ema_start_iters: 3000
diff --git a/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi010.yml b/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi010.yml
index 7b99859d9ef..76d884ca20f 100644
--- a/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi010.yml
+++ b/configs/semi_det/denseteacher/denseteacher_fcos_r50_fpn_coco_semi010.yml
@@ -9,6 +9,11 @@ weights: output/denseteacher_fcos_r50_fpn_coco_semi010/model_final
 
 
 ### pretrain and warmup config, choose one and comment another
+# pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/fcos_r50_fpn_2x_coco_sup010.pdparams # mAP=26.3
+# semi_start_iters: 0
+# ema_start_iters: 0
+# use_warmup: &use_warmup False
+
 pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet50_cos_pretrained.pdparams
 semi_start_iters: 5000
 ema_start_iters: 3000
diff --git a/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_l_coco_semi005.yml b/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_l_coco_semi005.yml
index 25159a8c045..920613fd9e0 100644
--- a/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_l_coco_semi005.yml
+++ b/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_l_coco_semi005.yml
@@ -11,7 +11,7 @@ cosine_epochs: &cosine_epochs 240
 
 
 ### pretrain and warmup config, choose one and comment another
-pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/semi_det/ppyoloe_plus_crn_l_80e_coco_sup005.pdparams # mAP=42.9
+pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_l_80e_coco_sup005.pdparams # mAP=42.9
 semi_start_iters: 0
 ema_start_iters: 0
 use_warmup: &use_warmup False
diff --git a/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_l_coco_semi010.yml b/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_l_coco_semi010.yml
index 24aa642bf3c..253a8c18ca7 100644
--- a/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_l_coco_semi010.yml
+++ b/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_l_coco_semi010.yml
@@ -11,7 +11,7 @@ cosine_epochs: &cosine_epochs 240
 
 
 ### pretrain and warmup config, choose one and comment another
-pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/semi_det/ppyoloe_plus_crn_l_80e_coco_sup010.pdparams # mAP=45.7
+pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_l_80e_coco_sup010.pdparams # mAP=45.7
 semi_start_iters: 0
 ema_start_iters: 0
 use_warmup: &use_warmup False
diff --git a/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_s_coco_semi005.yml b/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_s_coco_semi005.yml
index 86661a28252..d3482e5e9d1 100644
--- a/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_s_coco_semi005.yml
+++ b/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_s_coco_semi005.yml
@@ -11,7 +11,7 @@ cosine_epochs: &cosine_epochs 240
 
 
 ### pretrain and warmup config, choose one and comment another
-pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/semi_det/ppyoloe_plus_crn_s_80e_coco_sup005.pdparams # mAP=32.8
+pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_s_80e_coco_sup005.pdparams # mAP=32.8
 semi_start_iters: 0
 ema_start_iters: 0
 use_warmup: &use_warmup False
diff --git a/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_s_coco_semi010.yml b/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_s_coco_semi010.yml
index 5855523e025..e8b0aad3aff 100644
--- a/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_s_coco_semi010.yml
+++ b/configs/semi_det/denseteacher/denseteacher_ppyoloe_plus_crn_s_coco_semi010.yml
@@ -11,7 +11,7 @@ cosine_epochs: &cosine_epochs 240
 
 
 ### pretrain and warmup config, choose one and comment another
-pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/semi_det/ppyoloe_plus_crn_s_80e_coco_sup010.pdparams # mAP=35.3
+pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/ppyoloe_plus_crn_s_80e_coco_sup010.pdparams # mAP=35.3
 semi_start_iters: 0
 ema_start_iters: 0
 use_warmup: &use_warmup False