diff --git a/bob/bio/base/script/commands.py b/bob/bio/base/script/commands.py index 78bb24500f7ee3ee205699c960ea55f869715d34..8416b3f2081891081607d7b3ee1d76569b97b39a 100644 --- a/bob/bio/base/script/commands.py +++ b/bob/bio/base/script/commands.py @@ -69,7 +69,7 @@ def metrics(ctx, scores, evaluation, **kargs): @click.command() @common_options.scores_argument(nargs=-1) -@common_options.title_option() +@common_options.titles_option() @common_options.legends_option() @common_options.legend_loc_option(dflt=None) @common_options.no_legend_option() @@ -117,7 +117,7 @@ def roc(ctx, scores, evaluation, **kargs): @click.command() @common_options.scores_argument(nargs=-1) -@common_options.title_option() +@common_options.titles_option() @common_options.output_plot_file_option(default_out='det.pdf') @common_options.legends_option() @common_options.legend_loc_option(dflt='upper-right') @@ -163,7 +163,7 @@ def det(ctx, scores, evaluation, **kargs): @click.command() @common_options.scores_argument(min_arg=1, force_eval=True, nargs=-1) -@common_options.title_option() +@common_options.titles_option() @common_options.output_plot_file_option(default_out='epc.pdf') @common_options.legends_option() @common_options.legend_loc_option(dflt='upper-center') @@ -197,7 +197,7 @@ def epc(ctx, scores, **kargs): @click.command() @common_options.scores_argument(nargs=-1) -@common_options.title_option() +@common_options.titles_option() @common_options.legends_option() @common_options.sep_dev_eval_option() @common_options.output_plot_file_option(default_out='cmc.pdf') @@ -240,7 +240,7 @@ def cmc(ctx, scores, evaluation, **kargs): @click.command() @common_options.scores_argument(nargs=-1) -@common_options.title_option() +@common_options.titles_option() @common_options.legends_option() @common_options.sep_dev_eval_option() @common_options.output_plot_file_option(default_out='dir.pdf') @@ -293,7 +293,6 @@ def dir(ctx, scores, evaluation, **kargs): @click.command() @common_options.scores_argument(nargs=-1) -@common_options.title_option() @common_options.output_plot_file_option(default_out='hist.pdf') @common_options.eval_option() @common_options.n_bins_option() diff --git a/bob/bio/base/script/figure.py b/bob/bio/base/script/figure.py index a39aa7e703273b7cf196febccbb446c4773db4d8..faf51b3bbdbcbb0e0e7250a77a72e8a89aaa85d0 100644 --- a/bob/bio/base/script/figure.py +++ b/bob/bio/base/script/figure.py @@ -31,7 +31,7 @@ class Cmc(measure_figure.PlotBase): def __init__(self, ctx, scores, evaluation, func_load): super(Cmc, self).__init__(ctx, scores, evaluation, func_load) self._semilogx = ctx.meta.get('semilogx', True) - self._title = self._title or 'CMC' + self._titles = self._titles or ['CMC dev', 'CMC eval'] self._x_label = self._x_label or 'Rank' self._y_label = self._y_label or 'Identification rate' self._max_R = 0 @@ -45,7 +45,7 @@ class Cmc(measure_figure.PlotBase): rank = plot.cmc( input_scores[0], logx=self._semilogx, color=self._colors[idx], linestyle=linestyle, - label=self._label('development', input_names[0], idx) + label=self._label('dev', input_names[0], idx) ) self._max_R = max(rank, self._max_R) linestyle = '--' @@ -63,7 +63,7 @@ class Cmc(measure_figure.PlotBase): rank = plot.cmc( input_scores[0], logx=self._semilogx, color=self._colors[idx], linestyle=self._linestyles[idx], - label=self._label('development', input_names[0], idx) + label=self._label('dev', input_names[0], idx) ) self._max_R = max(rank, self._max_R) @@ -75,7 +75,7 @@ class Dir(measure_figure.PlotBase): super(Dir, self).__init__(ctx, scores, evaluation, func_load) self._semilogx = ctx.meta.get('semilogx', True) self._rank = ctx.meta.get('rank', 1) - self._title = self._title or 'DIR curve' + self._titles = self._titles or ['DIR curve'] * 2 self._x_label = self._x_label or 'False Alarm Rate' self._y_label = self._y_label or 'Detection and Identification Rate' @@ -88,7 +88,7 @@ class Dir(measure_figure.PlotBase): plot.detection_identification_curve( input_scores[0], rank=self._rank, logx=self._semilogx, color=self._colors[idx], linestyle=linestyle, - label=self._label('development', input_names[0], idx) + label=self._label('dev', input_names[0], idx) ) linestyle = '--' if self._split: @@ -104,7 +104,7 @@ class Dir(measure_figure.PlotBase): plot.detection_identification_curve( input_scores[0], rank=self._rank, logx=self._semilogx, color=self._colors[idx], linestyle=self._linestyles[idx], - label=self._label('development', input_names[0], idx) + label=self._label('dev', input_names[0], idx) ) if self._min_dig is not None: diff --git a/bob/bio/base/test/test_commands.py b/bob/bio/base/test/test_commands.py index 7ed0a6a6faadf3ab59a9537738ebb2f636a9783d..e705e7fee0f780698b445829d87e14186c90d943 100644 --- a/bob/bio/base/test/test_commands.py +++ b/bob/bio/base/test/test_commands.py @@ -272,6 +272,7 @@ def test_cmc(): with runner.isolated_filesystem(): result = runner.invoke(commands.cmc, ['--output', 'test.pdf', '--legends', 'A,B', '-S', + '-ts', 'TA,TB', dev1, test1, dev1, test1]) if result.output: click.echo(result.output)