Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.measure
Commits
cf70b274
Commit
cf70b274
authored
Apr 26, 2016
by
Tiago de Freitas Pereira
Browse files
Merge pull request #11 from tiagofrepereira2012/master
Fixed the issue
#10
parents
b1c346c3
71f14e9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
bob/measure/test_error.py
View file @
cf70b274
...
...
@@ -331,22 +331,23 @@ def test_open_set_recognition_rate():
# No error files
cmc_scores
=
bob
.
measure
.
load
.
cmc_four_column
(
F
(
"scores-cmc-4col-open-set.txt"
))
normal_scores
=
bob
.
measure
.
load
.
split_four_column
(
F
(
"scores-cmc-4col-open-set.txt"
))
assert
abs
(
bob
.
measure
.
recognition_rate
(
cmc_scores
)
-
1.0
)
<
1e-8
assert
abs
(
bob
.
measure
.
recognition_rate
(
cmc_scores
,
threshold
=
0.5
)
-
1.0
)
<
1e-8
t
=
bob
.
measure
.
far_threshold
(
normal_scores
[
0
],
normal_scores
[
1
],
far_value
)
assert
abs
(
bob
.
measure
.
recognition_rate
(
cmc_scores
,
threshold
=
t
)
-
1.0
)
<
1e-8
# One error
cmc_scores
=
bob
.
measure
.
load
.
cmc_four_column
(
F
(
"scores-cmc-4col-open-set.txt"
))
normal_scores
=
bob
.
measure
.
load
.
split_four_column
(
F
(
"scores-cmc-4col-open-set.txt"
))
cmc_scores
=
bob
.
measure
.
load
.
cmc_four_column
(
F
(
"scores-cmc-4col-open-set
-one-error
.txt"
))
normal_scores
=
bob
.
measure
.
load
.
split_four_column
(
F
(
"scores-cmc-4col-open-set
-one-error
.txt"
))
assert
abs
(
bob
.
measure
.
recognition_rate
(
cmc_scores
)
-
0.857142857143
)
<
1e-8
assert
abs
(
bob
.
measure
.
recognition_rate
(
cmc_scores
,
threshold
=
0.5
)
-
0.857142857143
)
<
1e-8
t
=
bob
.
measure
.
far_threshold
(
normal_scores
[
0
],
normal_scores
[
1
],
far_value
)
assert
abs
(
bob
.
measure
.
recognition_rate
(
cmc_scores
,
threshold
=
t
)
-
0.857142857143
)
<
1e-8
# Two errors
cmc_scores
=
bob
.
measure
.
load
.
cmc_four_column
(
F
(
"scores-cmc-4col-open-set.txt"
))
normal_scores
=
bob
.
measure
.
load
.
split_four_column
(
F
(
"scores-cmc-4col-open-set.txt"
))
cmc_scores
=
bob
.
measure
.
load
.
cmc_four_column
(
F
(
"scores-cmc-4col-open-set
-two-errors
.txt"
))
normal_scores
=
bob
.
measure
.
load
.
split_four_column
(
F
(
"scores-cmc-4col-open-set
-two-errors
.txt"
))
assert
abs
(
bob
.
measure
.
recognition_rate
(
cmc_scores
)
-
0.857142857143
)
<
1e-8
assert
abs
(
bob
.
measure
.
recognition_rate
(
cmc_scores
,
threshold
=
0.5
)
-
0.857142857143
)
<
1e-8
t
=
bob
.
measure
.
far_threshold
(
normal_scores
[
0
],
normal_scores
[
1
],
far_value
)
...
...
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