From 27930651f90f84ec79feaca424c5904a2fa7da89 Mon Sep 17 00:00:00 2001 From: pk_hk <82303451+pkhk-1@users.noreply.github.com> Date: Thu, 28 Jul 2022 16:11:40 +0800 Subject: [PATCH] [smalldet] update visdrone modelzoo (#6526) * [smalldet visdrone] add modle zoo * delete * [smdet] add visdrone sliced config * fix visdrone smalldet doc, test=document_fix --- configs/smalldet/README.md | 1 + .../visdrone_sliced_640_025_detection.yml | 20 ++++++ ...loe_crn_l_80e_sliced_visdrone_640_025.yml} | 17 ++--- configs/visdrone/README.md | 28 +++++++-- ...oe_crn_l_alpha_largesize_80e_visdrone.yml} | 9 +-- ...> ppyoloe_crn_l_p2_alpha_80e_visdrone.yml} | 6 +- ..._crn_l_p2_alpha_largesize_80e_visdrone.yml | 62 +++++++++++++++++++ .../ppyoloe_crn_s_p2_alpha_80e_visdrone.yml | 22 +++++++ 8 files changed, 141 insertions(+), 24 deletions(-) create mode 100644 configs/smalldet/_base_/visdrone_sliced_640_025_detection.yml rename configs/{visdrone/ppyoloe_crn_s_80e_visdrone_use_checkpoint.yml => smalldet/ppyoloe_crn_l_80e_sliced_visdrone_640_025.yml} (68%) rename configs/visdrone/{ppyoloe_crn_l_80e_visdrone_largesize.yml => ppyoloe_crn_l_alpha_largesize_80e_visdrone.yml} (93%) rename configs/visdrone/{ppyoloe_p2_crn_l_80e_visdrone.yml => ppyoloe_crn_l_p2_alpha_80e_visdrone.yml} (80%) create mode 100644 configs/visdrone/ppyoloe_crn_l_p2_alpha_largesize_80e_visdrone.yml create mode 100644 configs/visdrone/ppyoloe_crn_s_p2_alpha_80e_visdrone.yml diff --git a/configs/smalldet/README.md b/configs/smalldet/README.md index d90950628..9a43dc5d2 100644 --- a/configs/smalldet/README.md +++ b/configs/smalldet/README.md @@ -7,6 +7,7 @@ |:---------|:---------------:|:---------------:|:---------------:|:------:|:-----------------------:|:-------------------:|:---------:| :-----: | |PP-YOLOE-l| Xview | 400 | 0.25 | 60 | 14.5 | 26.8 | [下载链接](https://bj.bcebos.com/v1/paddledet/models/ppyoloe_crn_l_xview_400_025.pdparams) | [配置文件](./ppyoloe_crn_l_80e_sliced_xview_400_025.yml) | |PP-YOLOE-l| DOTA | 500 | 0.25 | 15 | 46.8 | 72.6 | [下载链接](https://bj.bcebos.com/v1/paddledet/models/ppyoloe_crn_l_dota_500_025.pdparams) | [配置文件](./ppyoloe_crn_l_80e_sliced_DOTA_500_025.yml) | +|PP-YOLOE-l| VisDrone | 500 | 0.25 | 10 | 29.7 | 48.5 | [下载链接](https://bj.bcebos.com/v1/paddledet/models/ppyoloe_crn_l_80e_sliced_visdrone_640_025.pdparams) | [配置文件](./ppyoloe_crn_l_80e_sliced_visdrone_640_025.yml) | **注意:** diff --git a/configs/smalldet/_base_/visdrone_sliced_640_025_detection.yml b/configs/smalldet/_base_/visdrone_sliced_640_025_detection.yml new file mode 100644 index 000000000..2d88b2c00 --- /dev/null +++ b/configs/smalldet/_base_/visdrone_sliced_640_025_detection.yml @@ -0,0 +1,20 @@ +metric: COCO +num_classes: 10 + +TrainDataset: + !COCODataSet + image_dir: train_images_640_025 + anno_path: train_640_025.json + dataset_dir: dataset/visdrone_sliced + data_fields: ['image', 'gt_bbox', 'gt_class', 'is_crowd'] + +EvalDataset: + !COCODataSet + image_dir: val_images_640_025 + anno_path: val_640_025.json + dataset_dir: dataset/visdrone_sliced + +TestDataset: + !ImageFolder + anno_path: dataset/visdrone_sliced/val_640_025.json + dataset_dir: dataset/visdrone_sliced/val_images_640_025 diff --git a/configs/visdrone/ppyoloe_crn_s_80e_visdrone_use_checkpoint.yml b/configs/smalldet/ppyoloe_crn_l_80e_sliced_visdrone_640_025.yml similarity index 68% rename from configs/visdrone/ppyoloe_crn_s_80e_visdrone_use_checkpoint.yml rename to configs/smalldet/ppyoloe_crn_l_80e_sliced_visdrone_640_025.yml index 2baf6024e..8d133bb72 100644 --- a/configs/visdrone/ppyoloe_crn_s_80e_visdrone_use_checkpoint.yml +++ b/configs/smalldet/ppyoloe_crn_l_80e_sliced_visdrone_640_025.yml @@ -1,5 +1,5 @@ _BASE_: [ - '../datasets/visdrone_detection.yml', + './_base_/visdrone_sliced_640_025_detection.yml', '../runtime.yml', '../ppyoloe/_base_/optimizer_300e.yml', '../ppyoloe/_base_/ppyoloe_crn.yml', @@ -7,11 +7,11 @@ _BASE_: [ ] log_iter: 100 snapshot_epoch: 10 -weights: output/ppyoloe_crn_s_80e_visdrone_use_checkpoint/model_final +weights: output/ppyoloe_crn_l_80e_sliced_visdrone_640_025/model_final -pretrain_weights: https://paddledet.bj.bcebos.com/models/ppyoloe_crn_s_300e_coco.pdparams -depth_mult: 0.33 -width_mult: 0.50 +pretrain_weights: https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_300e_coco.pdparams +depth_mult: 1.0 +width_mult: 1.0 TrainReader: batch_size: 8 @@ -26,13 +26,6 @@ LearningRate: start_factor: 0. epochs: 1 -CSPResNet: - use_checkpoint: True - use_alpha: True - -# when use_checkpoint -use_fused_allreduce_gradients: True - PPYOLOEHead: static_assigner_epoch: -1 nms: diff --git a/configs/visdrone/README.md b/configs/visdrone/README.md index f59dedd01..8fb78190c 100644 --- a/configs/visdrone/README.md +++ b/configs/visdrone/README.md @@ -1,22 +1,38 @@ -简体中文 | [English](README.md) - # VisDrone-DET 检测模型 PaddleDetection团队提供了针对VisDrone-DET小目标数航拍场景的基于PP-YOLOE的检测模型,用户可以下载模型进行使用。整理后的COCO格式VisDrone-DET数据集[下载链接](https://bj.bcebos.com/v1/paddledet/data/smalldet/visdrone.zip),检测其中的10类,包括 `pedestrian(1), people(2), bicycle(3), car(4), van(5), truck(6), tricycle(7), awning-tricycle(8), bus(9), motor(10)`,原始数据集[下载链接](https://github.com/VisDrone/VisDrone-Dataset)。 +**注意:** +- VisDrone-DET数据集包括train集6471张,val集548张,test_dev集1610张,test-challenge集1580张(未开放检测框标注),前三者均有开放检测框标注。 +- 模型均只使用train集训练,在val集和test_dev集上验证精度,test_dev集图片数较多,精度参考性较高。 + + +## 原图训练: + | 模型 | COCOAPI mAPval
0.5:0.95 | COCOAPI mAPval
0.5 | COCOAPI mAPtest_dev
0.5:0.95 | COCOAPI mAPtest_dev
0.5 | MatlabAPI mAPtest_dev
0.5:0.95 | MatlabAPI mAPtest_dev
0.5 | 下载 | 配置文件 | |:---------|:------:|:------:| :----: | :------:| :------: | :------:| :----: | :------:| |PP-YOLOE-s| 23.5 | 39.9 | 19.4 | 33.6 | 23.68 | 40.66 | [下载链接](https://paddledet.bj.bcebos.com/models/ppyoloe_crn_s_80e_visdrone.pdparams) | [配置文件](./ppyoloe_crn_s_80e_visdrone.yml) | +|PP-YOLOE-P2-Alpha-s| 24.4 | 41.6 | 20.1 | 34.7 | 24.55 | 42.19 | [下载链接](https://paddledet.bj.bcebos.com/models/ppyoloe_crn_s_p2_alpha_80e_visdrone.pdparams) | [配置文件](./ppyoloe_crn_s_p2_alpha_80e_visdrone.yml) | |PP-YOLOE-l| 29.2 | 47.3 | 23.5 | 39.1 | 28.00 | 46.20 | [下载链接](https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_80e_visdrone.pdparams) | [配置文件](./ppyoloe_crn_l_80e_visdrone.yml) | -|PP-YOLOE-P2-l| 30.0 | 49.2 | 24.1 | 40.9 | 28.47 | 48.16 | [下载链接](https://paddledet.bj.bcebos.com/models/ppyoloe_p2_crn_l_80e_visdrone.pdparams) | [配置文件](./ppyoloe_p2_crn_l_80e_visdrone.yml) | -|PP-YOLOE-l largesize| 40.3 | 63.5 | 31.3 | 51.8 | 36.13 | 59.96 | [下载链接](https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_80e_visdrone_largesize.pdparams) | [配置文件](./ppyoloe_crn_l_80e_visdrone_largesize.yml) | +|PP-YOLOE-P2-Alpha-l| 30.1 | 48.9 | 24.3 | 40.8 | 28.47 | 48.16 | [下载链接](https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_p2_alpha_80e_visdrone.pdparams) | [配置文件](./ppyoloe_crn_l_p2_alpha_80e_visdrone.yml) | +|PP-YOLOE-Alpha-largesize-l| 41.9 | 65.0 | 32.3 | 53.0 | 37.13 | 61.15 | [下载链接](https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_alpha_largesize_80e_visdrone.pdparams) | [配置文件](./ppyoloe_crn_l_alpha_largesize_80e_visdrone.yml) | +|PP-YOLOE-P2-Alpha-largesize-l| 41.3 | 64.5 | 32.4 | 53.1 | 37.49 | 51.54 | [下载链接](https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_p2_alpha_largesize_80e_visdrone.pdparams) | [配置文件](./ppyoloe_crn_l_p2_alpha_largesize_80e_visdrone.yml) | + +## 切图训练: + +| 模型 | COCOAPI mAPval
0.5:0.95 | COCOAPI mAPval
0.5 | COCOAPI mAPtest_dev
0.5:0.95 | COCOAPI mAPtest_dev
0.5 | MatlabAPI mAPtest_dev
0.5:0.95 | MatlabAPI mAPtest_dev
0.5 | 下载 | 配置文件 | +|:---------|:------:|:------:| :----: | :------:| :------: | :------:| :----: | :------:| +|PP-YOLOE-l| 29.7 | 48.5 | 23.3 | 39.9 | - | - | [下载链接](https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_80e_sliced_visdrone_640_025.pdparams) | [配置文件](../smalldet/ppyoloe_crn_l_80e_sliced_visdrone_640_025.yml) | + **注意:** - PP-YOLOE模型训练过程中使用8 GPUs进行混合精度训练,如果**GPU卡数**或者**batch size**发生了改变,你需要按照公式 **lrnew = lrdefault * (batch_sizenew * GPU_numbernew) / (batch_sizedefault * GPU_numberdefault)** 调整学习率。 - 具体使用教程请参考[ppyoloe](../ppyoloe#getting-start)。 -- PP-YOLOE-P2是指增加P2层(1/4下采样层)的特征,共输出4个PPYOLOEHead。 -- largesize是指使用以1600尺度为基础的多尺度训练和1920尺度预测,相应的训练batch_size也减小,以速度来换取高精度。 +- P2表示增加P2层(1/4下采样层)的特征,共输出4个PPYOLOEHead。 +- Alpha表示对CSPResNet骨干网络增加可一个学习权重参数Alpha参与训练。 +- largesize表示使用以1600尺度为基础的多尺度训练和1920尺度预测,相应的训练batch_size也减小,以速度来换取高精度。 - MatlabAPI测试是使用官网评测工具[VisDrone2018-DET-toolkit](https://github.com/VisDrone/VisDrone2018-DET-toolkit)。 +- 切图训练模型的配置文件及训练相关流程请参照[smalldet](../smalldet)。 ## 引用 diff --git a/configs/visdrone/ppyoloe_crn_l_80e_visdrone_largesize.yml b/configs/visdrone/ppyoloe_crn_l_alpha_largesize_80e_visdrone.yml similarity index 93% rename from configs/visdrone/ppyoloe_crn_l_80e_visdrone_largesize.yml rename to configs/visdrone/ppyoloe_crn_l_alpha_largesize_80e_visdrone.yml index 6e0abb7bc..998f0fcb5 100644 --- a/configs/visdrone/ppyoloe_crn_l_80e_visdrone_largesize.yml +++ b/configs/visdrone/ppyoloe_crn_l_alpha_largesize_80e_visdrone.yml @@ -1,12 +1,13 @@ _BASE_: [ 'ppyoloe_crn_l_80e_visdrone.yml', ] -weights: output/ppyoloe_crn_l_80e_visdrone_largesize/model_final - +weights: output/ppyoloe_crn_l_alpha_largesize_80e_visdrone/model_final pretrain_weights: https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_300e_coco.pdparams -TrainReader: - batch_size: 2 + +CSPResNet: + use_alpha: True + LearningRate: base_lr: 0.0025 diff --git a/configs/visdrone/ppyoloe_p2_crn_l_80e_visdrone.yml b/configs/visdrone/ppyoloe_crn_l_p2_alpha_80e_visdrone.yml similarity index 80% rename from configs/visdrone/ppyoloe_p2_crn_l_80e_visdrone.yml rename to configs/visdrone/ppyoloe_crn_l_p2_alpha_80e_visdrone.yml index 1678d3846..718f02903 100644 --- a/configs/visdrone/ppyoloe_p2_crn_l_80e_visdrone.yml +++ b/configs/visdrone/ppyoloe_crn_l_p2_alpha_80e_visdrone.yml @@ -1,18 +1,20 @@ _BASE_: [ 'ppyoloe_crn_l_80e_visdrone.yml', ] -weights: output/ppyoloe_p2_crn_l_80e_visdrone/model_final - +weights: output/ppyoloe_crn_l_p2_alpha_80e_visdrone/model_final pretrain_weights: https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_300e_coco.pdparams + TrainReader: batch_size: 4 LearningRate: base_lr: 0.005 + CSPResNet: return_idx: [0, 1, 2, 3] + use_alpha: True CustomCSPPAN: out_channels: [768, 384, 192, 64] diff --git a/configs/visdrone/ppyoloe_crn_l_p2_alpha_largesize_80e_visdrone.yml b/configs/visdrone/ppyoloe_crn_l_p2_alpha_largesize_80e_visdrone.yml new file mode 100644 index 000000000..1cd8dc671 --- /dev/null +++ b/configs/visdrone/ppyoloe_crn_l_p2_alpha_largesize_80e_visdrone.yml @@ -0,0 +1,62 @@ +_BASE_: [ + 'ppyoloe_crn_l_80e_visdrone.yml', +] +weights: output/ppyoloe_crn_l_p2_alpha_largesize_80e_visdrone/model_final +pretrain_weights: https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_300e_coco.pdparams + + +LearningRate: + base_lr: 0.005 + + +CSPResNet: + return_idx: [0, 1, 2, 3] + use_alpha: True + +CustomCSPPAN: + out_channels: [768, 384, 192, 64] + +PPYOLOEHead: + fpn_strides: [32, 16, 8, 4] + + +worker_num: 2 +eval_height: &eval_height 1920 +eval_width: &eval_width 1920 +eval_size: &eval_size [*eval_height, *eval_width] + +TrainReader: + sample_transforms: + - Decode: {} + - RandomDistort: {} + - RandomExpand: {fill_value: [123.675, 116.28, 103.53]} + - RandomCrop: {} + - RandomFlip: {} + batch_transforms: + - BatchRandomResize: {target_size: [1024, 1088, 1152, 1216, 1280, 1344, 1408, 1472, 1536, 1600, 1664, 1728, 1792, 1856, 1920, 1984, 2048], random_size: True, random_interp: True, keep_ratio: False} + - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True} + - Permute: {} + - PadGT: {} + batch_size: 1 + shuffle: true + drop_last: true + use_shared_memory: true + collate_batch: true + +EvalReader: + sample_transforms: + - Decode: {} + - Resize: {target_size: *eval_size, keep_ratio: False, interp: 2} + - NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True} + - 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.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True} + - Permute: {} + batch_size: 1 diff --git a/configs/visdrone/ppyoloe_crn_s_p2_alpha_80e_visdrone.yml b/configs/visdrone/ppyoloe_crn_s_p2_alpha_80e_visdrone.yml new file mode 100644 index 000000000..17d6299bb --- /dev/null +++ b/configs/visdrone/ppyoloe_crn_s_p2_alpha_80e_visdrone.yml @@ -0,0 +1,22 @@ +_BASE_: [ + 'ppyoloe_crn_s_80e_visdrone.yml', +] +weights: output/ppyoloe_crn_s_p2_alpha_80e_visdrone/model_final + +pretrain_weights: https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_300e_coco.pdparams + +TrainReader: + batch_size: 4 + +LearningRate: + base_lr: 0.005 + +CSPResNet: + return_idx: [0, 1, 2, 3] + use_alpha: True + +CustomCSPPAN: + out_channels: [768, 384, 192, 64] + +PPYOLOEHead: + fpn_strides: [32, 16, 8, 4] -- GitLab