Skip to content

Commit

Permalink
add ppyoloe-seg
Browse files Browse the repository at this point in the history
  • Loading branch information
MINGtoMING committed Oct 3, 2023
1 parent e3b660f commit 15d0e57
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 0 deletions.
18 changes: 18 additions & 0 deletions configs/ppyoloe_seg/_base_/optimizer_300e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
epoch: 300

LearningRate:
base_lr: 0.01
schedulers:
- name: CosineDecay
max_epochs: 360
- name: LinearWarmup
start_factor: 0.
epochs: 5

OptimizerBuilder:
optimizer:
momentum: 0.9
type: Momentum
regularizer:
factor: 0.0005
type: L2
48 changes: 48 additions & 0 deletions configs/ppyoloe_seg/_base_/ppyoloe_seg_crn.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
architecture: PPYOLOE
norm_type: sync_bn
use_ema: true
ema_decay: 0.9998
ema_black_list: ['proj_conv.weight']
custom_black_list: ['reduce_mean']

PPYOLOE:
backbone: CSPResNet
neck: CustomCSPPAN
yolo_head: PPYOLOEHead
post_process: ~

CSPResNet:
layers: [3, 6, 6, 3]
channels: [64, 128, 256, 512, 1024]
return_idx: [1, 2, 3]
use_large_stem: True

CustomCSPPAN:
out_channels: [768, 384, 192]
stage_num: 1
block_num: 3
act: 'swish'
spp: true

PPYOLOESegHead:
fpn_strides: [32, 16, 8]
grid_cell_scale: 5.0
grid_cell_offset: 0.5
static_assigner_epoch: 30
use_varifocal_loss: True
loss_weight: {class: 1.0, iou: 2.5, dfl: 0.5, mask: 2.5, dice: 2.5}
static_assigner:
name: ATSSAssigner
topk: 9
assigner:
name: TaskAlignedAssigner
topk: 13
alpha: 1.0
beta: 6.0
nms:
name: MultiClassNMS
return_index: True
nms_top_k: 1000
keep_top_k: 30
score_threshold: 0.01
nms_threshold: 0.7
41 changes: 41 additions & 0 deletions configs/ppyoloe_seg/_base_/ppyoloe_seg_reader.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
worker_num: 4
eval_height: &eval_height 640
eval_width: &eval_width 640
eval_size: &eval_size [*eval_height, *eval_width]

TrainReader:
sample_transforms:
- Decode: {}
- Poly2Mask: {del_poly: True}
- RandomDistort: {}
- RandomExpand: {fill_value: [123.675, 116.28, 103.53]}
- RandomCrop: {}
- RandomFlip: {}
batch_transforms:
- BatchRandomResize: {target_size: [320, 352, 384, 416, 448, 480, 512, 544, 576, 608, 640, 672, 704, 736, 768], 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: 8
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
15 changes: 15 additions & 0 deletions configs/ppyoloe_seg/ppyoloe_seg_crn_l_300e_coco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
_BASE_: [
'../datasets/coco_instance.yml',
'../runtime.yml',
'./_base_/optimizer_300e.yml',
'./_base_/ppyoloe_seg_crn.yml',
'./_base_/ppyoloe_seg_reader.yml',
]

log_iter: 100
snapshot_epoch: 10
weights: output/ppyoloe_seg_crn_l_300e_coco/model_final

pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/CSPResNetb_l_pretrained.pdparams
depth_mult: 1.0
width_mult: 1.0

0 comments on commit 15d0e57

Please sign in to comment.