YOLOv8-Real-Time-Object-Detection / yolov8_l_mask-refine_syncbn_fast_8xb16-500e_coco.py
javad-rezaie
upload pytorch model
8f0cbd1
_backend_args = None
_multiscale_resize_transforms = [
dict(
_scope_='mmyolo',
transforms=[
dict(scale=(
640,
640,
), type='YOLOv5KeepRatioResize'),
dict(
allow_scale_up=False,
pad_val=dict(img=114),
scale=(
640,
640,
),
type='LetterResize'),
],
type='Compose'),
dict(
_scope_='mmyolo',
transforms=[
dict(scale=(
320,
320,
), type='YOLOv5KeepRatioResize'),
dict(
allow_scale_up=False,
pad_val=dict(img=114),
scale=(
320,
320,
),
type='LetterResize'),
],
type='Compose'),
dict(
_scope_='mmyolo',
transforms=[
dict(scale=(
960,
960,
), type='YOLOv5KeepRatioResize'),
dict(
allow_scale_up=False,
pad_val=dict(img=114),
scale=(
960,
960,
),
type='LetterResize'),
],
type='Compose'),
]
affine_scale = 0.9
albu_train_transforms = [
dict(_scope_='mmyolo', p=0.01, type='Blur'),
dict(_scope_='mmyolo', p=0.01, type='MedianBlur'),
dict(_scope_='mmyolo', p=0.01, type='ToGray'),
dict(_scope_='mmyolo', p=0.01, type='CLAHE'),
]
backend_args = None
base_lr = 0.0001
batch_shapes_cfg = None
batch_size = 4
check_point_interval = 10
classes = (
'person',
'bicycle',
'car',
'motorcycle',
'airplane',
'bus',
'train',
'truck',
'boat',
'traffic light',
'fire hydrant',
'stop sign',
'parking meter',
'bench',
'bird',
'cat',
'dog',
'horse',
'sheep',
'cow',
'elephant',
'bear',
'zebra',
'giraffe',
'backpack',
'umbrella',
'handbag',
'tie',
'suitcase',
'frisbee',
'skis',
'snowboard',
'sports ball',
'kite',
'baseball bat',
'baseball glove',
'skateboard',
'surfboard',
'tennis racket',
'bottle',
'wine glass',
'cup',
'fork',
'knife',
'spoon',
'bowl',
'banana',
'apple',
'sandwich',
'orange',
'broccoli',
'carrot',
'hot dog',
'pizza',
'donut',
'cake',
'chair',
'couch',
'potted plant',
'bed',
'dining table',
'toilet',
'tv',
'laptop',
'mouse',
'remote',
'keyboard',
'cell phone',
'microwave',
'oven',
'toaster',
'sink',
'refrigerator',
'book',
'clock',
'vase',
'scissors',
'teddy bear',
'hair drier',
'toothbrush',
'banner',
'blanket',
'branch',
'bridge',
'building-other',
'bush',
'cabinet',
'cage',
'cardboard',
'carpet',
'ceiling-other',
'ceiling-tile',
'cloth',
'clothes',
'clouds',
'counter',
'cupboard',
'curtain',
'desk-stuff',
'dirt',
'door-stuff',
'fence',
'floor-marble',
'floor-other',
'floor-stone',
'floor-tile',
'floor-wood',
'flower',
'fog',
'food-other',
'fruit',
'furniture-other',
'grass',
'gravel',
'ground-other',
'hill',
'house',
'leaves',
'light',
'mat',
'metal',
'mirror-stuff',
'moss',
'mountain',
'mud',
'napkin',
'net',
'paper',
'pavement',
'pillow',
'plant-other',
'plastic',
'platform',
'playingfield',
'railing',
'railroad',
'river',
'road',
'rock',
'roof',
'rug',
'salad',
'sand',
'sea',
'shelf',
'sky-other',
'skyscraper',
'snow',
'solid-other',
'stairs',
'stone',
'straw',
'structural-other',
'table',
'tent',
'textile-other',
'towel',
'tree',
'vegetable',
'wall-brick',
'wall-concrete',
'wall-other',
'wall-panel',
'wall-stone',
'wall-tile',
'wall-wood',
'water-other',
'waterdrops',
'window-blind',
'window-other',
'wood',
)
close_mosaic_epochs = 10
copypaste_prob = 0.3
custom_hooks = [
dict(
ema_type='ExpMomentumEMA',
momentum=0.0001,
priority=49,
strict_load=False,
type='EMAHook',
update_buffers=True),
dict(
switch_epoch=90,
switch_pipeline=[
dict(
_scope_='mmyolo', backend_args=None, type='LoadImageFromFile'),
dict(
_scope_='mmyolo',
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
dict(
_scope_='mmyolo',
scale=(
640,
640,
),
type='YOLOv5KeepRatioResize'),
dict(
_scope_='mmyolo',
allow_scale_up=True,
pad_val=dict(img=114.0),
scale=(
640,
640,
),
type='LetterResize'),
dict(
_scope_='mmyolo',
border_val=(
114,
114,
114,
),
max_aspect_ratio=100,
max_rotate_degree=0.0,
max_shear_degree=0.0,
min_area_ratio=0.01,
scaling_ratio_range=(
0.09999999999999998,
1.9,
),
type='YOLOv5RandomAffine',
use_mask_refine=True),
dict(
_scope_='mmyolo',
keys=[
'gt_masks',
],
type='RemoveDataElement'),
dict(
_scope_='mmyolo',
bbox_params=dict(
format='pascal_voc',
label_fields=[
'gt_bboxes_labels',
'gt_ignore_flags',
],
type='BboxParams'),
keymap=dict(gt_bboxes='bboxes', img='image'),
transforms=[
dict(p=0.01, type='Blur'),
dict(p=0.01, type='MedianBlur'),
dict(p=0.01, type='ToGray'),
dict(p=0.01, type='CLAHE'),
],
type='mmdet.Albu'),
dict(_scope_='mmyolo', type='YOLOv5HSVRandomAug'),
dict(_scope_='mmyolo', prob=0.5, type='mmdet.RandomFlip'),
dict(
_scope_='mmyolo',
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'flip',
'flip_direction',
),
type='mmdet.PackDetInputs'),
],
type='mmdet.PipelineSwitchHook'),
]
data_root = '/data/'
dataset_type = 'YOLOv5CocoDataset'
deepen_factor = 1.0
default_hooks = dict(
checkpoint=dict(interval=10, max_keep_ckpts=1, type='CheckpointHook'),
logger=dict(_scope_='mmyolo', interval=50, type='LoggerHook'),
param_scheduler=dict(
_scope_='mmyolo',
lr_factor=0.1,
max_epochs=100,
scheduler_type='linear',
type='YOLOv5ParamSchedulerHook'),
sampler_seed=dict(_scope_='mmyolo', type='DistSamplerSeedHook'),
timer=dict(_scope_='mmyolo', type='IterTimerHook'),
visualization=dict(_scope_='mmyolo', type='mmdet.DetVisualizationHook'))
default_scope = 'mmyolo'
env_cfg = dict(
cudnn_benchmark=True,
dist_cfg=dict(backend='nccl'),
mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0))
img_scale = (
640,
640,
)
img_scales = [
(
640,
640,
),
(
320,
320,
),
(
960,
960,
),
]
last_stage_out_channels = 512
last_transform = [
dict(_scope_='mmyolo', keys=[
'gt_masks',
], type='RemoveDataElement'),
dict(
_scope_='mmyolo',
bbox_params=dict(
format='pascal_voc',
label_fields=[
'gt_bboxes_labels',
'gt_ignore_flags',
],
type='BboxParams'),
keymap=dict(gt_bboxes='bboxes', img='image'),
transforms=[
dict(p=0.01, type='Blur'),
dict(p=0.01, type='MedianBlur'),
dict(p=0.01, type='ToGray'),
dict(p=0.01, type='CLAHE'),
],
type='mmdet.Albu'),
dict(_scope_='mmyolo', type='YOLOv5HSVRandomAug'),
dict(_scope_='mmyolo', prob=0.5, type='mmdet.RandomFlip'),
dict(
_scope_='mmyolo',
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'flip',
'flip_direction',
),
type='mmdet.PackDetInputs'),
]
launcher = 'pytorch'
load_from = 'https://download.openmmlab.com/mmyolo/v0/yolov8/yolov8_l_mask-refine_syncbn_fast_8xb16-500e_coco/yolov8_l_mask-refine_syncbn_fast_8xb16-500e_coco_20230217_120100-5881dec4.pth'
log_level = 'INFO'
log_processor = dict(
_scope_='mmyolo', by_epoch=True, type='LogProcessor', window_size=50)
loss_bbox_weight = 7.5
loss_cls_weight = 0.5
loss_dfl_weight = 0.375
lr_factor = 0.1
max_aspect_ratio = 100
max_epochs = 100
max_keep_ckpts = 2
metainfo = dict(
classes=(
'person',
'bicycle',
'car',
'motorcycle',
'airplane',
'bus',
'train',
'truck',
'boat',
'traffic light',
'fire hydrant',
'stop sign',
'parking meter',
'bench',
'bird',
'cat',
'dog',
'horse',
'sheep',
'cow',
'elephant',
'bear',
'zebra',
'giraffe',
'backpack',
'umbrella',
'handbag',
'tie',
'suitcase',
'frisbee',
'skis',
'snowboard',
'sports ball',
'kite',
'baseball bat',
'baseball glove',
'skateboard',
'surfboard',
'tennis racket',
'bottle',
'wine glass',
'cup',
'fork',
'knife',
'spoon',
'bowl',
'banana',
'apple',
'sandwich',
'orange',
'broccoli',
'carrot',
'hot dog',
'pizza',
'donut',
'cake',
'chair',
'couch',
'potted plant',
'bed',
'dining table',
'toilet',
'tv',
'laptop',
'mouse',
'remote',
'keyboard',
'cell phone',
'microwave',
'oven',
'toaster',
'sink',
'refrigerator',
'book',
'clock',
'vase',
'scissors',
'teddy bear',
'hair drier',
'toothbrush',
'banner',
'blanket',
'branch',
'bridge',
'building-other',
'bush',
'cabinet',
'cage',
'cardboard',
'carpet',
'ceiling-other',
'ceiling-tile',
'cloth',
'clothes',
'clouds',
'counter',
'cupboard',
'curtain',
'desk-stuff',
'dirt',
'door-stuff',
'fence',
'floor-marble',
'floor-other',
'floor-stone',
'floor-tile',
'floor-wood',
'flower',
'fog',
'food-other',
'fruit',
'furniture-other',
'grass',
'gravel',
'ground-other',
'hill',
'house',
'leaves',
'light',
'mat',
'metal',
'mirror-stuff',
'moss',
'mountain',
'mud',
'napkin',
'net',
'paper',
'pavement',
'pillow',
'plant-other',
'plastic',
'platform',
'playingfield',
'railing',
'railroad',
'river',
'road',
'rock',
'roof',
'rug',
'salad',
'sand',
'sea',
'shelf',
'sky-other',
'skyscraper',
'snow',
'solid-other',
'stairs',
'stone',
'straw',
'structural-other',
'table',
'tent',
'textile-other',
'towel',
'tree',
'vegetable',
'wall-brick',
'wall-concrete',
'wall-other',
'wall-panel',
'wall-stone',
'wall-tile',
'wall-wood',
'water-other',
'waterdrops',
'window-blind',
'window-other',
'wood',
))
min_area_ratio = 0.01
mixup_prob = 0.15
model = dict(
_scope_='mmyolo',
backbone=dict(
act_cfg=dict(inplace=True, type='SiLU'),
arch='P5',
deepen_factor=1.0,
last_stage_out_channels=512,
norm_cfg=dict(eps=0.001, momentum=0.03, type='BN'),
type='YOLOv8CSPDarknet',
widen_factor=1.0),
bbox_head=dict(
bbox_coder=dict(type='DistancePointBBoxCoder'),
head_module=dict(
act_cfg=dict(inplace=True, type='SiLU'),
featmap_strides=[
8,
16,
32,
],
in_channels=[
256,
512,
512,
],
norm_cfg=dict(eps=0.001, momentum=0.03, type='BN'),
num_classes=171,
reg_max=16,
type='YOLOv8HeadModule',
widen_factor=1.0),
loss_bbox=dict(
bbox_format='xyxy',
iou_mode='ciou',
loss_weight=7.5,
reduction='sum',
return_iou=False,
type='IoULoss'),
loss_cls=dict(
loss_weight=0.5,
reduction='none',
type='mmdet.CrossEntropyLoss',
use_sigmoid=True),
loss_dfl=dict(
loss_weight=0.375,
reduction='mean',
type='mmdet.DistributionFocalLoss'),
prior_generator=dict(
offset=0.5, strides=[
8,
16,
32,
], type='mmdet.MlvlPointGenerator'),
type='YOLOv8Head'),
data_preprocessor=dict(
bgr_to_rgb=True,
mean=[
0.0,
0.0,
0.0,
],
std=[
255.0,
255.0,
255.0,
],
type='YOLOv5DetDataPreprocessor'),
neck=dict(
act_cfg=dict(inplace=True, type='SiLU'),
deepen_factor=1.0,
in_channels=[
256,
512,
512,
],
norm_cfg=dict(eps=0.001, momentum=0.03, type='BN'),
num_csp_blocks=3,
out_channels=[
256,
512,
512,
],
type='YOLOv8PAFPN',
widen_factor=1.0),
test_cfg=dict(
max_per_img=300,
multi_label=True,
nms=dict(iou_threshold=0.7, type='nms'),
nms_pre=30000,
score_thr=0.001),
train_cfg=dict(
assigner=dict(
alpha=0.5,
beta=6.0,
eps=1e-09,
num_classes=171,
topk=10,
type='BatchTaskAlignedAssigner',
use_ciou=True)),
type='YOLODetector')
model_test_cfg = dict(
max_per_img=300,
multi_label=True,
nms=dict(_scope_='mmyolo', iou_threshold=0.7, type='nms'),
nms_pre=30000,
score_thr=0.001)
mosaic_affine_transform = [
dict(
_scope_='mmyolo',
img_scale=(
640,
640,
),
pad_val=114.0,
pre_transform=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
],
type='Mosaic'),
dict(_scope_='mmyolo', prob=0.3, type='YOLOv5CopyPaste'),
dict(
_scope_='mmyolo',
border=(
-320,
-320,
),
border_val=(
114,
114,
114,
),
max_aspect_ratio=100.0,
max_rotate_degree=0.0,
max_shear_degree=0.0,
min_area_ratio=0.01,
scaling_ratio_range=(
0.09999999999999998,
1.9,
),
type='YOLOv5RandomAffine',
use_mask_refine=True),
]
norm_cfg = dict(_scope_='mmyolo', eps=0.001, momentum=0.03, type='BN')
num_classes = 171
num_det_layers = 3
optim_wrapper = dict(
optimizer=dict(lr=0.0001, type='AdamW', weight_decay=0.05),
paramwise_cfg=dict(
bias_decay_mult=0, bypass_duplicate=True, norm_decay_mult=0),
type='OptimWrapper')
param_scheduler = [
dict(begin=0, by_epoch=True, end=5, start_factor=0.1, type='LinearLR'),
dict(
begin=70,
by_epoch=True,
convert_to_iter_based=True,
end=100,
eta_min=1.0000000000000002e-06,
type='CosineAnnealingLR'),
]
persistent_workers = True
pre_transform = [
dict(_scope_='mmyolo', backend_args=None, type='LoadImageFromFile'),
dict(
_scope_='mmyolo',
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
]
resume = False
save_epoch_intervals = 10
strides = [
8,
16,
32,
]
tal_alpha = 0.5
tal_beta = 6.0
tal_topk = 10
test_annot = 'test_coco.json'
test_cfg = dict(_scope_='mmyolo', type='TestLoop')
test_dataloader = dict(
batch_size=4,
dataset=dict(
_scope_='mmyolo',
ann_file='test_coco.json',
batch_shapes_cfg=None,
data_prefix=dict(img='images/'),
data_root='/data/',
metainfo=dict(
classes=(
'person',
'bicycle',
'car',
'motorcycle',
'airplane',
'bus',
'train',
'truck',
'boat',
'traffic light',
'fire hydrant',
'stop sign',
'parking meter',
'bench',
'bird',
'cat',
'dog',
'horse',
'sheep',
'cow',
'elephant',
'bear',
'zebra',
'giraffe',
'backpack',
'umbrella',
'handbag',
'tie',
'suitcase',
'frisbee',
'skis',
'snowboard',
'sports ball',
'kite',
'baseball bat',
'baseball glove',
'skateboard',
'surfboard',
'tennis racket',
'bottle',
'wine glass',
'cup',
'fork',
'knife',
'spoon',
'bowl',
'banana',
'apple',
'sandwich',
'orange',
'broccoli',
'carrot',
'hot dog',
'pizza',
'donut',
'cake',
'chair',
'couch',
'potted plant',
'bed',
'dining table',
'toilet',
'tv',
'laptop',
'mouse',
'remote',
'keyboard',
'cell phone',
'microwave',
'oven',
'toaster',
'sink',
'refrigerator',
'book',
'clock',
'vase',
'scissors',
'teddy bear',
'hair drier',
'toothbrush',
'banner',
'blanket',
'branch',
'bridge',
'building-other',
'bush',
'cabinet',
'cage',
'cardboard',
'carpet',
'ceiling-other',
'ceiling-tile',
'cloth',
'clothes',
'clouds',
'counter',
'cupboard',
'curtain',
'desk-stuff',
'dirt',
'door-stuff',
'fence',
'floor-marble',
'floor-other',
'floor-stone',
'floor-tile',
'floor-wood',
'flower',
'fog',
'food-other',
'fruit',
'furniture-other',
'grass',
'gravel',
'ground-other',
'hill',
'house',
'leaves',
'light',
'mat',
'metal',
'mirror-stuff',
'moss',
'mountain',
'mud',
'napkin',
'net',
'paper',
'pavement',
'pillow',
'plant-other',
'plastic',
'platform',
'playingfield',
'railing',
'railroad',
'river',
'road',
'rock',
'roof',
'rug',
'salad',
'sand',
'sea',
'shelf',
'sky-other',
'skyscraper',
'snow',
'solid-other',
'stairs',
'stone',
'straw',
'structural-other',
'table',
'tent',
'textile-other',
'towel',
'tree',
'vegetable',
'wall-brick',
'wall-concrete',
'wall-other',
'wall-panel',
'wall-stone',
'wall-tile',
'wall-wood',
'water-other',
'waterdrops',
'window-blind',
'window-other',
'wood',
)),
pipeline=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(scale=(
640,
640,
), type='YOLOv5KeepRatioResize'),
dict(
allow_scale_up=False,
pad_val=dict(img=114),
scale=(
640,
640,
),
type='LetterResize'),
dict(_scope_='mmdet', type='LoadAnnotations', with_bbox=True),
dict(
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'scale_factor',
'pad_param',
),
type='mmdet.PackDetInputs'),
],
test_mode=True,
type='YOLOv5CocoDataset'),
drop_last=False,
num_workers=3,
persistent_workers=True,
pin_memory=True,
sampler=dict(shuffle=True, type='DefaultSampler'))
test_evaluator = dict(
_scope_='mmyolo',
ann_file='/data/test_coco.json',
metric='bbox',
proposal_nums=(
100,
1,
10,
),
type='mmdet.CocoMetric')
test_image_folder = 'images/'
test_pipeline = [
dict(_scope_='mmyolo', backend_args=None, type='LoadImageFromFile'),
dict(_scope_='mmyolo', scale=(
640,
640,
), type='YOLOv5KeepRatioResize'),
dict(
_scope_='mmyolo',
allow_scale_up=False,
pad_val=dict(img=114),
scale=(
640,
640,
),
type='LetterResize'),
dict(_scope_='mmdet', type='LoadAnnotations', with_bbox=True),
dict(
_scope_='mmyolo',
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'scale_factor',
'pad_param',
),
type='mmdet.PackDetInputs'),
]
train_ann_file = 'annotations/instances_train2017.json'
train_annot = 'train_coco.json'
train_batch_size_per_gpu = 16
train_cfg = dict(
_scope_='mmyolo',
dynamic_intervals=[
(
90,
1,
),
],
max_epochs=100,
type='EpochBasedTrainLoop',
val_interval=1)
train_data_annot_path = '/data/train_coco.json'
train_data_prefix = 'train2017/'
train_dataloader = dict(
batch_size=4,
collate_fn=dict(type='yolov5_collate'),
dataset=dict(
_scope_='mmyolo',
ann_file='train_coco.json',
data_prefix=dict(img='images/'),
data_root='/data/',
filter_cfg=dict(filter_empty_gt=False, min_size=32),
metainfo=dict(
classes=(
'person',
'bicycle',
'car',
'motorcycle',
'airplane',
'bus',
'train',
'truck',
'boat',
'traffic light',
'fire hydrant',
'stop sign',
'parking meter',
'bench',
'bird',
'cat',
'dog',
'horse',
'sheep',
'cow',
'elephant',
'bear',
'zebra',
'giraffe',
'backpack',
'umbrella',
'handbag',
'tie',
'suitcase',
'frisbee',
'skis',
'snowboard',
'sports ball',
'kite',
'baseball bat',
'baseball glove',
'skateboard',
'surfboard',
'tennis racket',
'bottle',
'wine glass',
'cup',
'fork',
'knife',
'spoon',
'bowl',
'banana',
'apple',
'sandwich',
'orange',
'broccoli',
'carrot',
'hot dog',
'pizza',
'donut',
'cake',
'chair',
'couch',
'potted plant',
'bed',
'dining table',
'toilet',
'tv',
'laptop',
'mouse',
'remote',
'keyboard',
'cell phone',
'microwave',
'oven',
'toaster',
'sink',
'refrigerator',
'book',
'clock',
'vase',
'scissors',
'teddy bear',
'hair drier',
'toothbrush',
'banner',
'blanket',
'branch',
'bridge',
'building-other',
'bush',
'cabinet',
'cage',
'cardboard',
'carpet',
'ceiling-other',
'ceiling-tile',
'cloth',
'clothes',
'clouds',
'counter',
'cupboard',
'curtain',
'desk-stuff',
'dirt',
'door-stuff',
'fence',
'floor-marble',
'floor-other',
'floor-stone',
'floor-tile',
'floor-wood',
'flower',
'fog',
'food-other',
'fruit',
'furniture-other',
'grass',
'gravel',
'ground-other',
'hill',
'house',
'leaves',
'light',
'mat',
'metal',
'mirror-stuff',
'moss',
'mountain',
'mud',
'napkin',
'net',
'paper',
'pavement',
'pillow',
'plant-other',
'plastic',
'platform',
'playingfield',
'railing',
'railroad',
'river',
'road',
'rock',
'roof',
'rug',
'salad',
'sand',
'sea',
'shelf',
'sky-other',
'skyscraper',
'snow',
'solid-other',
'stairs',
'stone',
'straw',
'structural-other',
'table',
'tent',
'textile-other',
'towel',
'tree',
'vegetable',
'wall-brick',
'wall-concrete',
'wall-other',
'wall-panel',
'wall-stone',
'wall-tile',
'wall-wood',
'water-other',
'waterdrops',
'window-blind',
'window-other',
'wood',
)),
pipeline=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
dict(
img_scale=(
640,
640,
),
pad_val=114.0,
pre_transform=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
],
type='Mosaic'),
dict(prob=0.3, type='YOLOv5CopyPaste'),
dict(
border=(
-320,
-320,
),
border_val=(
114,
114,
114,
),
max_aspect_ratio=100.0,
max_rotate_degree=0.0,
max_shear_degree=0.0,
min_area_ratio=0.01,
scaling_ratio_range=(
0.09999999999999998,
1.9,
),
type='YOLOv5RandomAffine',
use_mask_refine=True),
dict(
pre_transform=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
dict(
img_scale=(
640,
640,
),
pad_val=114.0,
pre_transform=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
],
type='Mosaic'),
dict(prob=0.3, type='YOLOv5CopyPaste'),
dict(
border=(
-320,
-320,
),
border_val=(
114,
114,
114,
),
max_aspect_ratio=100.0,
max_rotate_degree=0.0,
max_shear_degree=0.0,
min_area_ratio=0.01,
scaling_ratio_range=(
0.09999999999999998,
1.9,
),
type='YOLOv5RandomAffine',
use_mask_refine=True),
],
prob=0.15,
type='YOLOv5MixUp'),
dict(keys=[
'gt_masks',
], type='RemoveDataElement'),
dict(
bbox_params=dict(
format='pascal_voc',
label_fields=[
'gt_bboxes_labels',
'gt_ignore_flags',
],
type='BboxParams'),
keymap=dict(gt_bboxes='bboxes', img='image'),
transforms=[
dict(p=0.01, type='Blur'),
dict(p=0.01, type='MedianBlur'),
dict(p=0.01, type='ToGray'),
dict(p=0.01, type='CLAHE'),
],
type='mmdet.Albu'),
dict(type='YOLOv5HSVRandomAug'),
dict(prob=0.5, type='mmdet.RandomFlip'),
dict(
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'flip',
'flip_direction',
),
type='mmdet.PackDetInputs'),
],
type='YOLOv5CocoDataset'),
num_workers=3,
persistent_workers=True,
pin_memory=True,
sampler=dict(shuffle=True, type='DefaultSampler'))
train_image_folder = 'images/'
train_num_workers = 8
train_pipeline = [
dict(_scope_='mmyolo', backend_args=None, type='LoadImageFromFile'),
dict(
_scope_='mmyolo',
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
dict(
_scope_='mmyolo',
img_scale=(
640,
640,
),
pad_val=114.0,
pre_transform=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
],
type='Mosaic'),
dict(_scope_='mmyolo', prob=0.3, type='YOLOv5CopyPaste'),
dict(
_scope_='mmyolo',
border=(
-320,
-320,
),
border_val=(
114,
114,
114,
),
max_aspect_ratio=100.0,
max_rotate_degree=0.0,
max_shear_degree=0.0,
min_area_ratio=0.01,
scaling_ratio_range=(
0.09999999999999998,
1.9,
),
type='YOLOv5RandomAffine',
use_mask_refine=True),
dict(
_scope_='mmyolo',
pre_transform=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
dict(
img_scale=(
640,
640,
),
pad_val=114.0,
pre_transform=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
],
type='Mosaic'),
dict(prob=0.3, type='YOLOv5CopyPaste'),
dict(
border=(
-320,
-320,
),
border_val=(
114,
114,
114,
),
max_aspect_ratio=100.0,
max_rotate_degree=0.0,
max_shear_degree=0.0,
min_area_ratio=0.01,
scaling_ratio_range=(
0.09999999999999998,
1.9,
),
type='YOLOv5RandomAffine',
use_mask_refine=True),
],
prob=0.15,
type='YOLOv5MixUp'),
dict(_scope_='mmyolo', keys=[
'gt_masks',
], type='RemoveDataElement'),
dict(
_scope_='mmyolo',
bbox_params=dict(
format='pascal_voc',
label_fields=[
'gt_bboxes_labels',
'gt_ignore_flags',
],
type='BboxParams'),
keymap=dict(gt_bboxes='bboxes', img='image'),
transforms=[
dict(p=0.01, type='Blur'),
dict(p=0.01, type='MedianBlur'),
dict(p=0.01, type='ToGray'),
dict(p=0.01, type='CLAHE'),
],
type='mmdet.Albu'),
dict(_scope_='mmyolo', type='YOLOv5HSVRandomAug'),
dict(_scope_='mmyolo', prob=0.5, type='mmdet.RandomFlip'),
dict(
_scope_='mmyolo',
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'flip',
'flip_direction',
),
type='mmdet.PackDetInputs'),
]
train_pipeline_stage2 = [
dict(_scope_='mmyolo', backend_args=None, type='LoadImageFromFile'),
dict(
_scope_='mmyolo',
mask2bbox=True,
type='LoadAnnotations',
with_bbox=True,
with_mask=True),
dict(_scope_='mmyolo', scale=(
640,
640,
), type='YOLOv5KeepRatioResize'),
dict(
_scope_='mmyolo',
allow_scale_up=True,
pad_val=dict(img=114.0),
scale=(
640,
640,
),
type='LetterResize'),
dict(
_scope_='mmyolo',
border_val=(
114,
114,
114,
),
max_aspect_ratio=100,
max_rotate_degree=0.0,
max_shear_degree=0.0,
min_area_ratio=0.01,
scaling_ratio_range=(
0.09999999999999998,
1.9,
),
type='YOLOv5RandomAffine',
use_mask_refine=True),
dict(_scope_='mmyolo', keys=[
'gt_masks',
], type='RemoveDataElement'),
dict(
_scope_='mmyolo',
bbox_params=dict(
format='pascal_voc',
label_fields=[
'gt_bboxes_labels',
'gt_ignore_flags',
],
type='BboxParams'),
keymap=dict(gt_bboxes='bboxes', img='image'),
transforms=[
dict(p=0.01, type='Blur'),
dict(p=0.01, type='MedianBlur'),
dict(p=0.01, type='ToGray'),
dict(p=0.01, type='CLAHE'),
],
type='mmdet.Albu'),
dict(_scope_='mmyolo', type='YOLOv5HSVRandomAug'),
dict(_scope_='mmyolo', prob=0.5, type='mmdet.RandomFlip'),
dict(
_scope_='mmyolo',
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'flip',
'flip_direction',
),
type='mmdet.PackDetInputs'),
]
tta_model = dict(
_scope_='mmyolo',
tta_cfg=dict(max_per_img=300, nms=dict(iou_threshold=0.65, type='nms')),
type='mmdet.DetTTAModel')
tta_pipeline = [
dict(_scope_='mmyolo', backend_args=None, type='LoadImageFromFile'),
dict(
_scope_='mmyolo',
transforms=[
[
dict(
transforms=[
dict(scale=(
640,
640,
), type='YOLOv5KeepRatioResize'),
dict(
allow_scale_up=False,
pad_val=dict(img=114),
scale=(
640,
640,
),
type='LetterResize'),
],
type='Compose'),
dict(
transforms=[
dict(scale=(
320,
320,
), type='YOLOv5KeepRatioResize'),
dict(
allow_scale_up=False,
pad_val=dict(img=114),
scale=(
320,
320,
),
type='LetterResize'),
],
type='Compose'),
dict(
transforms=[
dict(scale=(
960,
960,
), type='YOLOv5KeepRatioResize'),
dict(
allow_scale_up=False,
pad_val=dict(img=114),
scale=(
960,
960,
),
type='LetterResize'),
],
type='Compose'),
],
[
dict(prob=1.0, type='mmdet.RandomFlip'),
dict(prob=0.0, type='mmdet.RandomFlip'),
],
[
dict(type='mmdet.LoadAnnotations', with_bbox=True),
],
[
dict(
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'scale_factor',
'pad_param',
'flip',
'flip_direction',
),
type='mmdet.PackDetInputs'),
],
],
type='TestTimeAug'),
]
use_mask2refine = True
val_ann_file = 'annotations/instances_val2017.json'
val_annot = 'test_coco.json'
val_batch_size_per_gpu = 1
val_cfg = dict(_scope_='mmyolo', type='ValLoop')
val_data_prefix = 'val2017/'
val_dataloader = dict(
batch_size=4,
dataset=dict(
_scope_='mmyolo',
ann_file='test_coco.json',
batch_shapes_cfg=None,
data_prefix=dict(img='images/'),
data_root='/data/',
metainfo=dict(
classes=(
'person',
'bicycle',
'car',
'motorcycle',
'airplane',
'bus',
'train',
'truck',
'boat',
'traffic light',
'fire hydrant',
'stop sign',
'parking meter',
'bench',
'bird',
'cat',
'dog',
'horse',
'sheep',
'cow',
'elephant',
'bear',
'zebra',
'giraffe',
'backpack',
'umbrella',
'handbag',
'tie',
'suitcase',
'frisbee',
'skis',
'snowboard',
'sports ball',
'kite',
'baseball bat',
'baseball glove',
'skateboard',
'surfboard',
'tennis racket',
'bottle',
'wine glass',
'cup',
'fork',
'knife',
'spoon',
'bowl',
'banana',
'apple',
'sandwich',
'orange',
'broccoli',
'carrot',
'hot dog',
'pizza',
'donut',
'cake',
'chair',
'couch',
'potted plant',
'bed',
'dining table',
'toilet',
'tv',
'laptop',
'mouse',
'remote',
'keyboard',
'cell phone',
'microwave',
'oven',
'toaster',
'sink',
'refrigerator',
'book',
'clock',
'vase',
'scissors',
'teddy bear',
'hair drier',
'toothbrush',
'banner',
'blanket',
'branch',
'bridge',
'building-other',
'bush',
'cabinet',
'cage',
'cardboard',
'carpet',
'ceiling-other',
'ceiling-tile',
'cloth',
'clothes',
'clouds',
'counter',
'cupboard',
'curtain',
'desk-stuff',
'dirt',
'door-stuff',
'fence',
'floor-marble',
'floor-other',
'floor-stone',
'floor-tile',
'floor-wood',
'flower',
'fog',
'food-other',
'fruit',
'furniture-other',
'grass',
'gravel',
'ground-other',
'hill',
'house',
'leaves',
'light',
'mat',
'metal',
'mirror-stuff',
'moss',
'mountain',
'mud',
'napkin',
'net',
'paper',
'pavement',
'pillow',
'plant-other',
'plastic',
'platform',
'playingfield',
'railing',
'railroad',
'river',
'road',
'rock',
'roof',
'rug',
'salad',
'sand',
'sea',
'shelf',
'sky-other',
'skyscraper',
'snow',
'solid-other',
'stairs',
'stone',
'straw',
'structural-other',
'table',
'tent',
'textile-other',
'towel',
'tree',
'vegetable',
'wall-brick',
'wall-concrete',
'wall-other',
'wall-panel',
'wall-stone',
'wall-tile',
'wall-wood',
'water-other',
'waterdrops',
'window-blind',
'window-other',
'wood',
)),
pipeline=[
dict(backend_args=None, type='LoadImageFromFile'),
dict(scale=(
640,
640,
), type='YOLOv5KeepRatioResize'),
dict(
allow_scale_up=False,
pad_val=dict(img=114),
scale=(
640,
640,
),
type='LetterResize'),
dict(_scope_='mmdet', type='LoadAnnotations', with_bbox=True),
dict(
meta_keys=(
'img_id',
'img_path',
'ori_shape',
'img_shape',
'scale_factor',
'pad_param',
),
type='mmdet.PackDetInputs'),
],
test_mode=True,
type='YOLOv5CocoDataset'),
drop_last=False,
num_workers=3,
persistent_workers=True,
pin_memory=True,
sampler=dict(shuffle=True, type='DefaultSampler'))
val_evaluator = dict(
_scope_='mmyolo',
ann_file='/data/test_coco.json',
metric='bbox',
proposal_nums=(
100,
1,
10,
),
type='mmdet.CocoMetric')
val_image_folder = 'images/'
val_interval = 1
val_interval_stage2 = 1
val_num_workers = 2
vis_backends = [
dict(_scope_='mmyolo', type='LocalVisBackend'),
]
visualizer = dict(
_scope_='mmyolo',
name='visualizer',
type='mmdet.DetLocalVisualizer',
vis_backends=[
dict(type='LocalVisBackend'),
])
warmup_epochs = 5
weight_decay = 0.0005
widen_factor = 1.0
work_dir = '/out'