forked from open-mmlab/mmyolo
-
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] YOLOv8 supports using mask annotation to optimize bbox (ope…
…n-mmlab#484) * add cfg * add copypaste * add todo * 在mosaic和mixup中处理gt_masks,改config * fix cat bug * add finetune box in affine * add repr * del albu config in l * add doc * add config * format code * fix loadmask * addconfig,fix mask * fix loadann * fix tra * update LoadAnnotations * update * support mask * fix error * fix error * fix config and no maskrefine bug * fix * fix * update config * format code * beauty config * add yolov5 config and readme * beauty yolov5 config * add ut * fix ut. bitmap 2 poly * fix ut and add mix transform ut. * fix bool * fix loadann * rollback yolov5 * rollback yolov5 * format * 提高速度 * update --------- Co-authored-by: huanghaian <[email protected]>
- Loading branch information
1 parent
cbadd3a
commit 75fc8fc
Showing
15 changed files
with
1,055 additions
and
159 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
65 changes: 65 additions & 0 deletions
65
configs/yolov8/yolov8_l_mask-refine_syncbn_fast_8xb16-500e_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,65 @@ | ||
_base_ = './yolov8_m_mask-refine_syncbn_fast_8xb16-500e_coco.py' | ||
|
||
# This config use refining bbox and `YOLOv5CopyPaste`. | ||
# Refining bbox means refining bbox by mask while loading annotations and | ||
# transforming after `YOLOv5RandomAffine` | ||
|
||
# ========================modified parameters====================== | ||
deepen_factor = 1.00 | ||
widen_factor = 1.00 | ||
last_stage_out_channels = 512 | ||
|
||
mixup_prob = 0.15 | ||
copypaste_prob = 0.3 | ||
|
||
# =======================Unmodified in most cases================== | ||
img_scale = _base_.img_scale | ||
pre_transform = _base_.pre_transform | ||
last_transform = _base_.last_transform | ||
affine_scale = _base_.affine_scale | ||
|
||
model = dict( | ||
backbone=dict( | ||
last_stage_out_channels=last_stage_out_channels, | ||
deepen_factor=deepen_factor, | ||
widen_factor=widen_factor), | ||
neck=dict( | ||
deepen_factor=deepen_factor, | ||
widen_factor=widen_factor, | ||
in_channels=[256, 512, last_stage_out_channels], | ||
out_channels=[256, 512, last_stage_out_channels]), | ||
bbox_head=dict( | ||
head_module=dict( | ||
widen_factor=widen_factor, | ||
in_channels=[256, 512, last_stage_out_channels]))) | ||
|
||
mosaic_affine_transform = [ | ||
dict( | ||
type='Mosaic', | ||
img_scale=img_scale, | ||
pad_val=114.0, | ||
pre_transform=pre_transform), | ||
dict(type='YOLOv5CopyPaste', prob=copypaste_prob), | ||
dict( | ||
type='YOLOv5RandomAffine', | ||
max_rotate_degree=0.0, | ||
max_shear_degree=0.0, | ||
max_aspect_ratio=100., | ||
scaling_ratio_range=(1 - affine_scale, 1 + affine_scale), | ||
# img_scale is (width, height) | ||
border=(-img_scale[0] // 2, -img_scale[1] // 2), | ||
border_val=(114, 114, 114), | ||
min_area_ratio=_base_.min_area_ratio, | ||
use_mask_refine=_base_.use_mask2refine) | ||
] | ||
|
||
train_pipeline = [ | ||
*pre_transform, *mosaic_affine_transform, | ||
dict( | ||
type='YOLOv5MixUp', | ||
prob=mixup_prob, | ||
pre_transform=[*pre_transform, *mosaic_affine_transform]), | ||
*last_transform | ||
] | ||
|
||
train_dataloader = dict(dataset=dict(pipeline=train_pipeline)) |
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.