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
5633d163
There was a problem fetching the pipeline summary.
Commit
5633d163
authored
7 years ago
by
Pavel KORSHUNOV
Browse files
Options
Downloads
Patches
Plain Diff
allow missing files scoring
parent
f1a048c6
No related branches found
No related tags found
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/scoring.py
+9
-2
9 additions, 2 deletions
bob/pad/base/tools/scoring.py
with
9 additions
and
2 deletions
bob/pad/base/tools/scoring.py
+
9
−
2
View file @
5633d163
...
...
@@ -131,6 +131,7 @@ def _scores_all(algorithm, group, force, allow_missing_files=False, write_compre
type_objects
=
[
'
real
'
,
'
attack
'
]
total_scores
=
[]
one_score_file_exists
=
False
for
i
in
range
(
0
,
2
):
current_objects
=
current_toscore_objects
[
i
]
obj_type
=
type_objects
[
i
]
...
...
@@ -141,6 +142,7 @@ def _scores_all(algorithm, group, force, allow_missing_files=False, write_compre
if
utils
.
check_file
(
score_file
,
force
):
logger
.
warn
(
"
Score file
'
%s
'
already exists.
"
,
score_file
)
total_scores
=
[]
one_score_file_exists
=
True
else
:
# get the attack files
current_files
=
fs
.
get_paths
(
current_objects
,
'
projected
'
if
algorithm
.
performs_projection
else
'
extracted
'
)
...
...
@@ -152,8 +154,13 @@ def _scores_all(algorithm, group, force, allow_missing_files=False, write_compre
if
total_scores
!=
[]
and
not
utils
.
check_file
(
fs
.
score_file_combined
(
group
),
force
):
# save all scores together in one file
_save_scores
(
fs
.
score_file_combined
(
group
),
total_scores
,
current_toscore_objects
[
0
]
+
current_toscore_objects
[
1
],
write_compressed
)
if
one_score_file_exists
:
logger
.
warn
(
"
Since at least one score file already pre-existed,
"
"
we skip combining individual score files together.
"
"
You can do it manually, using
'
cat
'
or similar utilities.
"
)
else
:
_save_scores
(
fs
.
score_file_combined
(
group
),
total_scores
,
current_toscore_objects
[
0
]
+
current_toscore_objects
[
1
],
write_compressed
)
def
compute_scores
(
algorithm
,
force
=
False
,
groups
=
[
'
dev
'
,
'
eval
'
],
allow_missing_files
=
False
,
write_compressed
=
False
):
...
...
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