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
960feb2e
Commit
960feb2e
authored
Jul 03, 2018
by
Amir MOHAMMADI
Browse files
Small fixes
parent
63d3eae5
Pipeline
#21542
passed with stage
in 28 minutes and 42 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/pad/base/script/pad_commands.py
View file @
960feb2e
...
...
@@ -37,8 +37,8 @@ def gen(ctx, outdir, mean_match, mean_non_match, n_sys):
@
common_options
.
metrics_command
(
common_options
.
METRICS_HELP
.
format
(
names
=
'FtA, APCER, BPCER, FAR, FRR, ACER'
,
criteria
=
CRITERIA
,
score_format
=
SCORE_FORMAT
,
hter_note
=
'Note that FAR = APCER * (1 - FtA),
FRR = FtA + BPCER * (1 - FtA)
'
'
and ACER = (FMR + FMN
R) / 2.'
,
hter_note
=
'Note that FAR = APCER * (1 - FtA), '
'
FRR = FtA + BPCER * (1 - FtA) and ACER = (APCER + BPCE
R) / 2.'
,
command
=
'bob pad metrics'
),
criteria
=
CRITERIA
)
def
metrics
(
ctx
,
scores
,
evaluation
,
**
kwargs
):
process
=
figure
.
Metrics
(
ctx
,
scores
,
evaluation
,
load
.
split
)
...
...
bob/pad/base/script/vuln_commands.py
View file @
960feb2e
...
...
@@ -71,9 +71,9 @@ def write_scores_to_file(neg, pos, filename, attack=False):
@
click
.
command
()
@
click
.
argument
(
'outdir'
)
@
click
.
option
(
'--mean-gen'
,
default
=
7
,
type
=
FLOAT
,
show_default
=
True
)
@
click
.
option
(
'--mean-zei'
,
default
=
3
,
type
=
FLOAT
,
show_default
=
True
)
@
click
.
option
(
'--mean-pa'
,
default
=
5
,
type
=
FLOAT
,
show_default
=
True
)
@
click
.
option
(
'-mg'
,
'--mean-gen'
,
default
=
7
,
type
=
FLOAT
,
show_default
=
True
)
@
click
.
option
(
'-mz'
,
'--mean-zei'
,
default
=
3
,
type
=
FLOAT
,
show_default
=
True
)
@
click
.
option
(
'-mp'
,
'--mean-pa'
,
default
=
5
,
type
=
FLOAT
,
show_default
=
True
)
@
verbosity_option
()
def
gen
(
outdir
,
mean_gen
,
mean_zei
,
mean_pa
):
"""Generate random scores.
...
...
@@ -104,7 +104,7 @@ def gen(outdir, mean_gen, mean_zei, mean_pa):
@
click
.
command
()
@
common_options
.
scores_argument
(
min_arg
=
2
,
nargs
=-
1
)
@
common_options
.
output_plot_file_option
(
default_out
=
'
vuln_
roc.pdf'
)
@
common_options
.
output_plot_file_option
(
default_out
=
'roc.pdf'
)
@
common_options
.
legends_option
()
@
common_options
.
no_legend_option
()
@
common_options
.
legend_loc_option
(
dflt
=
'upper-right'
)
...
...
@@ -144,7 +144,7 @@ def roc(ctx, scores, real_data, **kwargs):
@
click
.
command
()
@
common_options
.
scores_argument
(
min_arg
=
2
,
nargs
=-
1
)
@
common_options
.
output_plot_file_option
(
default_out
=
'
vuln_
det.pdf'
)
@
common_options
.
output_plot_file_option
(
default_out
=
'det.pdf'
)
@
common_options
.
legends_option
()
@
common_options
.
no_legend_option
()
@
common_options
.
legend_loc_option
(
dflt
=
'upper-right'
)
...
...
@@ -184,7 +184,7 @@ def det(ctx, scores, real_data, **kwargs):
@
click
.
command
()
@
common_options
.
scores_argument
(
min_arg
=
2
,
force_eval
=
True
,
nargs
=-
1
)
@
common_options
.
output_plot_file_option
(
default_out
=
'
vuln_
epc.pdf'
)
@
common_options
.
output_plot_file_option
(
default_out
=
'epc.pdf'
)
@
common_options
.
legends_option
()
@
common_options
.
no_legend_option
()
@
common_options
.
legend_loc_option
()
...
...
@@ -228,7 +228,7 @@ def epc(ctx, scores, **kwargs):
@
click
.
command
()
@
common_options
.
scores_argument
(
min_arg
=
2
,
force_eval
=
True
,
nargs
=-
1
)
@
common_options
.
output_plot_file_option
(
default_out
=
'
vuln_
epsc.pdf'
)
@
common_options
.
output_plot_file_option
(
default_out
=
'epsc.pdf'
)
@
common_options
.
titles_option
()
@
common_options
.
no_legend_option
()
@
common_options
.
legend_loc_option
()
...
...
@@ -301,7 +301,7 @@ def epsc(ctx, scores, criteria, var_param, three_d, sampling,
@
click
.
command
()
@
common_options
.
scores_argument
(
nargs
=-
1
,
min_arg
=
2
)
@
common_options
.
output_plot_file_option
(
default_out
=
'
vuln_
hist.pdf'
)
@
common_options
.
output_plot_file_option
(
default_out
=
'hist.pdf'
)
@
common_options
.
n_bins_option
()
@
common_options
.
criterion_option
()
@
common_options
.
thresholds_option
()
...
...
@@ -347,6 +347,8 @@ def hist(ctx, scores, evaluation, **kwargs):
Examples:
$ bob vuln hist -v licit/scores-dev spoof/scores-dev
$ bob vuln hist -e -v licit/scores-dev licit/scores-eval
\
spoof/scores-dev spoof/scores-eval
...
...
bob/pad/base/script/vuln_figure.py
View file @
960feb2e
...
...
@@ -239,12 +239,12 @@ class Epsc(VulnPlot):
spoof_dev_pos
=
input_scores
[
2
][
1
]
spoof_eval_neg
=
input_scores
[
3
][
0
]
spoof_eval_pos
=
input_scores
[
3
][
1
]
merge_sys
=
(
self
.
_fixed_params
is
None
or
len
(
self
.
_fixed_params
)
==
1
)
and
self
.
n_systems
>
1
merge_sys
=
(
self
.
_fixed_params
is
None
or
len
(
self
.
_fixed_params
)
==
1
)
and
self
.
n_systems
>
1
if
not
merge_sys
or
idx
==
0
:
mpl
.
gcf
().
clear
()
# ax
i
s should only be created
and twin
on
e
ce
# ax
e
s should only be created once
self
.
_axis1
=
mpl
.
gca
()
self
.
_axis2
=
mpl
.
twinx
()
points
=
10
...
...
@@ -327,7 +327,7 @@ class Epsc(VulnPlot):
)
if
self
.
_titles
is
not
None
and
len
(
self
.
_titles
)
>
idx
:
title
=
self
.
_titles
[
idx
]
if
self
.
_titles
[
idx
].
replace
(
' '
,
''
)
\
else
None
else
None
mpl
.
title
(
title
)
mpl
.
grid
()
...
...
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