diff --git a/bob/bio/base/script/commands.py b/bob/bio/base/script/commands.py index 047b797ad7682e166d79f510d67e46da7f0c8014..721695f167d32c938cbe87609c60d366e14860ed 100644 --- a/bob/bio/base/script/commands.py +++ b/bob/bio/base/script/commands.py @@ -84,6 +84,19 @@ def evaluate(ctx, scores, evaluation, **kwargs): ctx, scores, evaluation, metrics, roc, det, epc, hist, **kwargs) +@common_options.multi_metrics_command( + common_options.MULTI_METRICS_HELP.format( + names='FtA, FAR, FRR, FMR, FMNR, HTER', + criteria=CRITERIA, score_format=SCORE_FORMAT, + command='bob pad multi-metrics'), + criteria=CRITERIA) +def multi_metrics(ctx, scores, evaluation, protocols_number, **kwargs): + ctx.meta['min_arg'] = protocols_number * (2 if evaluation else 1) + process = bio_figure.MultiMetrics( + ctx, scores, evaluation, load.split) + process.run() + + @click.command() @common_options.scores_argument(nargs=-1) @common_options.titles_option() diff --git a/bob/bio/base/script/figure.py b/bob/bio/base/script/figure.py index a18af1fc36267bafa8081933344dfb48018a3937..e1e4127b88910a2775477c61bbb2495af1ff2d1d 100644 --- a/bob/bio/base/script/figure.py +++ b/bob/bio/base/script/figure.py @@ -114,7 +114,6 @@ class Dir(measure_figure.PlotBase): class Metrics(measure_figure.Metrics): ''' Compute metrics from score files''' - def init_process(self): if self._criterion == 'rr': self._thres = [None] * self.n_systems if self._thres is None else \ @@ -214,6 +213,18 @@ class Metrics(measure_figure.Metrics): super(Metrics, self).compute(idx, input_scores, input_names) +class MultiMetrics(measure_figure.MultiMetrics): + '''Compute metrics from score files''' + + def __init__(self, ctx, scores, evaluation, func_load): + super(MultiMetrics, self).__init__( + ctx, scores, evaluation, func_load, + names=( + 'Failure to Acquire', 'False Match Rate', + 'False Non Match Rate', 'False Accept Rate', + 'False Reject Rate', 'Half Total Error Rate')) + + class Hist(measure_figure.Hist): ''' Histograms for biometric scores ''' diff --git a/setup.py b/setup.py index e488a1c3698b2554a2a5ff1d6ff8b2e35adce0d0..0fb586ed6d5a1d3d58f1c11beffd032fd85be9fc 100644 --- a/setup.py +++ b/setup.py @@ -139,6 +139,7 @@ setup( 'bob.bio.cli': [ 'annotate = bob.bio.base.script.annotate:annotate', 'metrics = bob.bio.base.script.commands:metrics', + 'multi-metrics = bob.bio.base.script.commands:multi_metrics', 'roc = bob.bio.base.script.commands:roc', 'det = bob.bio.base.script.commands:det', 'epc = bob.bio.base.script.commands:epc',