当前位置: 首页>>代码示例>>Python>>正文


Python BaseDataLoader.initialize方法代码示例

本文整理汇总了Python中data.base_data_loader.BaseDataLoader.initialize方法的典型用法代码示例。如果您正苦于以下问题:Python BaseDataLoader.initialize方法的具体用法?Python BaseDataLoader.initialize怎么用?Python BaseDataLoader.initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在data.base_data_loader.BaseDataLoader的用法示例。


在下文中一共展示了BaseDataLoader.initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: CreateDataset

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [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 
开发者ID:arnabgho,项目名称:iSketchNFill,代码行数:22,代码来源:custom_dataset_data_loader.py

示例2: CreateDataset

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [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 
开发者ID:jessemelpolio,项目名称:non-stationary_texture_syn,代码行数:22,代码来源:custom_dataset_data_loader.py

示例3: CreateDataset

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def CreateDataset(opt):
    dataset = None
    if 'face' in opt.name:
        from data.aligned_dataset_GAN import AlignedDataset
        dataset = AlignedDataset()

    elif opt.is_temporal:
        from data.aligned_dataset_temporal import AlignedDataset
        dataset = AlignedDataset()
        
    else:
        from data.aligned_dataset import AlignedDataset
        dataset = AlignedDataset()

    print("dataset [%s] was created" % (dataset.name()))
    dataset.initialize(opt)
    return dataset 
开发者ID:Kuzphi,项目名称:EverybodyDanceNow-Temporal-FaceGAN,代码行数:19,代码来源:custom_dataset_data_loader.py

示例4: CreateDataset

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def CreateDataset(opt):
	dataset = None
	if opt.dataset_mode == 'synthia_cityscapes':
		from data.synthia_cityscapes import SynthiaCityscapesDataset
		dataset = SynthiaCityscapesDataset()
	elif opt.dataset_mode == 'gta5_cityscapes':
		from data.gta5_cityscapes import GTAVCityscapesDataset
		dataset = GTAVCityscapesDataset()
	elif opt.dataset_mode == 'gta_synthia_cityscapes':
		from data.gta_synthia_cityscapes import GTASynthiaCityscapesDataset
		dataset = GTASynthiaCityscapesDataset()
	elif opt.dataset_mode == 'merged_gta_synthia_cityscapes':
		from data.merged_gta_synthia_cityscapes import MergedGTASynthiaCityscapesDataset
		dataset = MergedGTASynthiaCityscapesDataset()
	else:
		raise ValueError("Dataset [%s] not recognized." % opt.dataset_mode)
	
	print("dataset [%s] was created" % (dataset.name()))
	dataset.initialize(opt)
	return dataset 
开发者ID:Luodian,项目名称:MADAN,代码行数:22,代码来源:__init__.py

示例5: __init__

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def __init__(self,_root, _list_dir, mode):
        # BaseDataLoader.initialize(self)
        # self.fineSize = opt.fineSize

        # transformations = [
            # TODO: Scale
            #transforms.CenterCrop((600,800)),
            # transforms.Scale(256, Image.BICUBIC),
            # transforms.ToTensor() ]
        transform = None
        # transform = transforms.Compose(transformations)

        # Dataset A
        # dataset = ImageFolder(root='/phoenix/S6/zl548/AMOS/test/', \
                # list_dir = '/phoenix/S6/zl548/AMOS/test/list/',transform=transform)
        # testset 
        dataset = IIW_ImageFolder(root=_root, \
                    list_dir =_list_dir, mode = mode, is_flip = True, transform=transform)

        data_loader = torch.utils.data.DataLoader(dataset, batch_size= 16, shuffle= True, num_workers=int(2))

        self.dataset = dataset
        flip = False
        self.iiw_data = IIWData(data_loader, flip) 
开发者ID:zhengqili,项目名称:CGIntrinsics,代码行数:26,代码来源:aligned_data_loader.py

示例6: CreateDataset

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def CreateDataset(opt):
    dataset = None
    if opt.dataset_mode == 'aligned':
        from data.aligned_dataset import AlignedDataset
        dataset = AlignedDataset()

    elif opt.dataset_mode == 'aligned_resized':
        from data.aligned_dataset_resized import AlignedDatasetResized
        dataset = AlignedDatasetResized()

    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 
开发者ID:Zhaoyi-Yan,项目名称:Shift-Net_pytorch,代码行数:22,代码来源:custom_dataset_data_loader.py

示例7: CreateDataset

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [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 
开发者ID:aayushbansal,项目名称:Recycle-GAN,代码行数:16,代码来源:custom_dataset_data_loader.py

示例8: initialize

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def initialize(self, opt):
        BaseDataLoader.initialize(self, opt)
        self.dataset = CreateDataset(opt)
        self.dataloader = torch.utils.data.DataLoader(
            self.dataset,
            batch_size=opt.batchSize,
            shuffle=not opt.serial_batches,
            num_workers=int(opt.nThreads)) 
开发者ID:aayushbansal,项目名称:Recycle-GAN,代码行数:10,代码来源:custom_dataset_data_loader.py

示例9: CreateDataset

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def CreateDataset(opt):
    dataset = None
    from data.aligned_pair_dataset import AlignedPairDataset
    dataset = AlignedPairDataset()

    print("dataset [%s] was created" % (dataset.name()))
    dataset.initialize(opt)
    return dataset 
开发者ID:Lotayou,项目名称:everybody_dance_now_pytorch,代码行数:10,代码来源:custom_dataset_data_loader.py

示例10: CreateDataset

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def CreateDataset(opt):
    dataset = None
    from data.aligned_dataset import AlignedDataset
    dataset = AlignedDataset()

    print("dataset [%s] was created" % (dataset.name()))
    dataset.initialize(opt)
    return dataset 
开发者ID:CUHKSZ-TQL,项目名称:EverybodyDanceNow_reproduce_pytorch,代码行数:10,代码来源:custom_dataset_data_loader.py

示例11: CreateDataset

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def CreateDataset(opt):
    dataset = None
    if opt.model == 'audioVisual':
        from data.audioVisual_dataset import AudioVisualDataset
        dataset = AudioVisualDataset()
    else:
        raise ValueError("Dataset [%s] not recognized." % opt.model)

    print("dataset [%s] was created" % (dataset.name()))
    dataset.initialize(opt)
    return dataset 
开发者ID:facebookresearch,项目名称:2.5D-Visual-Sound,代码行数:13,代码来源:custom_dataset_data_loader.py

示例12: initialize

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def initialize(self, opt):
        BaseDataLoader.initialize(self, opt)
        self.dataset = CreateDataset(opt)
        self.dataloader = torch.utils.data.DataLoader(
            self.dataset,
            batch_size=opt.batchSize,
            shuffle=True,
            num_workers=int(opt.nThreads)) 
开发者ID:facebookresearch,项目名称:2.5D-Visual-Sound,代码行数:10,代码来源:custom_dataset_data_loader.py

示例13: CreateDataLoader

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def CreateDataLoader(opt):
	data_loader = CustomDatasetDataLoader()
	print(data_loader.name())
	data_loader.initialize(opt)
	return data_loader 
开发者ID:Luodian,项目名称:MADAN,代码行数:7,代码来源:__init__.py

示例14: initialize

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def initialize(self, opt):
		BaseDataLoader.initialize(self, opt)
		self.dataset = CreateDataset(opt)
		self.dataloader = torch.utils.data.DataLoader(
			self.dataset,
			batch_size=opt.batchSize,
			shuffle=not opt.serial_batches,
			num_workers=int(opt.nThreads)) 
开发者ID:Luodian,项目名称:MADAN,代码行数:10,代码来源:__init__.py

示例15: CreateDataLoader

# 需要导入模块: from data.base_data_loader import BaseDataLoader [as 别名]
# 或者: from data.base_data_loader.BaseDataLoader import initialize [as 别名]
def CreateDataLoader(args):
    data_loader = CustomDatasetDataLoader()
    data_loader.initialize(args)
    return data_loader 
开发者ID:atapour,项目名称:monocularDepth-Inference,代码行数:6,代码来源:__init__.py


注:本文中的data.base_data_loader.BaseDataLoader.initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。