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.bio.base
Commits
7e80a446
Commit
7e80a446
authored
Jun 27, 2018
by
Amir MOHAMMADI
Browse files
Add a command for multi protocol (N-fold cross validation) analysis
parent
a55d9111
Pipeline
#21359
passed with stage
in 13 minutes and 37 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/base/script/commands.py
View file @
7e80a446
...
...
@@ -84,6 +84,19 @@ def evaluate(ctx, scores, evaluation, **kwargs):
ctx
,
scores
,
evaluation
,
metrics
,
roc
,
det
,
epc
,
hist
,
**
kwargs
)
@
common_options
.
multi_metrics_command
(
common_options
.
MULTI_METRICS_HELP
.
format
(
names
=
'FtA, FAR, FRR, FMR, FMNR, HTER'
,
criteria
=
CRITERIA
,
score_format
=
SCORE_FORMAT
,
command
=
'bob pad multi-metrics'
),
criteria
=
CRITERIA
)
def
multi_metrics
(
ctx
,
scores
,
evaluation
,
protocols_number
,
**
kwargs
):
ctx
.
meta
[
'min_arg'
]
=
protocols_number
*
(
2
if
evaluation
else
1
)
process
=
bio_figure
.
MultiMetrics
(
ctx
,
scores
,
evaluation
,
load
.
split
)
process
.
run
()
@
click
.
command
()
@
common_options
.
scores_argument
(
nargs
=-
1
)
@
common_options
.
titles_option
()
...
...
bob/bio/base/script/figure.py
View file @
7e80a446
...
...
@@ -114,7 +114,6 @@ class Dir(measure_figure.PlotBase):
class
Metrics
(
measure_figure
.
Metrics
):
''' Compute metrics from score files'''
def
init_process
(
self
):
if
self
.
_criterion
==
'rr'
:
self
.
_thres
=
[
None
]
*
self
.
n_systems
if
self
.
_thres
is
None
else
\
...
...
@@ -214,6 +213,18 @@ class Metrics(measure_figure.Metrics):
super
(
Metrics
,
self
).
compute
(
idx
,
input_scores
,
input_names
)
class
MultiMetrics
(
measure_figure
.
MultiMetrics
):
'''Compute metrics from score files'''
def
__init__
(
self
,
ctx
,
scores
,
evaluation
,
func_load
):
super
(
MultiMetrics
,
self
).
__init__
(
ctx
,
scores
,
evaluation
,
func_load
,
names
=
(
'Failure to Acquire'
,
'False Match Rate'
,
'False Non Match Rate'
,
'False Accept Rate'
,
'False Reject Rate'
,
'Half Total Error Rate'
))
class
Hist
(
measure_figure
.
Hist
):
''' Histograms for biometric scores '''
...
...
setup.py
View file @
7e80a446
...
...
@@ -139,6 +139,7 @@ setup(
'bob.bio.cli'
:
[
'annotate = bob.bio.base.script.annotate:annotate'
,
'metrics = bob.bio.base.script.commands:metrics'
,
'multi-metrics = bob.bio.base.script.commands:multi_metrics'
,
'roc = bob.bio.base.script.commands:roc'
,
'det = bob.bio.base.script.commands:det'
,
'epc = bob.bio.base.script.commands:epc'
,
...
...
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