Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.measure
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.measure
Commits
61c3d9ce
Commit
61c3d9ce
authored
11 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Implement discrete xbob.io packaging
parent
bbc6aa63
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
buildout.cfg
+3
-3
3 additions, 3 deletions
buildout.cfg
doc/conf.py
+6
-6
6 additions, 6 deletions
doc/conf.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
xbob/measure/test_error.py
+24
-24
24 additions, 24 deletions
xbob/measure/test_error.py
with
34 additions
and
34 deletions
buildout.cfg
+
3
−
3
View file @
61c3d9ce
...
@@ -11,20 +11,20 @@ auto-checkout = *
...
@@ -11,20 +11,20 @@ auto-checkout = *
develop
=
src/xbob.extension
develop
=
src/xbob.extension
src/xbob.blitz
src/xbob.blitz
src/xbob.math
src/xbob.math
src/xbob.io
src/xbob.io
.base
.
.
; options for xbob.buildout extension
; options for xbob.buildout extension
debug
=
true
debug
=
true
verbose
=
true
verbose
=
true
prefixes
=
/idiap/group/torch5spro/
nightlies/last/bob
/linux-x86_64-release
prefixes
=
/idiap/group/torch5spro/
releases/preview/install
/linux-x86_64-release
/Users/andre/work/bob/b/dbg/
/Users/andre/work/bob/b/dbg/
[sources]
[sources]
xbob.extension
=
git https://github.com/bioidiap/xbob.extension branch=prototype
xbob.extension
=
git https://github.com/bioidiap/xbob.extension branch=prototype
xbob.blitz
=
git https://github.com/bioidiap/xbob.blitz
xbob.blitz
=
git https://github.com/bioidiap/xbob.blitz
xbob.math
=
git https://github.com/bioidiap/xbob.math
xbob.math
=
git https://github.com/bioidiap/xbob.math
xbob.io
=
git https://github.com/bioidiap/xbob.io
xbob.io
.base
=
git https://github.com/bioidiap/xbob.io
.base
[scripts]
[scripts]
recipe
=
xbob.buildout:scripts
recipe
=
xbob.buildout:scripts
This diff is collapsed.
Click to expand it.
doc/conf.py
+
6
−
6
View file @
61c3d9ce
...
@@ -59,12 +59,12 @@ source_suffix = '.rst'
...
@@ -59,12 +59,12 @@ source_suffix = '.rst'
master_doc
=
'
index
'
master_doc
=
'
index
'
# General information about the project.
# General information about the project.
project
=
u
'
xbob.
io
'
project
=
u
'
xbob.
measure
'
import
time
import
time
copyright
=
u
'
%s, Idiap Research Institute
'
%
time
.
strftime
(
'
%Y
'
)
copyright
=
u
'
%s, Idiap Research Institute
'
%
time
.
strftime
(
'
%Y
'
)
# Grab the setup entry
# Grab the setup entry
distribution
=
pkg_resources
.
require
(
'
xbob.
io
'
)[
0
]
distribution
=
pkg_resources
.
require
(
'
xbob.
measure
'
)[
0
]
# The version info for the project you're documenting, acts as replacement for
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# |version| and |release|, also used in various other places throughout the
...
@@ -130,7 +130,7 @@ if sphinx.__version__ >= "1.0":
...
@@ -130,7 +130,7 @@ if sphinx.__version__ >= "1.0":
#html_title = None
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = 'xbob_
io
'
#html_short_title = 'xbob_
measure
'
# The name of an image file (relative to this directory) to place at the top
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
# of the sidebar.
...
@@ -188,7 +188,7 @@ html_favicon = 'img/favicon.ico'
...
@@ -188,7 +188,7 @@ html_favicon = 'img/favicon.ico'
#html_file_suffix = None
#html_file_suffix = None
# Output file base name for HTML help builder.
# Output file base name for HTML help builder.
htmlhelp_basename
=
'
xbob_
io
_doc
'
htmlhelp_basename
=
'
xbob_
measure
_doc
'
# -- Options for LaTeX output --------------------------------------------------
# -- Options for LaTeX output --------------------------------------------------
...
@@ -202,7 +202,7 @@ latex_font_size = '10pt'
...
@@ -202,7 +202,7 @@ latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents
=
[
latex_documents
=
[
(
'
index
'
,
'
xbob_
io
.tex
'
,
u
'
Bob
I/O
Routines
'
,
(
'
index
'
,
'
xbob_
measure
.tex
'
,
u
'
Bob
Performance Measurement
Routines
'
,
u
'
Biometrics Group, Idiap Research Institute
'
,
'
manual
'
),
u
'
Biometrics Group, Idiap Research Institute
'
,
'
manual
'
),
]
]
...
@@ -242,7 +242,7 @@ rst_epilog = """
...
@@ -242,7 +242,7 @@ rst_epilog = """
# One entry per manual page. List of tuples
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
# (source start file, name, description, authors, manual section).
man_pages
=
[
man_pages
=
[
(
'
index
'
,
'
xbob_
io
'
,
u
'
Bob
I/O Routines Documentation
'
,
[
u
'
Idiap Research Institute
'
],
1
)
(
'
index
'
,
'
xbob_
measure
'
,
u
'
Bob
Performance Measurement Routines
'
,
[
u
'
Idiap Research Institute
'
],
1
)
]
]
# Default processing flags for sphinx
# Default processing flags for sphinx
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
61c3d9ce
...
@@ -29,7 +29,7 @@ setup(
...
@@ -29,7 +29,7 @@ setup(
'
setuptools
'
,
'
setuptools
'
,
'
xbob.blitz
'
,
'
xbob.blitz
'
,
'
xbob.math
'
,
'
xbob.math
'
,
'
xbob.io
'
,
'
xbob.io
.base
'
,
'
matplotlib
'
,
'
matplotlib
'
,
],
],
...
...
This diff is collapsed.
Click to expand it.
xbob/measure/test_error.py
+
24
−
24
View file @
61c3d9ce
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
import
os
import
os
import
numpy
import
numpy
import
nose.tools
import
nose.tools
import
xbob.io
import
xbob.io
.base
from
.version
import
externals
from
.version
import
externals
from
distutils.version
import
StrictVersion
from
distutils.version
import
StrictVersion
...
@@ -26,7 +26,7 @@ def F(f):
...
@@ -26,7 +26,7 @@ def F(f):
def
save
(
fname
,
data
):
def
save
(
fname
,
data
):
"""
Saves a single array into a file in the
'
data
'
directory.
"""
"""
Saves a single array into a file in the
'
data
'
directory.
"""
xbob
.
io
.
Array
(
data
).
save
(
os
.
path
.
join
(
'
data
'
,
fname
))
xbob
.
io
.
base
.
Array
(
data
).
save
(
os
.
path
.
join
(
'
data
'
,
fname
))
def
test_basic_ratios
():
def
test_basic_ratios
():
...
@@ -36,8 +36,8 @@ def test_basic_ratios():
...
@@ -36,8 +36,8 @@ def test_basic_ratios():
# We test the basic functionaly on FAR and FRR calculation. The first
# We test the basic functionaly on FAR and FRR calculation. The first
# example is separable, with a separation threshold of about 3.0
# example is separable, with a separation threshold of about 3.0
positives
=
xbob
.
io
.
load
(
F
(
'
linsep-positives.hdf5
'
))
positives
=
xbob
.
io
.
base
.
load
(
F
(
'
linsep-positives.hdf5
'
))
negatives
=
xbob
.
io
.
load
(
F
(
'
linsep-negatives.hdf5
'
))
negatives
=
xbob
.
io
.
base
.
load
(
F
(
'
linsep-negatives.hdf5
'
))
minimum
=
min
(
positives
.
min
(),
negatives
.
min
())
minimum
=
min
(
positives
.
min
(),
negatives
.
min
())
maximum
=
max
(
positives
.
max
(),
negatives
.
max
())
maximum
=
max
(
positives
.
max
(),
negatives
.
max
())
...
@@ -92,8 +92,8 @@ def test_indexing():
...
@@ -92,8 +92,8 @@ def test_indexing():
# This test verifies that the output of correctly_classified_positives() and
# This test verifies that the output of correctly_classified_positives() and
# correctly_classified_negatives() makes sense.
# correctly_classified_negatives() makes sense.
positives
=
xbob
.
io
.
load
(
F
(
'
linsep-positives.hdf5
'
))
positives
=
xbob
.
io
.
base
.
load
(
F
(
'
linsep-positives.hdf5
'
))
negatives
=
xbob
.
io
.
load
(
F
(
'
linsep-negatives.hdf5
'
))
negatives
=
xbob
.
io
.
base
.
load
(
F
(
'
linsep-negatives.hdf5
'
))
minimum
=
min
(
positives
.
min
(),
negatives
.
min
())
minimum
=
min
(
positives
.
min
(),
negatives
.
min
())
maximum
=
max
(
positives
.
max
(),
negatives
.
max
())
maximum
=
max
(
positives
.
max
(),
negatives
.
max
())
...
@@ -126,8 +126,8 @@ def test_thresholding():
...
@@ -126,8 +126,8 @@ def test_thresholding():
# calculate the threshold that minimizes the EER.
# calculate the threshold that minimizes the EER.
# This test set is not separable.
# This test set is not separable.
positives
=
xbob
.
io
.
load
(
F
(
'
nonsep-positives.hdf5
'
))
positives
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-positives.hdf5
'
))
negatives
=
xbob
.
io
.
load
(
F
(
'
nonsep-negatives.hdf5
'
))
negatives
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-negatives.hdf5
'
))
threshold
=
eer_threshold
(
negatives
,
positives
)
threshold
=
eer_threshold
(
negatives
,
positives
)
# Of course we have to make sure that will set the EER correctly:
# Of course we have to make sure that will set the EER correctly:
...
@@ -153,8 +153,8 @@ def test_thresholding():
...
@@ -153,8 +153,8 @@ def test_thresholding():
# trickier, as you have no points in the middle of the range to compare
# trickier, as you have no points in the middle of the range to compare
# things to. This is where the currently used recursive algorithm seems to
# things to. This is where the currently used recursive algorithm seems to
# do better. Let's verify
# do better. Let's verify
positives
=
xbob
.
io
.
load
(
F
(
'
linsep-positives.hdf5
'
))
positives
=
xbob
.
io
.
base
.
load
(
F
(
'
linsep-positives.hdf5
'
))
negatives
=
xbob
.
io
.
load
(
F
(
'
linsep-negatives.hdf5
'
))
negatives
=
xbob
.
io
.
base
.
load
(
F
(
'
linsep-negatives.hdf5
'
))
threshold
=
eer_threshold
(
negatives
,
positives
)
threshold
=
eer_threshold
(
negatives
,
positives
)
# the result here is 3.242 (which is what is expect ;-)
# the result here is 3.242 (which is what is expect ;-)
...
@@ -180,15 +180,15 @@ def test_plots():
...
@@ -180,15 +180,15 @@ def test_plots():
from
.
import
eer_threshold
,
roc
,
precision_recall_curve
,
det
,
epc
from
.
import
eer_threshold
,
roc
,
precision_recall_curve
,
det
,
epc
# This test set is not separable.
# This test set is not separable.
positives
=
xbob
.
io
.
load
(
F
(
'
nonsep-positives.hdf5
'
))
positives
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-positives.hdf5
'
))
negatives
=
xbob
.
io
.
load
(
F
(
'
nonsep-negatives.hdf5
'
))
negatives
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-negatives.hdf5
'
))
threshold
=
eer_threshold
(
negatives
,
positives
)
threshold
=
eer_threshold
(
negatives
,
positives
)
# This example will test the ROC plot calculation functionality.
# This example will test the ROC plot calculation functionality.
xy
=
roc
(
negatives
,
positives
,
100
)
xy
=
roc
(
negatives
,
positives
,
100
)
# uncomment the next line to save a reference value
# uncomment the next line to save a reference value
# save('nonsep-roc.hdf5', xy)
# save('nonsep-roc.hdf5', xy)
xyref
=
xbob
.
io
.
load
(
F
(
'
nonsep-roc.hdf5
'
))
xyref
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-roc.hdf5
'
))
if
HAVE_BOB_1_2_2
:
xyref
=
xyref
[::
-
1
,:]
if
HAVE_BOB_1_2_2
:
xyref
=
xyref
[::
-
1
,:]
assert
numpy
.
array_equal
(
xy
,
xyref
)
assert
numpy
.
array_equal
(
xy
,
xyref
)
...
@@ -196,14 +196,14 @@ def test_plots():
...
@@ -196,14 +196,14 @@ def test_plots():
xy
=
precision_recall_curve
(
negatives
,
positives
,
100
)
xy
=
precision_recall_curve
(
negatives
,
positives
,
100
)
# uncomment the next line to save a reference value
# uncomment the next line to save a reference value
# save('nonsep-roc.hdf5', xy)
# save('nonsep-roc.hdf5', xy)
xyref
=
xbob
.
io
.
load
(
F
(
'
nonsep-precisionrecall.hdf5
'
))
xyref
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-precisionrecall.hdf5
'
))
assert
numpy
.
array_equal
(
xy
,
xyref
)
assert
numpy
.
array_equal
(
xy
,
xyref
)
# This example will test the DET plot calculation functionality.
# This example will test the DET plot calculation functionality.
det_xyzw
=
det
(
negatives
,
positives
,
100
)
det_xyzw
=
det
(
negatives
,
positives
,
100
)
# uncomment the next line to save a reference value
# uncomment the next line to save a reference value
# save('nonsep-det.hdf5', det_xyzw)
# save('nonsep-det.hdf5', det_xyzw)
det_xyzw_ref
=
xbob
.
io
.
load
(
F
(
'
nonsep-det.hdf5
'
))
det_xyzw_ref
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-det.hdf5
'
))
if
HAVE_BOB_1_2_2
:
det_xyzw_ref
=
det_xyzw_ref
[::
-
1
,:]
if
HAVE_BOB_1_2_2
:
det_xyzw_ref
=
det_xyzw_ref
[::
-
1
,:]
assert
numpy
.
allclose
(
det_xyzw
,
det_xyzw_ref
,
atol
=
1e-15
)
assert
numpy
.
allclose
(
det_xyzw
,
det_xyzw_ref
,
atol
=
1e-15
)
...
@@ -219,7 +219,7 @@ def test_plots():
...
@@ -219,7 +219,7 @@ def test_plots():
test_negatives
,
test_positives
,
100
)
test_negatives
,
test_positives
,
100
)
# uncomment the next line to save a reference value
# uncomment the next line to save a reference value
# save('nonsep-epc.hdf5', xy)
# save('nonsep-epc.hdf5', xy)
xyref
=
xbob
.
io
.
load
(
F
(
'
nonsep-epc.hdf5
'
))
xyref
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-epc.hdf5
'
))
assert
numpy
.
allclose
(
xy
,
xyref
,
atol
=
1e-15
)
assert
numpy
.
allclose
(
xy
,
xyref
,
atol
=
1e-15
)
...
@@ -231,8 +231,8 @@ def test_rocch():
...
@@ -231,8 +231,8 @@ def test_rocch():
# calculate the threshold that minimizes the EER on the ROC Convex Hull
# calculate the threshold that minimizes the EER on the ROC Convex Hull
# This test set is separable.
# This test set is separable.
positives
=
xbob
.
io
.
load
(
F
(
'
linsep-positives.hdf5
'
))
positives
=
xbob
.
io
.
base
.
load
(
F
(
'
linsep-positives.hdf5
'
))
negatives
=
xbob
.
io
.
load
(
F
(
'
linsep-negatives.hdf5
'
))
negatives
=
xbob
.
io
.
base
.
load
(
F
(
'
linsep-negatives.hdf5
'
))
# References obtained using Bosaris 1.06
# References obtained using Bosaris 1.06
pmiss_pfa_ref
=
numpy
.
array
([[
1.
,
0.
,
0.
],
[
0.
,
0.
,
1.
]])
pmiss_pfa_ref
=
numpy
.
array
([[
1.
,
0.
,
0.
],
[
0.
,
0.
,
1.
]])
if
HAVE_BOB_1_2_2
:
pmiss_pfa_ref
=
pmiss_pfa_ref
[::
-
1
,:]
if
HAVE_BOB_1_2_2
:
pmiss_pfa_ref
=
pmiss_pfa_ref
[::
-
1
,:]
...
@@ -246,8 +246,8 @@ def test_rocch():
...
@@ -246,8 +246,8 @@ def test_rocch():
assert
abs
(
eer
-
eer_ref
)
<
1e-4
assert
abs
(
eer
-
eer_ref
)
<
1e-4
# This test set is not separable.
# This test set is not separable.
positives
=
xbob
.
io
.
load
(
F
(
'
nonsep-positives.hdf5
'
))
positives
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-positives.hdf5
'
))
negatives
=
xbob
.
io
.
load
(
F
(
'
nonsep-negatives.hdf5
'
))
negatives
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-negatives.hdf5
'
))
# References obtained using Bosaris 1.06
# References obtained using Bosaris 1.06
pmiss_pfa_ref
=
numpy
.
array
([[
1.
,
0.68
,
0.28
,
0.1
,
0.06
,
0.
,
0.
],
[
0
,
0
,
0.08
,
0.12
,
0.22
,
0.48
,
1.
]])
pmiss_pfa_ref
=
numpy
.
array
([[
1.
,
0.68
,
0.28
,
0.1
,
0.06
,
0.
,
0.
],
[
0
,
0
,
0.08
,
0.12
,
0.22
,
0.48
,
1.
]])
if
HAVE_BOB_1_2_2
:
pmiss_pfa_ref
=
pmiss_pfa_ref
[::
-
1
,:]
if
HAVE_BOB_1_2_2
:
pmiss_pfa_ref
=
pmiss_pfa_ref
[::
-
1
,:]
...
@@ -297,8 +297,8 @@ def test_calibration():
...
@@ -297,8 +297,8 @@ def test_calibration():
# Tests the cllr and min_cllr measures
# Tests the cllr and min_cllr measures
# This test set is separable.
# This test set is separable.
positives
=
xbob
.
io
.
load
(
F
(
'
linsep-positives.hdf5
'
))
positives
=
xbob
.
io
.
base
.
load
(
F
(
'
linsep-positives.hdf5
'
))
negatives
=
xbob
.
io
.
load
(
F
(
'
linsep-negatives.hdf5
'
))
negatives
=
xbob
.
io
.
base
.
load
(
F
(
'
linsep-negatives.hdf5
'
))
cllr
=
calibration
.
cllr
(
negatives
,
positives
)
cllr
=
calibration
.
cllr
(
negatives
,
positives
)
min_cllr
=
calibration
.
min_cllr
(
negatives
,
positives
)
min_cllr
=
calibration
.
min_cllr
(
negatives
,
positives
)
...
@@ -309,8 +309,8 @@ def test_calibration():
...
@@ -309,8 +309,8 @@ def test_calibration():
nose
.
tools
.
assert_almost_equal
(
min_cllr
,
0.
)
nose
.
tools
.
assert_almost_equal
(
min_cllr
,
0.
)
# This test set is not separable.
# This test set is not separable.
positives
=
xbob
.
io
.
load
(
F
(
'
nonsep-positives.hdf5
'
))
positives
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-positives.hdf5
'
))
negatives
=
xbob
.
io
.
load
(
F
(
'
nonsep-negatives.hdf5
'
))
negatives
=
xbob
.
io
.
base
.
load
(
F
(
'
nonsep-negatives.hdf5
'
))
cllr
=
calibration
.
cllr
(
negatives
,
positives
)
cllr
=
calibration
.
cllr
(
negatives
,
positives
)
min_cllr
=
calibration
.
min_cllr
(
negatives
,
positives
)
min_cllr
=
calibration
.
min_cllr
(
negatives
,
positives
)
...
...
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