本文整理匯總了Python中data.custom_dataset_data_loader.CustomDatasetDataLoader方法的典型用法代碼示例。如果您正苦於以下問題:Python custom_dataset_data_loader.CustomDatasetDataLoader方法的具體用法?Python custom_dataset_data_loader.CustomDatasetDataLoader怎麽用?Python custom_dataset_data_loader.CustomDatasetDataLoader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類data.custom_dataset_data_loader
的用法示例。
在下文中一共展示了custom_dataset_data_loader.CustomDatasetDataLoader方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from data import custom_dataset_data_loader [as 別名]
# 或者: from data.custom_dataset_data_loader import CustomDatasetDataLoader [as 別名]
def __init__(self):
self._opt = TrainOptions().parse()
data_loader_train = CustomDatasetDataLoader(self._opt, is_for_train=True)
data_loader_test = CustomDatasetDataLoader(self._opt, is_for_train=False)
self._dataset_train = data_loader_train.load_data()
self._dataset_test = data_loader_test.load_data()
self._dataset_train_size = len(data_loader_train)
self._dataset_test_size = len(data_loader_test)
print('#train images = %d' % self._dataset_train_size)
print('#test images = %d' % self._dataset_test_size)
self._model = ModelsFactory.get_by_name(self._opt.model, self._opt)
self._tb_visualizer = TBVisualizer(self._opt)
self._train()
示例2: CreateDataLoader
# 需要導入模塊: from data import custom_dataset_data_loader [as 別名]
# 或者: from data.custom_dataset_data_loader import CustomDatasetDataLoader [as 別名]
def CreateDataLoader(opt):
from data.custom_dataset_data_loader import CustomDatasetDataLoader
data_loader = CustomDatasetDataLoader()
print(data_loader.name())
data_loader.initialize(opt)
return data_loader
示例3: CreateDataLoader
# 需要導入模塊: from data import custom_dataset_data_loader [as 別名]
# 或者: from data.custom_dataset_data_loader import CustomDatasetDataLoader [as 別名]
def CreateDataLoader(datafolder,dataroot='./dataset',dataset_mode='2afc',load_size=64,batch_size=1,serial_batches=True,nThreads=4):
from data.custom_dataset_data_loader import CustomDatasetDataLoader
data_loader = CustomDatasetDataLoader()
# print(data_loader.name())
data_loader.initialize(datafolder,dataroot=dataroot+'/'+dataset_mode,dataset_mode=dataset_mode,load_size=load_size,batch_size=batch_size,serial_batches=serial_batches, nThreads=nThreads)
return data_loader
示例4: CreateDataLoader
# 需要導入模塊: from data import custom_dataset_data_loader [as 別名]
# 或者: from data.custom_dataset_data_loader import CustomDatasetDataLoader [as 別名]
def CreateDataLoader(opt):
data_loader = CustomDatasetDataLoader()
print(data_loader.name())
data_loader.initialize(opt)
return data_loader