Skip to content

Commit d98d525

Browse files
committed
merge ins_seg branch
1 parent 9606b06 commit d98d525

File tree

75 files changed

+5561
-267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+5561
-267
lines changed

configs/datasets/coco_detection.yml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ EvalDataset:
1212
name: COCODataSet
1313
image_dir: val2017
1414
anno_path: annotations/instances_val2017.json
15-
#anno_path: annotations/instances_val2017_rand24.json
1615
dataset_dir: dataset/coco
1716

1817
TestDataset:

configs/datasets/coco_instance.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
metric: COCO
2+
num_classes: 80
3+
4+
TrainDataset:
5+
name: COCODataSet
6+
image_dir: train2017
7+
anno_path: annotations/instances_train2017.json
8+
dataset_dir: dataset/coco
9+
data_fields: ['image', 'gt_bbox', 'gt_class', 'gt_poly', 'is_crowd']
10+
11+
EvalDataset:
12+
name: COCODataSet
13+
image_dir: val2017
14+
anno_path: annotations/instances_val2017.json
15+
dataset_dir: dataset/coco
16+
17+
TestDataset:
18+
name: ImageFolder
19+
anno_path: annotations/instances_val2017.json # also support txt (like VOC's label_list.txt)
20+
dataset_dir: dataset/coco # if set, anno_path will be 'dataset_dir/anno_path'

configs/ppyoloe_seg/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# PP-YOLOE Instance segmentation
2+
3+
## 模型库
4+
5+
### 实例分割模型
6+
7+
| 网络网络 | 输入尺寸 | 图片数/GPU | 学习率策略 | TRT-FP16-Latency(ms) | box AP | mask AP | Params(M) | FLOPs(G) | 下载链接 | 配置文件 |
8+
| :------------- | :------- | :-------: | :------: | :------------: | :---------------------: | :----------------: |:---------: | :------: |:---------------: |:-----: |
9+
| PP-YOLOE_seg_s | 640 | 8 | 80e | - | 42.3 | 32.5 | 8.99 | - | [下载链接](https://paddledet.bj.bcebos.com/models/ppyoloe_seg_s_80e_coco.pdparams) | [配置文件](./ppyoloe_seg_s_80e_coco.yml) |
10+
| PP-YOLOE_seg_m | 640 | 8 | 80e | - | - | - | 26.03 | - | [下载链接]() | [配置文件](./ppyoloe_seg_m_80e_coco.yml) |
11+
| PP-YOLOE_seg_l | 640 | 8 | 80e | - | - | - | 57.32 | - | [下载链接]() | [配置文件](./ppyoloe_seg_l_80e_coco.yml) |
12+
| PP-YOLOE_seg_x | 640 | 8 | 80e | - | - | - | 107.27 | - | [下载链接]() | [配置文件](./ppyoloe_seg_x_80e_coco.yml) |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
epoch: 80
2+
3+
LearningRate:
4+
base_lr: 0.001
5+
schedulers:
6+
- name: CosineDecay
7+
max_epochs: 96
8+
- name: LinearWarmup
9+
start_factor: 0.
10+
epochs: 5
11+
12+
OptimizerBuilder:
13+
optimizer:
14+
momentum: 0.9
15+
type: Momentum
16+
regularizer:
17+
factor: 0.0005
18+
type: L2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
architecture: PPYOLOE
2+
norm_type: sync_bn
3+
use_ema: true
4+
ema_decay: 0.9998
5+
ema_black_list: ['proj_conv.weight']
6+
custom_black_list: ['reduce_mean']
7+
8+
with_mask: True
9+
10+
PPYOLOE:
11+
backbone: CSPResNet
12+
neck: CustomCSPPAN
13+
yolo_head: PPYOLOEInsHead
14+
post_process: ~
15+
with_mask: True
16+
17+
CSPResNet:
18+
layers: [3, 6, 6, 3]
19+
channels: [64, 128, 256, 512, 1024]
20+
return_idx: [1, 2, 3]
21+
use_large_stem: True
22+
use_alpha: True
23+
24+
CustomCSPPAN:
25+
out_channels: [768, 384, 192]
26+
stage_num: 1
27+
block_num: 3
28+
act: 'swish'
29+
spp: true
30+
31+
PPYOLOEInsHead:
32+
fpn_strides: [32, 16, 8]
33+
grid_cell_scale: 5.0
34+
grid_cell_offset: 0.5
35+
static_assigner_epoch: -1 # only use TaskAlignedAssigner
36+
use_varifocal_loss: True
37+
loss_weight: {class: 1.0, iou: 2.5, dfl: 0.5}
38+
assigner:
39+
name: TaskAlignedAssigner
40+
topk: 13
41+
alpha: 1.0
42+
beta: 6.0
43+
nms:
44+
name: MultiClassNMS
45+
nms_top_k: 1000
46+
keep_top_k: 300
47+
score_threshold: 0.01
48+
nms_threshold: 0.7
49+
return_index: True
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
worker_num: 4
2+
eval_height: &eval_height 640
3+
eval_width: &eval_width 640
4+
eval_size: &eval_size [*eval_height, *eval_width]
5+
6+
TrainReader:
7+
sample_transforms:
8+
- Decode: {}
9+
- RandomDistort: {}
10+
- RandomExpand: {fill_value: [123.675, 116.28, 103.53]}
11+
- RandomCrop: {is_mask_crop: True}
12+
- RandomFlip: {}
13+
- Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
14+
- Poly2Mask: {del_poly: True}
15+
batch_transforms:
16+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
17+
- Permute: {}
18+
- PadGT: {}
19+
batch_size: 8
20+
shuffle: true
21+
drop_last: true
22+
use_shared_memory: true
23+
collate_batch: False
24+
25+
26+
EvalReader:
27+
sample_transforms:
28+
- Decode: {}
29+
- Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
30+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
31+
- Permute: {}
32+
batch_size: 1
33+
34+
35+
TestReader:
36+
inputs_def:
37+
image_shape: [3, *eval_height, *eval_width]
38+
sample_transforms:
39+
- Decode: {}
40+
- Resize: {target_size: *eval_size, keep_ratio: False, interp: 2}
41+
- NormalizeImage: {mean: [0., 0., 0.], std: [1., 1., 1.], norm_type: none}
42+
- Permute: {}
43+
batch_size: 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
_BASE_: [
2+
'../datasets/coco_instance.yml',
3+
'../runtime.yml',
4+
'./_base_/optimizer_80e.yml',
5+
'./_base_/ppyoloe_plus_crn_seg.yml',
6+
'./_base_/ppyoloe_plus_seg_reader.yml',
7+
]
8+
log_iter: 50
9+
snapshot_epoch: 5
10+
weights: output/ppyoloe_seg_l_80e_coco/model_final
11+
12+
pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/pretrained/ppyoloe_crn_l_obj365_pretrained.pdparams
13+
depth_mult: 1.0
14+
width_mult: 1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
_BASE_: [
2+
'../datasets/coco_instance.yml',
3+
'../runtime.yml',
4+
'./_base_/optimizer_80e.yml',
5+
'./_base_/ppyoloe_plus_crn_seg.yml',
6+
'./_base_/ppyoloe_plus_seg_reader.yml',
7+
]
8+
log_iter: 50
9+
snapshot_epoch: 5
10+
weights: output/ppyoloe_seg_m_80e_coco/model_final
11+
12+
pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/pretrained/ppyoloe_crn_l_obj365_pretrained.pdparams
13+
depth_mult: 0.67
14+
width_mult: 0.75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
_BASE_: [
2+
'../datasets/coco_instance.yml',
3+
'../runtime.yml',
4+
'./_base_/optimizer_80e.yml',
5+
'./_base_/ppyoloe_plus_crn_seg.yml',
6+
'./_base_/ppyoloe_plus_seg_reader.yml',
7+
]
8+
log_iter: 50
9+
snapshot_epoch: 5
10+
weights: output/ppyoloe_seg_s_80e_coco/model_final
11+
12+
pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/pretrained/ppyoloe_crn_s_obj365_pretrained.pdparams
13+
depth_mult: 0.33
14+
width_mult: 0.50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
_BASE_: [
2+
'../datasets/coco_instance.yml',
3+
'../runtime.yml',
4+
'./_base_/optimizer_80e.yml',
5+
'./_base_/ppyoloe_plus_crn_seg.yml',
6+
'./_base_/ppyoloe_plus_seg_reader.yml',
7+
]
8+
log_iter: 50
9+
snapshot_epoch: 5
10+
weights: output/ppyoloe_seg_x_80e_coco/model_final
11+
12+
pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/pretrained/ppyoloe_crn_x_obj365_pretrained.pdparams
13+
depth_mult: 1.33
14+
width_mult: 1.25

configs/rtmdet/README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
- [引用](#引用)
88

99
## 模型库
10-
### RTMDet on COCO
10+
11+
### 基础检测模型
1112

1213
| 网络网络 | 输入尺寸 | 图片数/GPU | 学习率策略 | 模型推理耗时(ms) | mAP | AP50 | Params(M) | FLOPs(G) | 下载链接 | 配置文件 |
1314
| :------------- | :------- | :-------: | :------: | :---------: | :-----: |:-----: | :-----: |:-----: | :-------------: | :-----: |
@@ -17,6 +18,15 @@
1718
| *RTMDet-l | 640 | 32 | 300e | 10.2 | 51.2 | 68.8 | 52.31 | 160.32 |[下载链接](https://paddledet.bj.bcebos.com/models/rtmdet_l_300e_coco.pdparams) | [配置文件](./rtmdet_l_300e_coco.yml) |
1819
| *RTMDet-x | 640 | 32 | 300e | 18.0 | 52.6 | 70.4 | 94.86 | 283.12 |[下载链接](https://paddledet.bj.bcebos.com/models/rtmdet_x_300e_coco.pdparams) | [配置文件](./rtmdet_x_300e_coco.yml) |
1920

21+
### 实例分割模型
22+
23+
| 网络网络 | 输入尺寸 | 图片数/GPU | 学习率策略 | 模型推理耗时(ms) | box AP | mask AP | Params(M) | FLOPs(G) | 下载链接 | 配置文件 |
24+
| :------------- | :------- | :-------: | :------: | :---------: | :-----: |:-----: | :-----: |:-----: | :-------------: | :-----: |
25+
| *RTMDet-t | 640 | 32 | 300e | - | 40.5 | - | 5.6 | 11.8 |[下载链接](https://paddledet.bj.bcebos.com/models/rtmdet_ins_t_300e_coco.pdparams) | [配置文件](./rtmdet_ins_t_300e_coco.yml) |
26+
| *RTMDet-s | 640 | 32 | 300e | - | 44.0 | - | 10.18 | 21.5 |[下载链接](https://paddledet.bj.bcebos.com/models/rtmdet_ins_s_300e_coco.pdparams) | [配置文件](./rtmdet_ins_s_300e_coco.yml) |
27+
| *RTMDet-m | 640 | 32 | 300e | - | 48.8 | - | 27.58 | 54.13 |[下载链接](https://paddledet.bj.bcebos.com/models/rtmdet_ins_m_300e_coco.pdparams) | [配置文件](./rtmdet_ins_m_300e_coco.yml) |
28+
| *RTMDet-l | 640 | 32 | 300e | - | 51.2 | - | 57.37 | 106.56 |[下载链接](https://paddledet.bj.bcebos.com/models/rtmdet_ins_l_300e_coco.pdparams) | [配置文件](./rtmdet_ins_l_300e_coco.yml) |
29+
| *RTMDet-x | 640 | 32 | 300e | - | 52.4 | - | 102.7 | 182.7 |[下载链接](https://paddledet.bj.bcebos.com/models/rtmdet_ins_x_300e_coco.pdparams) | [配置文件](./rtmdet_ins_x_300e_coco.yml) |
2030

2131
**注意:**
2232
- RTMDet模型暂未支持完全训练,mAP为部署权重在COCO val2017上的`mAP(IoU=0.5:0.95)`结果,且评估未使用`multi_label`等trick;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
architecture: RTMDet
2+
norm_type: sync_bn
3+
use_ema: True
4+
ema_decay: 0.9998
5+
ema_decay_type: "exponential"
6+
act: silu
7+
find_unused_parameters: True
8+
with_mask: True
9+
10+
depth_mult: 1.0
11+
width_mult: 1.0
12+
13+
RTMDet:
14+
backbone: CSPNeXt
15+
neck: CSPNeXtPAFPN
16+
head: RTMDetInsHead
17+
with_mask: True
18+
post_process: ~
19+
20+
CSPNeXt:
21+
arch: "P5"
22+
return_idx: [2, 3, 4]
23+
24+
# use default config
25+
# CSPNeXtPAFPN:
26+
27+
RTMDetInsHead:
28+
exp_on_reg: False
29+
fpn_strides: [8, 16, 32]
30+
grid_cell_offset: 0
31+
nms:
32+
name: MultiClassNMS
33+
nms_top_k: 1000
34+
keep_top_k: 100
35+
score_threshold: 0.05
36+
nms_threshold: 0.6
37+
return_index: True

configs/rtmdet/_base_/rtmdet_reader.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ EvalReader:
3737
- Pad: {size: [640, 640], fill_value: [114., 114., 114.]}
3838
- NormalizeImage: {mean: [0.485, 0.456, 0.406], std: [0.229, 0.224, 0.225], is_scale: True}
3939
- Permute: {}
40-
batch_size: 4
40+
batch_size: 1
4141

4242

4343
TestReader:
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
_BASE_: [
2+
'../datasets/coco_instance.yml',
3+
'../runtime.yml',
4+
'./_base_/optimizer_300e.yml',
5+
'./_base_/rtmdet_ins_cspnext.yml',
6+
'./_base_/rtmdet_reader.yml',
7+
]
8+
depth_mult: 1.0
9+
width_mult: 1.0
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/rtmnet_ins_l_300e_coco/model_final
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
_BASE_: [
2+
'../datasets/coco_instance.yml',
3+
'../runtime.yml',
4+
'./_base_/optimizer_300e.yml',
5+
'./_base_/rtmdet_ins_cspnext.yml',
6+
'./_base_/rtmdet_reader.yml',
7+
]
8+
depth_mult: 0.67
9+
width_mult: 0.75
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/rtmnet_ins_m_300e_coco/model_final
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
_BASE_: [
2+
'../datasets/coco_instance.yml',
3+
'../runtime.yml',
4+
'./_base_/optimizer_300e.yml',
5+
'./_base_/rtmdet_ins_cspnext.yml',
6+
'./_base_/rtmdet_reader.yml',
7+
]
8+
depth_mult: 0.33
9+
width_mult: 0.50
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/rtmnet_ins_s_300e_coco/model_final
14+
pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/pretrained/cspnext_s_pretrained.pdparams
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
_BASE_: [
2+
'../datasets/coco_instance.yml',
3+
'../runtime.yml',
4+
'./_base_/optimizer_300e.yml',
5+
'./_base_/rtmdet_ins_cspnext.yml',
6+
'./_base_/rtmdet_reader.yml',
7+
]
8+
depth_mult: 0.167 # 0.33 in yolox-tiny
9+
width_mult: 0.375
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/rtmnet_ins_t_300e_coco/model_final
14+
pretrain_weights: https://bj.bcebos.com/v1/paddledet/models/pretrained/cspnext_t_pretrained.pdparams
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
_BASE_: [
2+
'../datasets/coco_instance.yml',
3+
'../runtime.yml',
4+
'./_base_/optimizer_300e.yml',
5+
'./_base_/rtmdet_ins_cspnext.yml',
6+
'./_base_/rtmdet_reader.yml',
7+
]
8+
depth_mult: 1.33
9+
width_mult: 1.25
10+
11+
log_iter: 100
12+
snapshot_epoch: 10
13+
weights: output/rtmnet_ins_x_300e_coco/model_final

configs/yolov5_seg/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# YOLOv5 Instance segmentation
2+
3+
## 模型库
4+
5+
### 实例分割模型
6+
7+
| 网络网络 | 输入尺寸 | 图片数/GPU | 学习率策略 | 模型推理耗时(ms) | box AP | mask AP | Params(M) | FLOPs(G) | 下载链接 | 配置文件 |
8+
| :------------- | :------- | :-------: | :------: | :------------: | :---------------------: | :----------------: |:---------: | :------: |:---------------: |:-----: |
9+
| *YOLOv5-n | 640 | 16 | 300e | - | 27.6 | - | 2.0 | 7.1 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5_seg_n_300e_coco.pdparams) | [配置文件](./yolov5_seg_n_300e_coco.yml) |
10+
| *YOLOv5-s | 640 | 16 | 300e | - | 37.6 | - | 7.8 | 26.4 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5_seg_s_300e_coco.pdparams) | [配置文件](./yolov5_seg_s_300e_coco.yml) |
11+
| *YOLOv5-m | 640 | 16 | 300e | - | 45.0 | - | 22.0 | 70.8 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5_seg_m_300e_coco.pdparams) | [配置文件](./yolov5_seg_m_300e_coco.yml) |
12+
| *YOLOv5-l | 640 | 16 | 300e | - | 48.9 | - | 47.9 | 147.7 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5_seg_l_300e_coco.pdparams) | [配置文件](./yolov5_seg_l_300e_coco.yml) |
13+
| *YOLOv5-x | 640 | 16 | 300e | - | 50.6 | - | 88.8 | 265.7 | [下载链接](https://paddledet.bj.bcebos.com/models/yolov5_seg_x_300e_coco.pdparams) | [配置文件](./yolov5_seg_x_300e_coco.yml) |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
epoch: 300
2+
3+
LearningRate:
4+
base_lr: 0.01
5+
schedulers:
6+
- !YOLOv5LRDecay
7+
max_epochs: 300
8+
min_lr_ratio: 0.01
9+
- !ExpWarmup
10+
epochs: 3
11+
12+
OptimizerBuilder:
13+
optimizer:
14+
type: Momentum
15+
momentum: 0.937
16+
use_nesterov: True
17+
regularizer:
18+
factor: 0.0005
19+
type: L2

0 commit comments

Comments
 (0)