Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.bio.base
Commits
c8ebf06b
Commit
c8ebf06b
authored
Nov 03, 2017
by
Vedrana KRIVOKUCA
Browse files
Add client id as optional parameter to pass to projection function
parent
6b73cb68
Pipeline
#13761
passed with stages
in 11 minutes and 30 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/base/algorithm/Algorithm.py
View file @
c8ebf06b
...
...
@@ -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
...
...
bob/bio/base/tools/algorithm.py
View file @
c8ebf06b
...
...
@@ -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
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment