mirror of
https://github.com/alibaba/EasyCV.git
synced 2025-06-03 14:49:00 +08:00
50 lines
1.7 KiB
Python
50 lines
1.7 KiB
Python
_base_ = './fcos_r50_torch_1x_coco.py'
|
|
|
|
model = dict(
|
|
pretrained=
|
|
'https://pai-vision-data-hz.oss-cn-zhangjiakou.aliyuncs.com/pretrained_models/easycv/resnet/detectron/resnet50_caffe.pth',
|
|
backbone=dict(style='caffe'))
|
|
|
|
img_norm_cfg = dict(
|
|
mean=[103.530, 116.280, 123.675], std=[1.0, 1.0, 1.0], to_rgb=False)
|
|
|
|
train_pipeline = [
|
|
dict(type='MMResize', img_scale=(1333, 800), keep_ratio=True),
|
|
dict(type='MMRandomFlip', flip_ratio=0.5),
|
|
dict(type='MMNormalize', **img_norm_cfg),
|
|
dict(type='MMPad', size_divisor=32),
|
|
dict(type='DefaultFormatBundle'),
|
|
dict(
|
|
type='Collect',
|
|
keys=['img', 'gt_bboxes', 'gt_labels'],
|
|
meta_keys=('filename', 'ori_filename', 'ori_shape', 'ori_img_shape',
|
|
'img_shape', 'pad_shape', 'scale_factor', 'flip',
|
|
'flip_direction', 'img_norm_cfg'))
|
|
]
|
|
test_pipeline = [
|
|
dict(
|
|
type='MMMultiScaleFlipAug',
|
|
img_scale=(1333, 800),
|
|
flip=False,
|
|
transforms=[
|
|
dict(type='MMResize', keep_ratio=True),
|
|
dict(type='MMRandomFlip'),
|
|
dict(type='MMNormalize', **img_norm_cfg),
|
|
dict(type='MMPad', size_divisor=32),
|
|
dict(type='ImageToTensor', keys=['img']),
|
|
dict(
|
|
type='Collect',
|
|
keys=['img'],
|
|
meta_keys=('filename', 'ori_filename', 'ori_shape',
|
|
'ori_img_shape', 'img_shape', 'pad_shape',
|
|
'scale_factor', 'flip', 'flip_direction',
|
|
'img_norm_cfg'))
|
|
])
|
|
]
|
|
|
|
train_dataset = dict(pipeline=train_pipeline)
|
|
val_dataset = dict(pipeline=test_pipeline)
|
|
|
|
data = dict(
|
|
imgs_per_gpu=2, workers_per_gpu=2, train=train_dataset, val=val_dataset)
|