Commit c8ebf06b authored by Vedrana KRIVOKUCA's avatar Vedrana KRIVOKUCA

Add client id as optional parameter to pass to projection function

parent 6b73cb68
Pipeline #13761 passed with stages
in 11 minutes and 30 seconds
......@@ -74,6 +74,7 @@ class Algorithm (object):
self,
performs_projection = False, # enable if your tool will project the features
requires_projector_training = True, # by default, the projector needs training, if projection is enabled
requires_client_id_for_proj=False, # enable if you need to use the client id in the projection
split_training_features_by_client = False, # enable if your projector training needs the training files sorted by client
use_projected_features_for_enrollment = True, # by default, the enroller used projected features for enrollment, if projection is enabled.
requires_enroller_training = False, # enable if your enroller needs training
......@@ -89,6 +90,7 @@ class Algorithm (object):
):
self.performs_projection = performs_projection
self.requires_projector_training = performs_projection and requires_projector_training
self.requires_client_id_for_proj = performs_projection and requires_client_id_for_proj
self.split_training_features_by_client = split_training_features_by_client
self.use_projected_features_for_enrollment = performs_projection and use_projected_features_for_enrollment
self.requires_enroller_training = requires_enroller_training
......
......@@ -97,6 +97,7 @@ def project(algorithm, extractor, groups = None, indices = None, allow_missing_f
# load the projector
algorithm.load_projector(fs.projector_file)
original_data_files = fs.original_data_list(groups=groups) # the actual file objects
feature_files = fs.feature_list(groups=groups)
projected_files = fs.projected_list(groups=groups)
......@@ -129,7 +130,11 @@ def project(algorithm, extractor, groups = None, indices = None, allow_missing_f
# load feature
feature = extractor.read_feature(feature_file)
# project feature
projected = algorithm.project(feature)
if algorithm.requires_client_id_for_proj:
file_object = original_data_files[i]
projected = algorithm.project(feature, file_object.client_id)
else:
projected = algorithm.project(feature)
if projected is None:
if allow_missing_files:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment