Commit f78773cf authored by Yannick DAYER's avatar Yannick DAYER

Put back the correct function for split PAI

parent 955a94cf
Pipeline #51405 failed with stage
in 7 minutes and 39 seconds
...@@ -126,7 +126,7 @@ def apcer_bpcer(threshold, pos, *negs): ...@@ -126,7 +126,7 @@ def apcer_bpcer(threshold, pos, *negs):
return apcers, max(apcers), bpcer return apcers, max(apcers), bpcer
def negatives_per_pai_and_positives(filename, regexps=[], regexp_column="attack_type"): def split_csv_pad_per_pai(filename, regexps=[], regexp_column="attack_type"):
"""Returns scores for Bona-Fide samples and scores for each PAI. """Returns scores for Bona-Fide samples and scores for each PAI.
By default, the real_id column (second column) is used as indication for each By default, the real_id column (second column) is used as indication for each
Presentation Attack Instrument (PAI). Presentation Attack Instrument (PAI).
......
...@@ -6,7 +6,7 @@ from bob.extension.scripts.click_helper import verbosity_option ...@@ -6,7 +6,7 @@ from bob.extension.scripts.click_helper import verbosity_option
import bob.bio.base.script.gen as bio_gen import bob.bio.base.script.gen as bio_gen
import bob.measure.script.figure as measure_figure import bob.measure.script.figure as measure_figure
from . import pad_figure as figure from . import pad_figure as figure
from .error_utils import split_csv_pad from .error_utils import split_csv_pad, split_csv_pad_per_pai
from functools import partial from functools import partial
SCORE_FORMAT = "Files must be in CSV format." SCORE_FORMAT = "Files must be in CSV format."
...@@ -168,7 +168,9 @@ See also ``bob pad multi-metrics``. ...@@ -168,7 +168,9 @@ See also ``bob pad multi-metrics``.
@regexp_column_option() @regexp_column_option()
@metrics_option() @metrics_option()
def metrics(ctx, scores, evaluation, regexps, regexp_column, metrics, **kwargs): def metrics(ctx, scores, evaluation, regexps, regexp_column, metrics, **kwargs):
load_fn = partial(split_csv_pad, regexps=regexps, regexp_column=regexp_column) load_fn = partial(
split_csv_pad_per_pai, regexps=regexps, regexp_column=regexp_column
)
process = figure.Metrics(ctx, scores, evaluation, load_fn, metrics) process = figure.Metrics(ctx, scores, evaluation, load_fn, metrics)
process.run() process.run()
...@@ -242,6 +244,8 @@ def multi_metrics( ...@@ -242,6 +244,8 @@ def multi_metrics(
ctx, scores, evaluation, protocols_number, regexps, regexp_column, metrics, **kwargs ctx, scores, evaluation, protocols_number, regexps, regexp_column, metrics, **kwargs
): ):
ctx.meta["min_arg"] = protocols_number * (2 if evaluation else 1) ctx.meta["min_arg"] = protocols_number * (2 if evaluation else 1)
load_fn = partial(split_csv_pad, regexps=regexps, regexp_column=regexp_column) load_fn = partial(
split_csv_pad_per_pai, regexps=regexps, regexp_column=regexp_column
)
process = figure.MultiMetrics(ctx, scores, evaluation, load_fn, metrics) process = figure.MultiMetrics(ctx, scores, evaluation, load_fn, metrics)
process.run() process.run()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment