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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.base
Commits
e0481a04
Commit
e0481a04
authored
2 years ago
by
Yannick DAYER
Browse files
Options
Downloads
Patches
Plain Diff
[py] Fix vuln commands to use subject not template
parent
37962fe9
No related branches found
No related tags found
1 merge request
!312
Fix the vuln commands to use subject_id, not template_id
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/bob/bio/base/score/load.py
+1
-1
1 addition, 1 deletion
src/bob/bio/base/score/load.py
src/bob/bio/base/script/vuln_commands.py
+17
-17
17 additions, 17 deletions
src/bob/bio/base/script/vuln_commands.py
with
18 additions
and
18 deletions
src/bob/bio/base/score/load.py
+
1
−
1
View file @
e0481a04
...
@@ -737,7 +737,7 @@ def split_csv_vuln(filename):
...
@@ -737,7 +737,7 @@ def split_csv_vuln(filename):
split_scores
=
{
"
licit_neg
"
:
[],
"
licit_pos
"
:
[],
"
spoof
"
:
[]}
split_scores
=
{
"
licit_neg
"
:
[],
"
licit_pos
"
:
[],
"
spoof
"
:
[]}
for
row
in
_iterate_csv_score_file
(
filename
):
for
row
in
_iterate_csv_score_file
(
filename
):
if
not
row
[
"
probe_attack_type
"
]:
# licit
if
not
row
[
"
probe_attack_type
"
]:
# licit
if
row
[
"
probe_
template
_id
"
]
==
row
[
"
bio_ref_
template
_id
"
]:
if
row
[
"
probe_
subject
_id
"
]
==
row
[
"
bio_ref_
subject
_id
"
]:
split_scores
[
"
licit_pos
"
].
append
(
row
[
"
score
"
])
split_scores
[
"
licit_pos
"
].
append
(
row
[
"
score
"
])
else
:
else
:
split_scores
[
"
licit_neg
"
].
append
(
row
[
"
score
"
])
split_scores
[
"
licit_neg
"
].
append
(
row
[
"
score
"
])
...
...
This diff is collapsed.
Click to expand it.
src/bob/bio/base/script/vuln_commands.py
+
17
−
17
View file @
e0481a04
...
@@ -145,8 +145,8 @@ def write_scores_to_file(neg_licit, pos_licit, spoof, filename):
...
@@ -145,8 +145,8 @@ def write_scores_to_file(neg_licit, pos_licit, spoof, filename):
# Write the header
# Write the header
csv_writer
.
writerow
(
csv_writer
.
writerow
(
[
[
"
bio_ref_
template
_id
"
,
"
bio_ref_
subject
_id
"
,
"
probe_
template
_id
"
,
"
probe_
subject
_id
"
,
"
probe_key
"
,
"
probe_key
"
,
"
probe_attack_type
"
,
"
probe_attack_type
"
,
"
score
"
,
"
score
"
,
...
@@ -196,8 +196,8 @@ def gen(outdir, mean_gen, mean_zei, mean_pa, **kwargs):
...
@@ -196,8 +196,8 @@ def gen(outdir, mean_gen, mean_zei, mean_pa, **kwargs):
biometric system against zero-effort impostor and presentation attacks.
biometric system against zero-effort impostor and presentation attacks.
The CSV score files must contain an `attack-type` column, in addition to the
The CSV score files must contain an `attack-type` column, in addition to the
"
regular
"
biometric scores columns (`bio_ref_
template
_id`,
"
regular
"
biometric scores columns (`bio_ref_
subject
_id`,
`probe_
template
_id`, and `score`).
`probe_
subject
_id`, and `score`).
Examples:
Examples:
...
@@ -223,8 +223,8 @@ def metrics(ctx, scores, evaluation, **kwargs):
...
@@ -223,8 +223,8 @@ def metrics(ctx, scores, evaluation, **kwargs):
* [eval scores]
* [eval scores]
The CSV score files must contain an `attack-type` column, in addition to the
The CSV score files must contain an `attack-type` column, in addition to the
"
regular
"
biometric scores columns (`bio_ref_
template
_id`,
"
regular
"
biometric scores columns (`bio_ref_
subject
_id`,
`probe_
template
_id`, and `score`).
`probe_
subject
_id`, and `score`).
Examples:
Examples:
...
@@ -258,8 +258,8 @@ def roc(ctx, scores, evaluation, real_data, **kwargs):
...
@@ -258,8 +258,8 @@ def roc(ctx, scores, evaluation, real_data, **kwargs):
* [eval scores]
* [eval scores]
The CSV score files must contain an `attack-type` column, in addition to the
The CSV score files must contain an `attack-type` column, in addition to the
"
regular
"
biometric scores columns (`bio_ref_
template
_id`,
"
regular
"
biometric scores columns (`bio_ref_
subject
_id`,
`probe_
template
_id`, and `score`).
`probe_
subject
_id`, and `score`).
See :ref:`bob.bio.base.vulnerability` in the documentation for a guide on
See :ref:`bob.bio.base.vulnerability` in the documentation for a guide on
vulnerability analysis.
vulnerability analysis.
...
@@ -296,8 +296,8 @@ def det(ctx, scores, evaluation, real_data, **kwargs):
...
@@ -296,8 +296,8 @@ def det(ctx, scores, evaluation, real_data, **kwargs):
* eval scores
* eval scores
The CSV score files must contain an `attack-type` column, in addition to the
The CSV score files must contain an `attack-type` column, in addition to the
"
regular
"
biometric scores columns (`bio_ref_
template
_id`,
"
regular
"
biometric scores columns (`bio_ref_
subject
_id`,
`probe_
template
_id`, and `score`).
`probe_
subject
_id`, and `score`).
See :ref:`bob.bio.base.vulnerability` in the documentation for a guide on
See :ref:`bob.bio.base.vulnerability` in the documentation for a guide on
vulnerability analysis.
vulnerability analysis.
...
@@ -336,8 +336,8 @@ def epc(ctx, scores, **kwargs):
...
@@ -336,8 +336,8 @@ def epc(ctx, scores, **kwargs):
* eval scores
* eval scores
The CSV score files must contain an `attack-type` column, in addition to the
The CSV score files must contain an `attack-type` column, in addition to the
"
regular
"
biometric scores columns (`bio_ref_
template
_id`,
"
regular
"
biometric scores columns (`bio_ref_
subject
_id`,
`probe_
template
_id`, and `score`).
`probe_
subject
_id`, and `score`).
See :ref:`bob.bio.base.vulnerability` in the documentation for a guide on
See :ref:`bob.bio.base.vulnerability` in the documentation for a guide on
vulnerability analysis.
vulnerability analysis.
...
@@ -429,8 +429,8 @@ def epsc(ctx, scores, criteria, var_param, three_d, sampling, **kwargs):
...
@@ -429,8 +429,8 @@ def epsc(ctx, scores, criteria, var_param, three_d, sampling, **kwargs):
When evaluation scores are provided, you must use the ``--eval`` option.
When evaluation scores are provided, you must use the ``--eval`` option.
The CSV score files must contain an `attack-type` column, in addition to the
The CSV score files must contain an `attack-type` column, in addition to the
"
regular
"
biometric scores columns (`bio_ref_
template
_id`,
"
regular
"
biometric scores columns (`bio_ref_
subject
_id`,
`probe_
template
_id`, and `score`).
`probe_
subject
_id`, and `score`).
See :ref:`bob.bio.base.vulnerability` in the documentation for a guide on
See :ref:`bob.bio.base.vulnerability` in the documentation for a guide on
vulnerability analysis.
vulnerability analysis.
...
@@ -474,8 +474,8 @@ def hist(ctx, scores, evaluation, **kwargs):
...
@@ -474,8 +474,8 @@ def hist(ctx, scores, evaluation, **kwargs):
* [eval scores]
* [eval scores]
The CSV score files must contain an `attack-type` column, in addition to the
The CSV score files must contain an `attack-type` column, in addition to the
"
regular
"
biometric scores columns (`bio_ref_
template
_id`,
"
regular
"
biometric scores columns (`bio_ref_
subject
_id`,
`probe_
template
_id`, and `score`).
`probe_
subject
_id`, and `score`).
Examples:
Examples:
...
@@ -496,7 +496,7 @@ def fmr_iapmr(ctx, scores, **kwargs):
...
@@ -496,7 +496,7 @@ def fmr_iapmr(ctx, scores, **kwargs):
@common_options.evaluate_command
(
@common_options.evaluate_command
(
common_options
.
EVALUATE_HELP
.
format
(
common_options
.
EVALUATE_HELP
.
format
(
score_format
=
(
score_format
=
(
"
Files must be in CSV format, with the `bio_ref_
template
_id`,
"
"
Files must be in CSV format, with the `bio_ref_
subject
_id`,
"
"
`probe_references_id`, `score`, and `attack_type` columns.
"
"
`probe_references_id`, `score`, and `attack_type` columns.
"
),
),
command
=
"
bob vuln evaluate
"
,
command
=
"
bob vuln evaluate
"
,
...
...
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