Skip to content
Snippets Groups Projects
Commit 1d21a5fc authored by Anjith GEORGE's avatar Anjith GEORGE
Browse files

mods to config

parent 3460b893
Branches
Tags
1 merge request!18MCCNN trainer
......@@ -13,7 +13,7 @@ from bob.learn.pytorch.datasets import ChannelSelect
#==============================================================================
# Load the dataset
""" The steps in initializing the dataset is as follows
""" The steps are as follows
1. Initialize a databae instance, with the protocol, groups and number of frames
(currently for the ones in 'bob.pad.face', and point 'data_folder_train' to the preprocessed directory )
......@@ -27,8 +27,13 @@ from bob.learn.pytorch.datasets import ChannelSelect
4. Initialize the network architecture with required arguments.
5. Define the parameters for the trainer.
"""
#==============================================================================
# Initialize the bob database instance
data_folder_train='/idiap/temp/ageorge/WMCA/preprocessed/'
frames=50
......@@ -41,11 +46,6 @@ protocols="grandtest-color*depth*infrared*thermal-{}".format(frames) # makeup is
exlude_attacks_list=["makeup"]
SELECTED_CHANNELS = [0,1,2] # selects only color, depth and infrared
img_transform_train = transforms.Compose([ChannelSelect(selected_channels = SELECTED_CHANNELS),transforms.ToPILImage(),transforms.RandomHorizontalFlip(),transforms.ToTensor()])# Add p=0.5 later
bob_hldi_instance_train = BatlPadDatabase(
protocol=protocols,
original_directory=data_folder_train,
......@@ -55,6 +55,13 @@ bob_hldi_instance_train = BatlPadDatabase(
exclude_pai_all_sets=True, # exclude makeup from all the sets, which is the default behavior for grandtest protocol
append_color_face_roi_annot=False)
#==============================================================================
# Initialize the torch dataset, subselect channels from the pretrained files if needed.
SELECTED_CHANNELS = [0,1,2] # selects only color, depth and infrared
img_transform_train = transforms.Compose([ChannelSelect(selected_channels = SELECTED_CHANNELS),transforms.ToPILImage(),transforms.RandomHorizontalFlip(),transforms.ToTensor()])# Add p=0.5 later
dataset = DataFolder(data_folder=data_folder_train,
transform=img_transform_train,
extension='.hdf5',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment