forked from open-mmlab/mmdeploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Support P6 YOLOv5 (open-mmlab#168)
* add yolov5s config * support train * fix some comment * add config * add link * UPDATE * UPDATE * remove
- Loading branch information
1 parent
14d3f29
commit b95bf63
Showing
25 changed files
with
370 additions
and
52 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
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
15 changes: 15 additions & 0 deletions
15
configs/yolov5/yolov5_l-p6-v62_syncbn_fast_8xb16-300e_coco.py
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,15 @@ | ||
_base_ = './yolov5_m-p6-v62_syncbn_fast_8xb16-300e_coco.py' | ||
|
||
deepen_factor = 1.0 | ||
widen_factor = 1.0 | ||
|
||
model = dict( | ||
backbone=dict( | ||
deepen_factor=deepen_factor, | ||
widen_factor=widen_factor, | ||
), | ||
neck=dict( | ||
deepen_factor=deepen_factor, | ||
widen_factor=widen_factor, | ||
), | ||
bbox_head=dict(head_module=dict(widen_factor=widen_factor))) |
74 changes: 74 additions & 0 deletions
74
configs/yolov5/yolov5_m-p6-v62_syncbn_fast_8xb16-300e_coco.py
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,74 @@ | ||
_base_ = './yolov5_s-p6-v62_syncbn_fast_8xb16-300e_coco.py' | ||
|
||
deepen_factor = 0.67 | ||
widen_factor = 0.75 | ||
lr_factor = 0.1 # lrf=0.1 | ||
affine_scale = 0.9 | ||
|
||
num_classes = _base_.num_classes | ||
num_det_layers = _base_.num_det_layers | ||
img_scale = _base_.img_scale | ||
|
||
model = dict( | ||
backbone=dict( | ||
deepen_factor=deepen_factor, | ||
widen_factor=widen_factor, | ||
), | ||
neck=dict( | ||
deepen_factor=deepen_factor, | ||
widen_factor=widen_factor, | ||
), | ||
bbox_head=dict( | ||
head_module=dict(widen_factor=widen_factor), | ||
loss_cls=dict(loss_weight=0.3 * | ||
(num_classes / 80 * 3 / num_det_layers)), | ||
loss_obj=dict(loss_weight=0.7 * | ||
((img_scale[0] / 640)**2 * 3 / num_det_layers)))) | ||
|
||
pre_transform = _base_.pre_transform | ||
albu_train_transforms = _base_.albu_train_transforms | ||
|
||
mosaic_affine_pipeline = [ | ||
dict( | ||
type='Mosaic', | ||
img_scale=img_scale, | ||
pad_val=114.0, | ||
pre_transform=pre_transform), | ||
dict( | ||
type='YOLOv5RandomAffine', | ||
max_rotate_degree=0.0, | ||
max_shear_degree=0.0, | ||
scaling_ratio_range=(1 - affine_scale, 1 + affine_scale), | ||
border=(-img_scale[0] // 2, -img_scale[1] // 2), | ||
border_val=(114, 114, 114)) | ||
] | ||
|
||
# enable mixup | ||
train_pipeline = [ | ||
*pre_transform, *mosaic_affine_pipeline, | ||
dict( | ||
type='YOLOv5MixUp', | ||
prob=0.1, | ||
pre_transform=[*pre_transform, *mosaic_affine_pipeline]), | ||
dict( | ||
type='mmdet.Albu', | ||
transforms=albu_train_transforms, | ||
bbox_params=dict( | ||
type='BboxParams', | ||
format='pascal_voc', | ||
label_fields=['gt_bboxes_labels', 'gt_ignore_flags']), | ||
keymap={ | ||
'img': 'image', | ||
'gt_bboxes': 'bboxes' | ||
}), | ||
dict(type='YOLOv5HSVRandomAug'), | ||
dict(type='mmdet.RandomFlip', prob=0.5), | ||
dict( | ||
type='mmdet.PackDetInputs', | ||
meta_keys=('img_id', 'img_path', 'ori_shape', 'img_shape', 'flip', | ||
'flip_direction')) | ||
] | ||
|
||
train_dataloader = dict(dataset=dict(pipeline=train_pipeline)) | ||
|
||
default_hooks = dict(param_scheduler=dict(lr_factor=lr_factor)) |
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
15 changes: 15 additions & 0 deletions
15
configs/yolov5/yolov5_n-p6-v62_syncbn_fast_8xb16-300e_coco.py
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,15 @@ | ||
_base_ = 'yolov5_s-p6-v62_syncbn_fast_8xb16-300e_coco.py' | ||
|
||
deepen_factor = 0.33 | ||
widen_factor = 0.25 | ||
|
||
model = dict( | ||
backbone=dict( | ||
deepen_factor=deepen_factor, | ||
widen_factor=widen_factor, | ||
), | ||
neck=dict( | ||
deepen_factor=deepen_factor, | ||
widen_factor=widen_factor, | ||
), | ||
bbox_head=dict(head_module=dict(widen_factor=widen_factor))) |
Oops, something went wrong.