Skip to content
Snippets Groups Projects
Commit e0481a04 authored by Yannick DAYER's avatar Yannick DAYER
Browse files

[py] Fix vuln commands to use subject not template

parent 37962fe9
No related branches found
No related tags found
1 merge request!312Fix the vuln commands to use subject_id, not template_id
...@@ -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"])
......
...@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment