本文整理匯總了Python中torch.utils.data.unaligned_dataset方法的典型用法代碼示例。如果您正苦於以下問題:Python data.unaligned_dataset方法的具體用法?Python data.unaligned_dataset怎麽用?Python data.unaligned_dataset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類torch.utils.data
的用法示例。
在下文中一共展示了data.unaligned_dataset方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: CreateDataset
# 需要導入模塊: from torch.utils import data [as 別名]
# 或者: from torch.utils.data import unaligned_dataset [as 別名]
def CreateDataset(opt):
dataset = None
if opt.dataset_mode == 'aligned':
from data.aligned_dataset import AlignedDataset
dataset = AlignedDataset()
elif opt.dataset_mode == 'unaligned':
from data.unaligned_dataset import UnalignedDataset
dataset = UnalignedDataset()
elif opt.dataset_mode == 'labeled':
from data.labeled_dataset import LabeledDataset
dataset = LabeledDataset()
elif opt.dataset_mode == 'single':
from data.single_dataset import SingleDataset
dataset = SingleDataset()
else:
raise ValueError("Dataset [%s] not recognized." % opt.dataset_mode)
print("dataset [%s] was created" % (dataset.name()))
dataset.initialize(opt)
return dataset
示例2: CreateDataset
# 需要導入模塊: from torch.utils import data [as 別名]
# 或者: from torch.utils.data import unaligned_dataset [as 別名]
def CreateDataset(opt):
dataset = None
if opt.dataset_mode == 'aligned':
from data.aligned_dataset import AlignedDataset
dataset = AlignedDataset()
elif opt.dataset_mode == 'unaligned':
from data.unaligned_dataset import UnalignedDataset
dataset = UnalignedDataset()
elif opt.dataset_mode == 'single':
from data.single_dataset import SingleDataset
dataset = SingleDataset()
elif opt.dataset_mode == 'half_crop':
from data.half_dataset import HalfDataset
dataset = HalfDataset()
else:
raise ValueError("Dataset [%s] not recognized." % opt.dataset_mode)
print("dataset [%s] was created" % (dataset.name()))
dataset.initialize(opt)
return dataset
示例3: CreateDataset
# 需要導入模塊: from torch.utils import data [as 別名]
# 或者: from torch.utils.data import unaligned_dataset [as 別名]
def CreateDataset(opt):
dataset = None
if opt.dataset_mode == 'unaligned':
from data.unaligned_dataset import UnalignedDataset
dataset = UnalignedDataset()
elif opt.dataset_mode == 'unaligned_triplet':
from data.unaligned_triplet_dataset import UnalignedTripletDataset
dataset = UnalignedTripletDataset()
else:
raise ValueError("Dataset [%s] not recognized." % opt.dataset_mode)
print("dataset [%s] was created" % (dataset.name()))
dataset.initialize(opt)
return dataset
示例4: CreateDataset
# 需要導入模塊: from torch.utils import data [as 別名]
# 或者: from torch.utils.data import unaligned_dataset [as 別名]
def CreateDataset(opt):
dataset = None
from data.unaligned_dataset import UnalignedDataset
dataset = UnalignedDataset()
print("dataset [%s] was created" % (dataset.name()))
dataset.initialize(opt)
# dataset.__getitem__(1)
return dataset