提交 c62a9245 编写于 作者: L LielinJiang

rename some dataset

上级 62f9c96c
......@@ -26,7 +26,7 @@ model:
dataset:
train:
name: UnalignedDataset
name: UnpairedDataset
dataroot: data/cityscapes
phase: train
max_dataset_size: inf
......
......@@ -26,7 +26,7 @@ model:
dataset:
train:
name: UnalignedDataset
name: UnpairedDataset
dataroot: data/horse2zebra
phase: train
max_dataset_size: inf
......
......@@ -23,7 +23,7 @@ model:
dataset:
train:
name: AlignedDataset
name: PairedDataset
dataroot: data/cityscapes
phase: train
max_dataset_size: inf
......@@ -38,7 +38,7 @@ dataset:
preprocess: resize_and_crop
no_flip: False
test:
name: AlignedDataset
name: PairedDataset
dataroot: data/cityscapes/
phase: test
max_dataset_size: inf
......
......@@ -23,7 +23,7 @@ model:
dataset:
train:
name: AlignedDataset
name: PairedDataset
dataroot: data/cityscapes
phase: train
max_dataset_size: inf
......@@ -38,7 +38,7 @@ dataset:
preprocess: resize_and_crop
no_flip: False
test:
name: AlignedDataset
name: PairedDataset
dataroot: data/cityscapes/
phase: test
max_dataset_size: inf
......
from .unaligned_dataset import UnalignedDataset
from .unpaired_dataset import UnpairedDataset
from .single_dataset import SingleDataset
from .aligned_dataset import AlignedDataset
from .paired_dataset import PairedDataset
......@@ -8,19 +8,19 @@ from .builder import DATASETS
@DATASETS.register()
class AlignedDataset(BaseDataset):
class PairedDataset(BaseDataset):
"""A dataset class for paired image dataset.
"""
def __init__(self, opt):
def __init__(self, cfg):
"""Initialize this dataset class.
Args:
cfg (dict) -- stores all the experiment flags
"""
BaseDataset.__init__(self, opt)
self.dir_AB = os.path.join(opt.dataroot, opt.phase) # get the image directory
self.AB_paths = sorted(make_dataset(self.dir_AB, opt.max_dataset_size)) # get image paths
BaseDataset.__init__(self, cfg)
self.dir_AB = os.path.join(cfg.dataroot, cfg.phase) # get the image directory
self.AB_paths = sorted(make_dataset(self.dir_AB, cfg.max_dataset_size)) # get image paths
assert(self.cfg.transform.load_size >= self.cfg.transform.crop_size) # crop_size should be smaller than the size of loaded image
self.input_nc = self.cfg.output_nc if self.cfg.direction == 'BtoA' else self.cfg.input_nc
self.output_nc = self.cfg.input_nc if self.cfg.direction == 'BtoA' else self.cfg.output_nc
......
......@@ -8,7 +8,7 @@ from .builder import DATASETS
@DATASETS.register()
class UnalignedDataset(BaseDataset):
class UnpairedDataset(BaseDataset):
"""
"""
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册