Skip to content
Snippets Groups Projects
Commit 7e80a446 authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

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

parent a55d9111
No related branches found
No related tags found
1 merge request!166Add a command for multi protocol (N-fold cross validation) analysis
Pipeline #
...@@ -84,6 +84,19 @@ def evaluate(ctx, scores, evaluation, **kwargs): ...@@ -84,6 +84,19 @@ def evaluate(ctx, scores, evaluation, **kwargs):
ctx, scores, evaluation, metrics, roc, det, epc, hist, **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() @click.command()
@common_options.scores_argument(nargs=-1) @common_options.scores_argument(nargs=-1)
@common_options.titles_option() @common_options.titles_option()
......
...@@ -114,7 +114,6 @@ class Dir(measure_figure.PlotBase): ...@@ -114,7 +114,6 @@ class Dir(measure_figure.PlotBase):
class Metrics(measure_figure.Metrics): class Metrics(measure_figure.Metrics):
''' Compute metrics from score files''' ''' Compute metrics from score files'''
def init_process(self): def init_process(self):
if self._criterion == 'rr': if self._criterion == 'rr':
self._thres = [None] * self.n_systems if self._thres is None else \ self._thres = [None] * self.n_systems if self._thres is None else \
...@@ -214,6 +213,18 @@ class Metrics(measure_figure.Metrics): ...@@ -214,6 +213,18 @@ class Metrics(measure_figure.Metrics):
super(Metrics, self).compute(idx, input_scores, input_names) 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): class Hist(measure_figure.Hist):
''' Histograms for biometric scores ''' ''' Histograms for biometric scores '''
......
...@@ -139,6 +139,7 @@ setup( ...@@ -139,6 +139,7 @@ setup(
'bob.bio.cli': [ 'bob.bio.cli': [
'annotate = bob.bio.base.script.annotate:annotate', 'annotate = bob.bio.base.script.annotate:annotate',
'metrics = bob.bio.base.script.commands:metrics', 'metrics = bob.bio.base.script.commands:metrics',
'multi-metrics = bob.bio.base.script.commands:multi_metrics',
'roc = bob.bio.base.script.commands:roc', 'roc = bob.bio.base.script.commands:roc',
'det = bob.bio.base.script.commands:det', 'det = bob.bio.base.script.commands:det',
'epc = bob.bio.base.script.commands:epc', 'epc = bob.bio.base.script.commands:epc',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment