Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.measure
Commits
4bb2749d
Commit
4bb2749d
authored
Jun 26, 2018
by
Theophile GENTILHOMME
Browse files
[script][common_options,figure,test_script] Change legends options to
titles for histograms.
parent
b4174c2c
Pipeline
#21346
passed with stage
in 8 minutes and 46 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/measure/script/common_options.py
View file @
4bb2749d
...
...
@@ -491,7 +491,7 @@ def legends_option(**kwargs):
return
value
return
click
.
option
(
'-lg'
,
'--legends'
,
type
=
click
.
STRING
,
default
=
None
,
help
=
'The
title
for each system comma separated. '
help
=
'The
legend
for each system comma separated. '
'Example: --legends ISV,CNN'
,
callback
=
callback
,
**
kwargs
)(
func
)
return
custom_legends_option
...
...
@@ -779,7 +779,7 @@ def hist_command(docstring):
@
eval_option
()
@
hide_dev_option
()
@
n_bins_option
()
@
legend
s_option
()
@
title
s_option
()
@
no_legend_option
()
@
legend_ncols_option
()
@
criterion_option
()
...
...
bob/measure/script/figure.py
View file @
4bb2749d
...
...
@@ -680,11 +680,13 @@ class Hist(PlotBase):
self
.
_y_label
=
'Probability density'
self
.
_x_label
=
'Score values'
self
.
_end_setup_plot
=
False
if
self
.
_legends
is
not
None
and
len
(
self
.
_legends
)
==
self
.
n_systems
\
# overide _titles of PlotBase
self
.
_titles
=
ctx
.
meta
.
get
(
'titles'
)
if
self
.
_titles
is
not
None
and
len
(
self
.
_titles
)
==
self
.
n_systems
\
and
not
self
.
_hide_dev
:
# use same legend for dev and eval if needed
self
.
_
legend
s
=
[
x
for
pair
in
zip
(
self
.
_
legend
s
,
self
.
_
legend
s
)
for
x
in
pair
]
self
.
_
title
s
=
[
x
for
pair
in
zip
(
self
.
_
title
s
,
self
.
_
title
s
)
for
x
in
pair
]
def
compute
(
self
,
idx
,
input_scores
,
input_names
):
''' Draw histograms of negative and positive scores.'''
...
...
@@ -740,8 +742,8 @@ class Hist(PlotBase):
def
_get_title
(
self
,
idx
,
dflt
=
None
):
''' Get the histo title for the given idx'''
title
=
self
.
_
legend
s
[
idx
]
if
self
.
_
legend
s
is
not
None
\
and
idx
<
len
(
self
.
_
legend
s
)
else
dflt
title
=
self
.
_
title
s
[
idx
]
if
self
.
_
title
s
is
not
None
\
and
idx
<
len
(
self
.
_
title
s
)
else
dflt
title
=
title
or
self
.
_title_base
title
=
''
if
title
is
not
None
and
not
title
.
replace
(
' '
,
''
)
else
title
...
...
bob/measure/test_script.py
View file @
4bb2749d
...
...
@@ -144,7 +144,7 @@ def test_hist():
with
runner
.
isolated_filesystem
():
result
=
runner
.
invoke
(
commands
.
hist
,
[
'-e'
,
'--criterion'
,
'eer'
,
'--output'
,
'HISTO.pdf'
,
'-b'
,
'30,20'
,
'-sp'
,
221
,
'-
lg
'
,
'A,B'
,
'-sp'
,
221
,
'-
ts
'
,
'A,B'
,
dev1
,
test1
,
dev2
,
test2
])
if
result
.
output
:
click
.
echo
(
result
.
output
)
...
...
@@ -159,7 +159,7 @@ def test_hist_legends():
# share same legend for dev/eval of each system
with
runner
.
isolated_filesystem
():
result
=
runner
.
invoke
(
commands
.
hist
,
[
'-e'
,
'-sp'
,
221
,
'-
lg
'
,
'A,B'
,
result
=
runner
.
invoke
(
commands
.
hist
,
[
'-e'
,
'-sp'
,
221
,
'-
ts
'
,
'A,B'
,
dev1
,
test1
,
dev2
,
test2
])
if
result
.
output
:
click
.
echo
(
result
.
output
)
...
...
@@ -167,7 +167,7 @@ def test_hist_legends():
# individual legends for dev and eval
with
runner
.
isolated_filesystem
():
result
=
runner
.
invoke
(
commands
.
hist
,
[
'-e'
,
'-sp'
,
221
,
'-
lg
'
,
result
=
runner
.
invoke
(
commands
.
hist
,
[
'-e'
,
'-sp'
,
221
,
'-
ts
'
,
'A,B,C,D'
,
dev1
,
test1
,
dev2
,
test2
])
if
result
.
output
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment