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.pad.base
Commits
8018f199
Commit
8018f199
authored
Jun 28, 2018
by
Theophile GENTILHOMME
Browse files
[pad_figure] Change in metrics
parent
af9c7f7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/pad/base/script/pad_figure.py
View file @
8018f199
...
...
@@ -7,13 +7,15 @@ from .error_utils import calc_threshold
ALL_CRITERIA
=
(
'bpcer20'
,
'eer'
,
'min-hter'
)
class
Metrics
(
measure
_figure
.
Metrics
):
class
Metrics
(
bio
_figure
.
Metrics
):
'''Compute metrics from score files'''
def
__init__
(
self
,
ctx
,
scores
,
evaluation
,
func_load
):
def
__init__
(
self
,
ctx
,
scores
,
evaluation
,
func_load
,
names
=
(
'FtA'
,
'APCER'
,
'BPCER'
,
'FAR'
,
'FRR'
,
'ACER=(APCER + '
'BPCER) / 2'
)):
super
(
Metrics
,
self
).
__init__
(
ctx
,
scores
,
evaluation
,
func_load
,
names
=
(
'FtA'
,
'APCER'
,
'BPCER'
,
'FAR'
,
'FRR'
,
'ACER'
)
)
ctx
,
scores
,
evaluation
,
func_load
,
names
)
def
get_thres
(
self
,
criterion
,
dev_neg
,
dev_pos
,
far
):
if
self
.
_criterion
==
'bpcer20'
:
...
...
@@ -23,22 +25,6 @@ class Metrics(measure_figure.Metrics):
criterion
,
dev_neg
,
dev_pos
,
far
)
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
=
(
'FtA'
,
'APCER'
,
'BPCER'
,
'FAR'
,
'FRR'
,
'ACER'
))
def
get_thres
(
self
,
criterion
,
dev_neg
,
dev_pos
,
far
):
if
self
.
_criterion
==
'bpcer20'
:
return
calc_threshold
(
'bpcer20'
,
dev_neg
,
dev_pos
)
else
:
return
super
(
MultiMetrics
,
self
).
get_thres
(
criterion
,
dev_neg
,
dev_pos
,
far
)
class
Roc
(
bio_figure
.
Roc
):
'''ROC for PAD'''
...
...
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