Skip to content
Snippets Groups Projects
Commit 61c3d9ce authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Implement discrete xbob.io packaging

parent bbc6aa63
No related branches found
No related tags found
No related merge requests found
...@@ -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
...@@ -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
......
...@@ -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',
], ],
......
...@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment