Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pad.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.pad.base
Commits
f147e798
There was a problem fetching the pipeline summary.
Commit
f147e798
authored
7 years ago
by
Pavel KORSHUNOV
Browse files
Options
Downloads
Patches
Plain Diff
allow missing files projector
parent
ca4703f5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!18
Adding allow-missing-files to projection and scoring
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/pad/base/tools/algorithm.py
+19
-1
19 additions, 1 deletion
bob/pad/base/tools/algorithm.py
with
19 additions
and
1 deletion
bob/pad/base/tools/algorithm.py
+
19
−
1
View file @
f147e798
...
...
@@ -115,13 +115,31 @@ def project(algorithm, extractor, groups=None, indices=None, allow_missing_files
feature_file
=
str
(
feature_files
[
i
])
projected_file
=
str
(
projected_files
[
i
])
if
not
os
.
path
.
exists
(
feature_file
):
if
allow_missing_files
:
logger
.
debug
(
"
... Cannot find extracted feature file %s; skipping
"
,
feature_file
)
continue
else
:
logger
.
error
(
"
Cannot find extracted feature file %s
"
,
feature_file
)
if
not
utils
.
check_file
(
projected_file
,
force
,
1000
):
logger
.
info
(
"
- Projection: projecting file: %s
"
,
feature_file
)
logger
.
debug
(
"
... Projecting features for file
'
%s
'"
,
feature_file
)
# load feature
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
:
raise
RuntimeError
(
"
Projection of file
'
%s
'
was not successful
"
%
feature_file
)
# write it
bob
.
io
.
base
.
create_directories_safe
(
os
.
path
.
dirname
(
projected_file
))
algorithm
.
write_feature
(
projected
,
projected_file
)
else
:
logger
.
debug
(
"
... Skipping feature file
'
%s
'
since projected file
'
%s
'
exists
"
,
feature_file
,
projected_file
)
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