Skip to content
Snippets Groups Projects
Commit 34ae249a authored by Theophile GENTILHOMME's avatar Theophile GENTILHOMME
Browse files

Fix evaluate so that all metrics are written in the same log file. Add cmc option

parent 44c25df8
No related branches found
No related tags found
2 merge requests!54Refactors the score loading and scripts functionality,!52generic plotting script for bob measure
Pipeline #
...@@ -191,7 +191,7 @@ def evaluate(ctx, scores, test, **kwargs): ...@@ -191,7 +191,7 @@ def evaluate(ctx, scores, test, **kwargs):
test-score set is provided test-score set is provided
3. Reports error rates on the console 3. Reports error rates on the console
4. Plots ROC, EPC, DET curves and score distributions to a multi-page PDF 4. Plots ROC, EPC, DET curves and score distributions to a multi-page PDF
file (unless --no-plot is passed) file
You need to provide 2 score files for each biometric system in this order: You need to provide 2 score files for each biometric system in this order:
...@@ -206,10 +206,12 @@ def evaluate(ctx, scores, test, **kwargs): ...@@ -206,10 +206,12 @@ def evaluate(ctx, scores, test, **kwargs):
$ bob measure evaluate -t -l metrics.txt -o my_plots.pdf dev-scores test-scores $ bob measure evaluate -t -l metrics.txt -o my_plots.pdf dev-scores test-scores
''' '''
# first time erase if existing file # first time erase if existing file
ctx.meta['open_mode'] = 'w'
click.echo("Computing metrics with EER...") click.echo("Computing metrics with EER...")
ctx.meta['criter'] = 'eer' # no criterion passed to evaluate ctx.meta['criter'] = 'eer' # no criterion passed to evaluate
ctx.invoke(metrics, scores=scores, test=test) ctx.invoke(metrics, scores=scores, test=test)
# second time, appends the content # second time, appends the content
ctx.meta['open_mode'] = 'a'
click.echo("Computing metrics with HTER...") click.echo("Computing metrics with HTER...")
ctx.meta['criter'] = 'hter' # no criterion passed in evaluate ctx.meta['criter'] = 'hter' # no criterion passed in evaluate
ctx.invoke(metrics, scores=scores, test=test) ctx.invoke(metrics, scores=scores, test=test)
......
...@@ -62,6 +62,19 @@ def test_option(**kwargs): ...@@ -62,6 +62,19 @@ def test_option(**kwargs):
callback=callback, is_eager=True , **kwargs)(func) callback=callback, is_eager=True , **kwargs)(func)
return custom_test_option return custom_test_option
def cmc_option(dflt=False, **kwargs):
'''Get option flag to say if cmc scores'''
def custom_cmc_option(func):
def callback(ctx, param, value):
ctx.meta['cmc'] = value
return value
return click.option(
'-C', '--cmc/--no-cmc', default=dflt,
help='If set, CMC score files are provided',
show_default=True,
callback=callback, is_eager=True , **kwargs)(func)
return custom_cmc_option
def sep_dev_test_option(**kwargs): def sep_dev_test_option(**kwargs):
'''Get option flag to say if dev and test plots should be in different '''Get option flag to say if dev and test plots should be in different
plots''' plots'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment