Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pad.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.pad.base
Commits
73cad14e
There was a problem fetching the pipeline summary.
Commit
73cad14e
authored
6 years ago
by
Theophile GENTILHOMME
Browse files
Options
Downloads
Patches
Plain Diff
Add tests and improve epsc command
parent
45fb416d
No related branches found
No related tags found
1 merge request
!48
Various fix
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/pad/base/script/vuln_figure.py
+22
-9
22 additions, 9 deletions
bob/pad/base/script/vuln_figure.py
bob/pad/base/test/test_commands.py
+12
-0
12 additions, 0 deletions
bob/pad/base/test/test_commands.py
with
34 additions
and
9 deletions
bob/pad/base/script/vuln_figure.py
+
22
−
9
View file @
73cad14e
...
...
@@ -238,10 +238,15 @@ class Epsc(VulnPlot):
spoof_dev_pos
=
input_scores
[
2
][
1
]
spoof_eval_neg
=
input_scores
[
3
][
0
]
spoof_eval_pos
=
input_scores
[
3
][
1
]
mpl
.
gcf
().
clear
()
merge_sys
=
(
self
.
_fixed_params
is
None
or
len
(
self
.
_fixed_params
)
==
1
)
and
self
.
n_systems
>
1
if
not
merge_sys
:
mpl
.
gcf
().
clear
()
points
=
10
for
pi
,
fp
in
enumerate
(
self
.
_fixed_params
):
if
merge_sys
:
assert
pi
==
0
pi
=
idx
if
self
.
_var_param
==
'
omega
'
:
omega
,
beta
,
thrs
=
error_utils
.
epsc_thresholds
(
licit_dev_neg
,
...
...
@@ -268,23 +273,28 @@ class Epsc(VulnPlot):
)
# error rates are returned in a list in the
# following order: frr, far, IAPMR, far_w, wer_w
# between the negatives (impostors and Presentation attacks)
if
self
.
_wer
:
if
self
.
_var_param
==
'
omega
'
:
label
=
r
"
WER$_{\omega,\beta=%.1f}$
"
%
fp
if
not
merge_sys
\
else
r
"
WER%s$_{\omega,\beta}$
"
%
str
(
idx
+
1
)
mpl
.
plot
(
omega
,
100.
*
errors
[
4
].
flatten
(),
color
=
self
.
_colors
[
pi
],
linestyle
=
'
-
'
,
label
=
r
"
WER$_{\omega,\beta}$
"
)
label
=
label
)
mpl
.
xlabel
(
self
.
_x_label
or
r
"
Weight $\omega$
"
)
else
:
label
=
r
"
WER$_{\omega=%.1f,\beta}$
"
%
fp
if
not
merge_sys
\
else
r
"
WER%s$_{\omega,\beta}$
"
%
str
(
idx
+
1
)
mpl
.
plot
(
beta
,
100.
*
errors
[
4
].
flatten
(),
color
=
self
.
_colors
[
pi
],
linestyle
=
'
-
'
,
label
=
r
"
WER$_{\omega,\beta}$
"
)
label
=
label
)
mpl
.
xlabel
(
self
.
_x_label
or
r
"
Weight $\beta$
"
)
mpl
.
ylabel
(
self
.
_y_label
or
r
"
WER$_{\omega,\beta}$ (%)
"
)
...
...
@@ -293,21 +303,22 @@ class Epsc(VulnPlot):
if
self
.
_wer
:
axis
=
mpl
.
twinx
()
axis
.
grid
(
False
)
iapmr_color
=
'
C3
'
if
not
merge_sys
else
self
.
_colors
[
idx
]
if
self
.
_var_param
==
'
omega
'
:
mpl
.
plot
(
omega
,
100.
*
errors
[
2
].
flatten
(),
color
=
'
C3
'
,
color
=
iapmr_color
,
linestyle
=
'
--
'
,
label
=
'
IAPMR
'
)
label
=
'
IAPMR
%d
'
%
(
idx
+
1
)
)
mpl
.
xlabel
(
self
.
_x_label
or
r
"
Weight $\omega$
"
)
else
:
mpl
.
plot
(
beta
,
100.
*
errors
[
2
].
flatten
(),
color
=
'
C3
'
,
color
=
iapmr_color
,
linestyle
=
'
--
'
,
label
=
'
IAPMR
'
)
label
=
'
IAPMR
%d
'
%
(
idx
+
1
)
)
mpl
.
xlabel
(
self
.
_x_label
or
r
"
Weight $\beta$
"
)
mpl
.
ylabel
(
self
.
_y_label
or
r
"
IAPMR (%)
"
)
if
self
.
_wer
:
...
...
@@ -330,7 +341,9 @@ class Epsc(VulnPlot):
ax
.
set_xticklabels
(
ax
.
get_xticks
())
ax
.
set_yticklabels
(
ax
.
get_yticks
())
mpl
.
xticks
(
rotation
=
self
.
_x_rotation
)
self
.
_pdf_page
.
savefig
()
if
self
.
_fixed_params
is
None
or
len
(
self
.
_fixed_params
)
>
1
or
\
idx
==
self
.
n_systems
-
1
:
self
.
_pdf_page
.
savefig
()
class
Epsc3D
(
Epsc
):
...
...
This diff is collapsed.
Click to expand it.
bob/pad/base/test/test_commands.py
+
12
−
0
View file @
73cad14e
...
...
@@ -173,10 +173,22 @@ def test_epsc_vuln():
result
=
runner
.
invoke
(
vuln_commands
.
epsc
,
[
'
--output
'
,
'
epsc.pdf
'
,
'
-I
'
,
'
-fp
'
,
'
0.1,0.3
'
,
licit_dev
,
licit_test
,
spoof_dev
,
spoof_test
])
assert
result
.
exit_code
==
0
,
(
result
.
exit_code
,
result
.
output
)
def
test_epsc_3D_vuln
():
licit_dev
=
pkg_resources
.
resource_filename
(
'
bob.pad.base.test
'
,
'
data/licit/scores-dev
'
)
licit_test
=
pkg_resources
.
resource_filename
(
'
bob.pad.base.test
'
,
'
data/licit/scores-eval
'
)
spoof_dev
=
pkg_resources
.
resource_filename
(
'
bob.pad.base.test
'
,
'
data/spoof/scores-dev
'
)
spoof_test
=
pkg_resources
.
resource_filename
(
'
bob.pad.base.test
'
,
'
data/spoof/scores-eval
'
)
runner
=
CliRunner
()
with
runner
.
isolated_filesystem
():
result
=
runner
.
invoke
(
vuln_commands
.
epsc
,
[
'
--output
'
,
'
epsc.pdf
'
,
'
-D
'
,
licit_dev
,
licit_test
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment