Commit a6167fdb authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Merge branch 'multiple-protocols' into 'master'

Add a command for multi protocol (N-fold cross validation) analysis

See merge request !166
parents a55d9111 7e80a446
Pipeline #21411 passed with stages
in 27 minutes and 59 seconds
......@@ -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()
......
......@@ -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 '''
......
......@@ -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',
......
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