dataset_type = "CocoDataset"
img_dir = "/media/VA/databases/{{cookiecutter.dataset}}/images/"
ann_dir = "results/data/property_split-{{cookiecutter.dataset}}/"
CLASSES = None
img_scale = (512, 512)
keep_ratio = False
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="LoadImageFromFile", to_float32=True),
dict(type="LoadAnnotations", with_bbox=True),
dict(type="Resize", img_scale=img_scale, keep_ratio=keep_ratio),
dict(type="Pad", size_divisor=32),
dict(type="Normalize", **img_norm_cfg),
dict(type="DefaultFormatBundle"),
dict(
type="Collect",
keys=["img", "gt_bboxes", "gt_labels"],
meta_keys=(
"filename",
"ori_shape",
"img_shape",
"img_norm_cfg",
"pad_shape",
"scale_factor",
),
),
]
test_pipeline = [
dict(type="LoadImageFromFile"),
dict(
type="MultiScaleFlipAug",
img_scale=img_scale,
flip=False,
transforms=[
dict(type="Resize", keep_ratio=keep_ratio),
dict(type="Normalize", **img_norm_cfg),
dict(type="Pad", size_divisor=32),
dict(type="ImageToTensor", keys=["img"]),
dict(type="Collect", keys=["img"]),
],
),
]
data = dict(
samples_per_gpu=4,
workers_per_gpu=2,
train=dict(
type=dataset_type,
ann_file=ann_dir + "{{cookiecutter.dataset}}_train.json",
img_prefix=img_dir,
pipeline=train_pipeline,
classes=CLASSES,
),
val=dict(
type=dataset_type,
ann_file=ann_dir + "{{cookiecutter.dataset}}_val.json",
img_prefix=img_dir,
pipeline=test_pipeline,
classes=CLASSES,
),
test=dict(
type=dataset_type,
ann_file=ann_dir + "{{cookiecutter.dataset}}_val.json",
img_prefix=img_dir,
pipeline=test_pipeline,
classes=CLASSES,
),
)