Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
bob.measure
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
bob.measure
Commits
b4e207e4
Commit
b4e207e4
authored
May 01, 2018
by
Theophile GENTILHOMME
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small changes in titles and legends
parent
f2dae89e
Pipeline
#19662
passed with stage
in 30 minutes and 30 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
21 deletions
+21
-21
bob/measure/script/common_options.py
bob/measure/script/common_options.py
+3
-2
bob/measure/script/figure.py
bob/measure/script/figure.py
+18
-19
No files found.
bob/measure/script/common_options.py
View file @
b4e207e4
...
...
@@ -130,7 +130,7 @@ def lines_at_option(**kwargs):
return
list_float_option
(
name
=
'lines-at'
,
short_name
=
'la'
,
desc
=
'If given, draw veritcal lines at the given axis positions'
,
nitems
=
None
,
dflt
=
None
,
**
kwargs
nitems
=
None
,
dflt
=
'1e-3'
,
**
kwargs
)
def
x_rotation_option
(
dflt
=
0
,
**
kwargs
):
...
...
@@ -268,7 +268,8 @@ def criterion_option(lcriteria=['eer', 'hter', 'far'], **kwargs):
ctx
.
meta
[
'criterion'
]
=
value
return
value
return
click
.
option
(
'--criterion'
,
default
=
'eer'
,
help
=
'Criterion to compute plots and '
'-c'
,
'--criterion'
,
default
=
'eer'
,
help
=
'Criterion to compute plots and '
'metrics: `eer` (default), `hter`'
,
callback
=
callback
,
is_eager
=
True
,
**
kwargs
)(
func
)
return
custom_criterion_option
...
...
bob/measure/script/figure.py
View file @
b4e207e4
...
...
@@ -545,10 +545,9 @@ class Hist(PlotBase):
)
self
.
_criterion
=
None
if
'criterion'
not
in
ctx
.
meta
else
\
ctx
.
meta
[
'criterion'
]
self
.
_y_label
=
'Dev. probability density'
if
self
.
_eval
else
\
'density'
or
self
.
_y_label
self
.
_x_label
=
'Scores'
if
not
self
.
_eval
else
''
self
.
_title_base
=
self
.
_title
or
'Scores'
self
.
_title_base
=
'Scores'
self
.
_y_label
=
'Probability Density'
self
.
_x_label
=
'Scores values'
self
.
_end_setup_plot
=
False
def
compute
(
self
,
idx
,
input_scores
,
input_names
):
...
...
@@ -565,14 +564,16 @@ class Hist(PlotBase):
self
.
_setup_hist
(
dev_neg
,
dev_pos
)
mpl
.
title
(
self
.
_get_title
(
idx
,
dev_file
,
eval_file
))
mpl
.
ylabel
(
self
.
_y_label
)
mpl
.
xlabel
(
self
.
_x_label
)
if
not
self
.
_eval
:
mpl
.
xlabel
(
self
.
_x_label
)
if
eval_neg
is
not
None
and
self
.
_show_dev
:
ax
=
mpl
.
gca
()
ax
.
axes
.
get_xaxis
().
set_ticklabels
([])
#Setup lines, corresponding axis and legends
self
.
_lines
(
threshold
,
dev_neg
,
dev_pos
)
if
self
.
_eval
:
self
.
_plot_legends
()
label
=
"%s threshold"
%
(
''
if
self
.
_criterion
is
None
else
self
.
_criterion
.
upper
())
self
.
_lines
(
threshold
,
label
,
dev_neg
,
dev_pos
)
self
.
_plot_legends
()
if
eval_neg
is
not
None
:
if
self
.
_show_dev
:
...
...
@@ -582,10 +583,12 @@ class Hist(PlotBase):
)
if
not
self
.
_show_dev
:
mpl
.
title
(
self
.
_get_title
(
idx
,
dev_file
,
eval_file
))
mpl
.
ylabel
(
'
Eval. p
robability density'
)
mpl
.
ylabel
(
'
P
robability density'
)
mpl
.
xlabel
(
self
.
_x_label
)
#Setup lines, corresponding axis and legends
self
.
_lines
(
threshold
,
eval_neg
,
eval_pos
)
label
=
"%s threshold (dev)"
%
(
''
if
self
.
_criterion
is
None
else
self
.
_criterion
.
upper
())
self
.
_lines
(
threshold
,
label
,
eval_neg
,
eval_pos
)
if
not
self
.
_show_dev
:
self
.
_plot_legends
()
...
...
@@ -593,13 +596,9 @@ class Hist(PlotBase):
def
_get_title
(
self
,
idx
,
dev_file
,
eval_file
):
title
=
self
.
_legends
[
idx
]
if
self
.
_legends
is
not
None
else
None
if
title
is
None
:
title
=
self
.
_title_base
if
not
self
.
_print_fn
else
\
(
'%s
\
n
(%s)'
%
(
self
.
_title_base
,
str
(
dev_file
)
+
(
" / %s"
%
str
(
eval_file
)
if
self
.
_eval
else
""
)
))
return
title
title
=
title
or
self
.
_title
or
self
.
_title_base
title
=
''
if
self
.
_title
is
not
None
and
not
self
.
_title
.
replace
(
' '
,
''
)
else
title
return
title
or
''
def
_plot_legends
(
self
):
lines
=
[]
...
...
@@ -641,8 +640,8 @@ class Hist(PlotBase):
)
return
(
n
,
bins
,
patches
)
def
_lines
(
self
,
threshold
,
neg
=
None
,
pos
=
None
,
**
kwargs
):
label
=
'Threshold'
if
self
.
_criterion
is
None
else
self
.
_criterion
.
upper
()
def
_lines
(
self
,
threshold
,
label
=
None
,
neg
=
None
,
pos
=
None
,
**
kwargs
):
label
=
label
or
'Threshold'
kwargs
.
setdefault
(
'color'
,
'C3'
)
kwargs
.
setdefault
(
'linestyle'
,
'--'
)
kwargs
.
setdefault
(
'label'
,
label
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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