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
1
Merge Requests
1
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
a9333025
Commit
a9333025
authored
Apr 29, 2019
by
Amir MOHAMMADI
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'click-scripts-fixes' into 'master'
Click scripts fixes See merge request
!93
parents
ef682da1
628a4892
Pipeline
#29680
passed with stages
in 20 minutes and 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
bob/measure/script/common_options.py
bob/measure/script/common_options.py
+11
-11
bob/measure/utils.py
bob/measure/utils.py
+5
-4
No files found.
bob/measure/script/common_options.py
View file @
a9333025
...
...
@@ -592,11 +592,11 @@ def style_option(**kwargs):
def
metrics_command
(
docstring
,
criteria
=
(
'eer'
,
'min-hter'
,
'far'
),
far_name
=
"FAR"
):
far_name
=
"FAR"
,
**
kwarg
):
def
custom_metrics_command
(
func
):
func
.
__doc__
=
docstring
@
click
.
command
()
@
click
.
command
(
**
kwarg
)
@
scores_argument
(
nargs
=-
1
)
@
eval_option
()
@
table_option
()
...
...
@@ -922,7 +922,7 @@ def evaluate_flow(ctx, scores, evaluation, metrics, roc, det, epc, hist,
if
criterion
is
not
None
:
click
.
echo
(
"Computing metrics with %s..."
%
criterion
)
ctx
.
invoke
(
metrics
,
scores
=
scores
,
evaluation
=
evaluation
)
if
'log'
in
ctx
.
meta
:
if
ctx
.
meta
.
get
(
'log'
)
is
not
None
:
click
.
echo
(
"[metrics] => %s"
%
ctx
.
meta
[
'log'
])
# avoid closing pdf file before all figures are plotted
...
...
@@ -964,11 +964,11 @@ def n_protocols_option(required=True, **kwargs):
def
multi_metrics_command
(
docstring
,
criteria
=
(
'eer'
,
'min-hter'
,
'far'
),
far_name
=
"FAR"
):
far_name
=
"FAR"
,
**
kwargs
):
def
custom_metrics_command
(
func
):
func
.
__doc__
=
docstring
@
click
.
command
(
'multi-metrics'
)
@
click
.
command
(
'multi-metrics'
,
**
kwargs
)
@
scores_argument
(
nargs
=-
1
)
@
eval_option
()
@
n_protocols_option
()
...
...
@@ -991,9 +991,9 @@ def multi_metrics_command(docstring, criteria=('eer', 'min-hter', 'far'),
MULTI_METRICS_HELP
=
"""Multi protocol (cross-validation) metrics.
Prints a table that contains
{names} for a given threshold criterio
n
({criteria}). The metrics are averaged over several protocols. The idea is
that each protocol corresponds to one fold in your cross-validation.
Prints a table that contains
mean and standard deviation of {names} for a give
n
threshold criterion ({criteria}). The metrics are averaged over several protocols.
The idea is
that each protocol corresponds to one fold in your cross-validation.
You need to provide as many as development score files as the number of
protocols per system. You can also provide evaluation files along with dev
...
...
@@ -1006,9 +1006,9 @@ MULTI_METRICS_HELP = """Multi protocol (cross-validation) metrics.
Examples:
$ {command} -v {{p1,p2,p3}}/scores-dev
$ {command} -v
v -pn 3
{{p1,p2,p3}}/scores-dev
$ {command} -v -e {{p1,p2,p3}}/scores-{{dev,eval}}
$ {command} -v
v -pn 3
-e {{p1,p2,p3}}/scores-{{dev,eval}}
$ {command} -v -e {{sys1,sys2}}/{{p1,p2,p3}}/scores-{{dev,eval}}
$ {command} -v
v -pn 3
-e {{sys1,sys2}}/{{p1,p2,p3}}/scores-{{dev,eval}}
"""
bob/measure/utils.py
View file @
a9333025
...
...
@@ -2,7 +2,9 @@
import
numpy
import
scipy.stats
import
bob.core
import
logging
LOGGER
=
logging
.
getLogger
(
__name__
)
def
remove_nan
(
scores
):
...
...
@@ -25,9 +27,8 @@ def remove_nan(scores):
sum_nans
=
sum
(
nans
)
total
=
len
(
scores
)
if
sum_nans
>
0
:
logger
=
bob
.
core
.
log
.
setup
(
"bob.measure"
)
logger
.
warning
(
'Found {} NaNs in {} scores'
.
format
(
sum_nans
,
total
))
return
scores
[
numpy
.
where
(
~
nans
)],
sum_nans
,
total
LOGGER
.
warning
(
'Found {} NaNs in {} scores'
.
format
(
sum_nans
,
total
))
return
scores
[
~
nans
],
sum_nans
,
total
def
get_fta
(
scores
):
...
...
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