mirror of
https://github.com/open-mmlab/mmclassification.git
synced 2025-06-03 21:53:55 +08:00
* refactor config doc * refine * Fix the config docs. * update CN config * Fix some grammar erros. * Fix Chinese docs. Co-authored-by: mzr1996 <mzr1996@163.com>
67 lines
1.8 KiB
Python
67 lines
1.8 KiB
Python
# dataset settings
|
|
dataset_type = 'VOC'
|
|
data_preprocessor = dict(
|
|
# RGB format normalization parameters
|
|
mean=[123.675, 116.28, 103.53],
|
|
std=[58.395, 57.12, 57.375],
|
|
# convert image from BGR to RGB
|
|
to_rgb=True,
|
|
)
|
|
|
|
train_pipeline = [
|
|
dict(type='LoadImageFromFile'),
|
|
dict(type='RandomResizedCrop', scale=224),
|
|
dict(type='RandomFlip', prob=0.5, direction='horizontal'),
|
|
dict(type='PackClsInputs'),
|
|
]
|
|
|
|
test_pipeline = [
|
|
dict(type='LoadImageFromFile'),
|
|
dict(type='ResizeEdge', scale=256, edge='short'),
|
|
dict(type='CenterCrop', crop_size=224),
|
|
dict(type='PackClsInputs'),
|
|
]
|
|
|
|
train_dataloader = dict(
|
|
batch_size=16,
|
|
num_workers=5,
|
|
dataset=dict(
|
|
type=dataset_type,
|
|
data_root='data/VOCdevkit/VOC2007',
|
|
image_set_path='ImageSets/Layout/val.txt',
|
|
pipeline=train_pipeline),
|
|
sampler=dict(type='DefaultSampler', shuffle=True),
|
|
persistent_workers=True,
|
|
)
|
|
|
|
val_dataloader = dict(
|
|
batch_size=16,
|
|
num_workers=5,
|
|
dataset=dict(
|
|
type=dataset_type,
|
|
data_root='data/VOCdevkit/VOC2007',
|
|
image_set_path='ImageSets/Layout/val.txt',
|
|
pipeline=test_pipeline),
|
|
sampler=dict(type='DefaultSampler', shuffle=False),
|
|
persistent_workers=True,
|
|
)
|
|
|
|
test_dataloader = dict(
|
|
batch_size=16,
|
|
num_workers=5,
|
|
dataset=dict(
|
|
type=dataset_type,
|
|
data_root='data/VOCdevkit/VOC2007',
|
|
image_set_path='ImageSets/Layout/val.txt',
|
|
pipeline=test_pipeline),
|
|
sampler=dict(type='DefaultSampler', shuffle=False),
|
|
persistent_workers=True,
|
|
)
|
|
|
|
# calculate precision_recall_f1 and mAP
|
|
val_evaluator = [dict(type='MultiLabelMetric'), dict(type='AveragePrecision')]
|
|
|
|
# If you want standard test, please manually configure the test dataset
|
|
test_dataloader = val_dataloader
|
|
test_evaluator = val_evaluator
|