-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed30371
commit f325297
Showing
37 changed files
with
1,929 additions
and
714 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
epochs: 300 # total train epochs | ||
|
||
optimizer: | ||
optimizer: momentum | ||
lr_init: 0.01 # initial learning rate (SGD=1E-2, Adam=1E-3) | ||
momentum: 0.937 # SGD momentum/Adam beta1 | ||
nesterov: True # update gradients with NAG(Nesterov Accelerated Gradient) algorithm | ||
loss_scale: 1.0 # loss scale for optimizer | ||
warmup_epochs: 3 # warmup epochs (fractions ok) | ||
warmup_momentum: 0.8 # warmup initial momentum | ||
warmup_bias_lr: 0.1 # warmup initial bias lr | ||
min_warmup_step: 1000 # minimum warmup step | ||
group_param: yolov8 # group param strategy | ||
gp_weight_decay: 0.0010078125 # group param weight decay 5e-4 | ||
start_factor: 1.0 | ||
end_factor: 0.01 | ||
|
||
loss: | ||
name: YOLOv8SegLoss | ||
box: 7.5 # box loss gain | ||
cls: 0.5 # cls loss gain | ||
dfl: 1.5 # dfl loss gain | ||
reg_max: 16 | ||
nm: 32 | ||
overlap: True | ||
max_object_num: 600 | ||
|
||
data: | ||
num_parallel_workers: 4 | ||
|
||
train_transforms: { | ||
stage_epochs: [ 290, 10 ], | ||
trans_list: [ | ||
[ | ||
{func_name: resample_segments}, | ||
{func_name: mosaic, prob: 1.0}, | ||
{func_name: copy_paste, prob: 0.3}, | ||
{func_name: random_perspective, prob: 1.0, degrees: 0.0, translate: 0.1, scale: 0.9, shear: 0.0}, | ||
{func_name: mixup, alpha: 32.0, beta: 32.0, prob: 0.15, pre_transform: [ | ||
{ func_name: resample_segments }, | ||
{ func_name: mosaic, prob: 1.0 }, | ||
{ func_name: copy_paste, prob: 0.3 }, | ||
{ func_name: random_perspective, prob: 1.0, degrees: 0.0, translate: 0.1, scale: 0.9, shear: 0.0 },] | ||
}, | ||
{func_name: albumentations, random_resized_crop: False}, # random_resized_crop not support seg task | ||
{func_name: hsv_augment, prob: 1.0, hgain: 0.015, sgain: 0.7, vgain: 0.4 }, | ||
{func_name: fliplr, prob: 0.5 }, | ||
{func_name: segment_poly2mask, mask_overlap: True, mask_ratio: 4 }, | ||
{func_name: label_norm, xyxy2xywh_: True }, | ||
{func_name: label_pad, padding_size: 160, padding_value: -1 }, | ||
{func_name: image_norm, scale: 255. }, | ||
{func_name: image_transpose, bgr2rgb: True, hwc2chw: True } | ||
], | ||
[ | ||
{func_name: resample_segments}, | ||
{func_name: letterbox, scaleup: True }, | ||
{func_name: random_perspective, prob: 1.0, degrees: 0.0, translate: 0.1, scale: 0.9, shear: 0.0 }, | ||
{func_name: albumentations, random_resized_crop: False}, # random_resized_crop not support seg task | ||
{func_name: hsv_augment, prob: 1.0, hgain: 0.015, sgain: 0.7, vgain: 0.4 }, | ||
{func_name: fliplr, prob: 0.5 }, | ||
{func_name: segment_poly2mask, mask_overlap: True, mask_ratio: 4 }, | ||
{func_name: label_norm, xyxy2xywh_: True }, | ||
{func_name: label_pad, padding_size: 160, padding_value: -1 }, | ||
{func_name: image_norm, scale: 255. }, | ||
{func_name: image_transpose, bgr2rgb: True, hwc2chw: True } | ||
]] | ||
} | ||
|
||
test_transforms: [ | ||
{ func_name: letterbox, scaleup: False }, | ||
{ func_name: image_norm, scale: 255. }, | ||
{ func_name: image_transpose, bgr2rgb: True, hwc2chw: True } | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
task: segment | ||
epochs: 500 # total train epochs | ||
per_batch_size: 16 # 16 * 8 = 128 | ||
img_size: 640 | ||
iou_thres: 0.7 | ||
conf_free: True | ||
sync_bn: True | ||
opencv_threads_num: 0 # opencv: disable threading optimizations | ||
|
||
network: | ||
model_name: yolov8 | ||
nc: 80 # number of classes | ||
reg_max: 16 | ||
|
||
stride: [8, 16, 32] | ||
|
||
# YOLOv8.0n backbone | ||
backbone: | ||
# [from, repeats, module, args] | ||
- [-1, 1, ConvNormAct, [64, 3, 2]] # 0-P1/2 | ||
- [-1, 1, ConvNormAct, [128, 3, 2]] # 1-P2/4 | ||
- [-1, 3, C2f, [128, True]] | ||
- [-1, 1, ConvNormAct, [256, 3, 2]] # 3-P3/8 | ||
- [-1, 6, C2f, [256, True]] | ||
- [-1, 1, ConvNormAct, [512, 3, 2]] # 5-P4/16 | ||
- [-1, 6, C2f, [512, True]] | ||
- [-1, 1, ConvNormAct, [1024, 3, 2]] # 7-P5/32 | ||
- [-1, 3, C2f, [1024, True]] | ||
- [-1, 1, SPPF, [1024, 5]] # 9 | ||
|
||
# YOLOv8.0n head | ||
head: | ||
- [-1, 1, Upsample, [None, 2, 'nearest']] | ||
- [[-1, 6], 1, Concat, [1]] # cat backbone P4 | ||
- [-1, 3, C2f, [512]] # 12 | ||
|
||
- [-1, 1, Upsample, [None, 2, 'nearest']] | ||
- [[-1, 4], 1, Concat, [1] ] # cat backbone P3 | ||
- [-1, 3, C2f, [256]] # 15 (P3/8-small) | ||
|
||
- [-1, 1, ConvNormAct, [256, 3, 2]] | ||
- [[ -1, 12], 1, Concat, [1]] # cat head P4 | ||
- [-1, 3, C2f, [512]] # 18 (P4/16-medium) | ||
|
||
- [-1, 1, ConvNormAct, [512, 3, 2]] | ||
- [[-1, 9], 1, Concat, [1]] # cat head P5 | ||
- [-1, 3, C2f, [1024]] # 21 (P5/32-large) | ||
|
||
- [[15, 18, 21], 1, YOLOv8Head, [nc, reg_max, stride]] # Detect(P3, P4, P5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
__BASE__: [ | ||
'../../coco.yaml', | ||
'./hyp.scratch.high.seg.yaml', | ||
'./yolov8-seg-base.yaml' | ||
] | ||
|
||
recompute: True | ||
recompute_layers: 2 | ||
|
||
network: | ||
depth_multiple: 1.00 # scales module repeats | ||
width_multiple: 1.25 # scales convolution channels | ||
max_channels: 512 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.