Data Augmentation 관련
안녕하세요 업데이트가 늦었습니다.. ㅎㅎ Data Augmentation에 Mosaic을 적용하기 위해서는 train_dataset 파이프라인에 MultiImageMixDataset을 같이 사용 해야 합니다. 방법은 아래와 같습니다. # Open configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py directly and add the following fields data_root = 'data/coco/' dataset_type = 'CocoDataset' img_scale=(1333, 800) img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='Mosaic', img_scale=img_scale, pad_val=114.0), dict( type='RandomAffine', scaling_ratio_range=(0.1, 2), border=(-img_scale[0] // 2, -img_scale[1] // 2)), # The image will be enlarged by 4 times after Mosaic processing,so we use affine transformation to restore the image size. dict(type='RandomFlip', flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='Pad', size_divisor=32), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels']) ] train_dataset = dict( _delete_ = True, # remove unnecessary Settings type='MultiImageMixDataset', dataset=dict( type=dataset_type, ann_file=data_root + 'annotations/instances_train2017.json', img_prefix=data_root + 'train2017/', pipeline=[ dict(type='LoadImageFromFile'), dict(type='LoadAnnotations', with_bbox=True) ], filter_empty_gt=False, ), pipeline=train_pipeline ) data = dict( train=train_dataset ) 감사합니다.