Commit cf70b274 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Merge pull request #11 from tiagofrepereira2012/master

Fixed the issue #10
parents b1c346c3 71f14e9c
...@@ -331,22 +331,23 @@ def test_open_set_recognition_rate(): ...@@ -331,22 +331,23 @@ def test_open_set_recognition_rate():
# No error files # No error files
cmc_scores = bob.measure.load.cmc_four_column(F("scores-cmc-4col-open-set.txt")) 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")) 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) - 1.0) < 1e-8
assert abs(bob.measure.recognition_rate(cmc_scores, threshold=0.5) - 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) 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 assert abs(bob.measure.recognition_rate(cmc_scores, threshold=t) - 1.0) < 1e-8
# One error # One error
cmc_scores = bob.measure.load.cmc_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.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) - 0.857142857143) < 1e-8
assert abs(bob.measure.recognition_rate(cmc_scores, threshold=0.5) - 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) 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 assert abs(bob.measure.recognition_rate(cmc_scores, threshold=t) - 0.857142857143) < 1e-8
# Two errors # Two errors
cmc_scores = bob.measure.load.cmc_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.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) - 0.857142857143) < 1e-8
assert abs(bob.measure.recognition_rate(cmc_scores, threshold=0.5) - 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) t = bob.measure.far_threshold(normal_scores[0], normal_scores[1],far_value)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment