returnf_file.client.subclient_id<=35andf_file.finger_id==((f_file.client.subclient_id-1)%6)+1# defines what it means for file to belong to "world" class
model_dict[model_id].enrollment_files.append(f_file)# add the enrollment files associated with this model
ifverbose>1:print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..."%(f_file.path,model_id,p.name,'dev','enroll'))
session.flush()
else:
p.train_files.append(f_file)
p.train_files.append(f_file)# if the file is part of the "world" group then add it to the training set
ifverbose>1:print(" Adding file ('%s') to protocol purpose ('%s', '%s','%s')..."%(f_file.path,p.name,'world','train'))
ifverbose>1:print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..."%(f_file.path,model_id,p.name,'dev','enroll'))
session.flush()
ifproto=='fullLeftRing':# calculate match score between every client (model) and every probe (no training/world set) using only the Left Ring fingers
model_dict={}
forf_fileinfile_list:
iff_file.finger_id==1:# ensures only Left Ring fingers are used
ifverbose>1:print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..."%(f_file.path,model_id,p.name,'dev','enroll'))
session.flush()
eliff_file.session_id!=1:
continue
ifproto=='fullLeftMiddle':# calculate match score between every client (model) and every probe (no training/world set) using only the Left Middle fingers
model_dict={}
forf_fileinfile_list:
iff_file.finger_id==2:# ensures only Left Middle fingers are used
ifverbose>1:print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..."%(f_file.path,model_id,p.name,'dev','enroll'))
session.flush()
eliff_file.session_id!=2:
continue
ifproto=='fullLeftIndex':# calculate match score between every client (model) and every probe (no training/world set) using only the Left Index fingers
model_dict={}
forf_fileinfile_list:
iff_file.finger_id==3:# ensures only Left Index fingers are used
ifverbose>1:print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..."%(f_file.path,model_id,p.name,'dev','enroll'))
session.flush()
eliff_file.session_id!=3:
continue
ifproto=='fullRightIndex':# calculate match score between every client (model) and every probe (no training/world set) using only the Right Index fingers
model_dict={}
forf_fileinfile_list:
iff_file.finger_id==4:# ensures only Right Index fingers are used
ifverbose>1:print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..."%(f_file.path,model_id,p.name,'dev','enroll'))
session.flush()
eliff_file.session_id!=4:
continue
ifproto=='fullRightMiddle':# calculate match score between every client (model) and every probe (no training/world set) using only the Right Middle fingers
model_dict={}
forf_fileinfile_list:
iff_file.finger_id==5:# ensures only Right Middle fingers are used
ifverbose>1:print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..."%(f_file.path,model_id,p.name,'dev','enroll'))
session.flush()
eliff_file.session_id!=5:
continue
ifproto=='fullRightRing':# calculate match score between every client (model) and every probe (no training/world set) using only the Right Ring fingers
model_dict={}
forf_fileinfile_list:
iff_file.finger_id==6:# ensures only Right Ring fingers are used
ifverbose>1:print(" Adding enrollment entry ('%s') to Model ('%s') for protocol purpose ('%s', '%s','%s')..."%(f_file.path,model_id,p.name,'dev','enroll'))
session.flush()
eliff_file.session_id!=6:
continue
defcreate_tables(args):
"""Creates all necessary tables (only to be used at the first time)"""
...
...
@@ -523,3 +698,4 @@ def add_command(subparsers):
parser.add_argument('-D','--imagedir',metavar='DIR',default='/idiap/resource/database/UTFVP/data',help="Change the relative path to the directory containing the images of the UTFVP database (defaults to %(default)s)")