Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.base
Commits
d320fbc6
Commit
d320fbc6
authored
8 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Allowing feature extraction and projection to fail, when --allow-missing-files is enabled
parent
f71b04c5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/bio/base/tools/algorithm.py
+27
-0
27 additions, 0 deletions
bob/bio/base/tools/algorithm.py
bob/bio/base/tools/extractor.py
+9
-0
9 additions, 0 deletions
bob/bio/base/tools/extractor.py
with
36 additions
and
0 deletions
bob/bio/base/tools/algorithm.py
+
27
−
0
View file @
d320fbc6
...
...
@@ -128,6 +128,15 @@ def project(algorithm, extractor, groups = None, indices = None, allow_missing_f
feature
=
extractor
.
read_feature
(
feature_file
)
# project feature
projected
=
algorithm
.
project
(
feature
)
if
projected
is
None
:
if
allow_missing_files
:
logger
.
debug
(
"
... Projection for extracted file %s failed; skipping
"
,
feature_file
)
continue
else
:
logger
.
error
(
"
Projection of file
'
%s
'
was not successful
"
,
feature_file
)
continue
# write it
algorithm
.
write_feature
(
projected
,
projected_file
)
...
...
@@ -265,6 +274,15 @@ def enroll(algorithm, extractor, compute_zt_norm, indices = None, groups = ['dev
enroll_features
=
[
reader
.
read_feature
(
enroll_file
)
for
enroll_file
in
enroll_files
]
model
=
algorithm
.
enroll
(
enroll_features
)
if
model
is
None
:
if
allow_missing_files
:
logger
.
debug
(
"
... Enrollment for model %s failed; skipping
"
,
model_id
)
continue
else
:
logger
.
error
(
"
Enrollemnt of model
'
%s
'
was not successful
"
,
model_id
)
continue
# save the model
algorithm
.
write_model
(
model
,
model_file
)
...
...
@@ -303,6 +321,15 @@ def enroll(algorithm, extractor, compute_zt_norm, indices = None, groups = ['dev
t_enroll_features
=
[
reader
.
read_feature
(
t_enroll_file
)
for
t_enroll_file
in
t_enroll_files
]
t_model
=
algorithm
.
enroll
(
t_enroll_features
)
if
t_model
is
None
:
if
allow_missing_files
:
logger
.
debug
(
"
... Enrollment for T-model %s failed; skipping
"
,
t_model_id
)
continue
else
:
logger
.
error
(
"
Enrollemnt of T-model
'
%s
'
was not successful
"
,
t_model_id
)
continue
# save model
algorithm
.
write_model
(
t_model
,
t_model_file
)
else
:
...
...
This diff is collapsed.
Click to expand it.
bob/bio/base/tools/extractor.py
+
9
−
0
View file @
d320fbc6
...
...
@@ -117,6 +117,15 @@ def extract(extractor, preprocessor, groups=None, indices = None, allow_missing_
data
=
preprocessor
.
read_data
(
data_file
)
# extract feature
feature
=
extractor
(
data
)
if
feature
is
None
:
if
allow_missing_files
:
logger
.
debug
(
"
... Feature extraction for data file %s failed; skipping
"
,
data_file
)
continue
else
:
logger
.
error
(
"
Feature extraction of file
'
%s
'
was not successful
"
,
data_file
)
continue
# write feature
extractor
.
write_feature
(
feature
,
feature_file
)
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment