Commit 61c3d9ce authored by André Anjos's avatar André Anjos 💬

Implement discrete xbob.io packaging

parent bbc6aa63
......@@ -11,20 +11,20 @@ auto-checkout = *
develop = src/xbob.extension
src/xbob.blitz
src/xbob.math
src/xbob.io
src/xbob.io.base
.
; options for xbob.buildout extension
debug = 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/
[sources]
xbob.extension = git https://github.com/bioidiap/xbob.extension branch=prototype
xbob.blitz = git https://github.com/bioidiap/xbob.blitz
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]
recipe = xbob.buildout:scripts
......@@ -59,12 +59,12 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'xbob.io'
project = u'xbob.measure'
import time
copyright = u'%s, Idiap Research Institute' % time.strftime('%Y')
# 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
# |version| and |release|, also used in various other places throughout the
......@@ -130,7 +130,7 @@ if sphinx.__version__ >= "1.0":
#html_title = None
# 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
# of the sidebar.
......@@ -188,7 +188,7 @@ html_favicon = 'img/favicon.ico'
#html_file_suffix = None
# Output file base name for HTML help builder.
htmlhelp_basename = 'xbob_io_doc'
htmlhelp_basename = 'xbob_measure_doc'
# -- Options for LaTeX output --------------------------------------------------
......@@ -202,7 +202,7 @@ latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
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'),
]
......@@ -242,7 +242,7 @@ rst_epilog = """
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
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
......
......@@ -29,7 +29,7 @@ setup(
'setuptools',
'xbob.blitz',
'xbob.math',
'xbob.io',
'xbob.io.base',
'matplotlib',
],
......
......@@ -11,7 +11,7 @@
import os
import numpy
import nose.tools
import xbob.io
import xbob.io.base
from .version import externals
from distutils.version import StrictVersion
......@@ -26,7 +26,7 @@ def F(f):
def save(fname, data):
"""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():
......@@ -36,8 +36,8 @@ def test_basic_ratios():
# We test the basic functionaly on FAR and FRR calculation. The first
# example is separable, with a separation threshold of about 3.0
positives = xbob.io.load(F('linsep-positives.hdf5'))
negatives = xbob.io.load(F('linsep-negatives.hdf5'))
positives = xbob.io.base.load(F('linsep-positives.hdf5'))
negatives = xbob.io.base.load(F('linsep-negatives.hdf5'))
minimum = min(positives.min(), negatives.min())
maximum = max(positives.max(), negatives.max())
......@@ -92,8 +92,8 @@ def test_indexing():
# This test verifies that the output of correctly_classified_positives() and
# correctly_classified_negatives() makes sense.
positives = xbob.io.load(F('linsep-positives.hdf5'))
negatives = xbob.io.load(F('linsep-negatives.hdf5'))
positives = xbob.io.base.load(F('linsep-positives.hdf5'))
negatives = xbob.io.base.load(F('linsep-negatives.hdf5'))
minimum = min(positives.min(), negatives.min())
maximum = max(positives.max(), negatives.max())
......@@ -126,8 +126,8 @@ def test_thresholding():
# calculate the threshold that minimizes the EER.
# This test set is not separable.
positives = xbob.io.load(F('nonsep-positives.hdf5'))
negatives = xbob.io.load(F('nonsep-negatives.hdf5'))
positives = xbob.io.base.load(F('nonsep-positives.hdf5'))
negatives = xbob.io.base.load(F('nonsep-negatives.hdf5'))
threshold = eer_threshold(negatives, positives)
# Of course we have to make sure that will set the EER correctly:
......@@ -153,8 +153,8 @@ def test_thresholding():
# 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
# do better. Let's verify
positives = xbob.io.load(F('linsep-positives.hdf5'))
negatives = xbob.io.load(F('linsep-negatives.hdf5'))
positives = xbob.io.base.load(F('linsep-positives.hdf5'))
negatives = xbob.io.base.load(F('linsep-negatives.hdf5'))
threshold = eer_threshold(negatives, positives)
# the result here is 3.242 (which is what is expect ;-)
......@@ -180,15 +180,15 @@ def test_plots():
from . import eer_threshold, roc, precision_recall_curve, det, epc
# This test set is not separable.
positives = xbob.io.load(F('nonsep-positives.hdf5'))
negatives = xbob.io.load(F('nonsep-negatives.hdf5'))
positives = xbob.io.base.load(F('nonsep-positives.hdf5'))
negatives = xbob.io.base.load(F('nonsep-negatives.hdf5'))
threshold = eer_threshold(negatives, positives)
# This example will test the ROC plot calculation functionality.
xy = roc(negatives, positives, 100)
# uncomment the next line to save a reference value
# 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,:]
assert numpy.array_equal(xy, xyref)
......@@ -196,14 +196,14 @@ def test_plots():
xy = precision_recall_curve(negatives, positives, 100)
# uncomment the next line to save a reference value
# 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)
# This example will test the DET plot calculation functionality.
det_xyzw = det(negatives, positives, 100)
# uncomment the next line to save a reference value
# 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,:]
assert numpy.allclose(det_xyzw, det_xyzw_ref, atol=1e-15)
......@@ -219,7 +219,7 @@ def test_plots():
test_negatives, test_positives, 100)
# uncomment the next line to save a reference value
# 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)
......@@ -231,8 +231,8 @@ def test_rocch():
# calculate the threshold that minimizes the EER on the ROC Convex Hull
# This test set is separable.
positives = xbob.io.load(F('linsep-positives.hdf5'))
negatives = xbob.io.load(F('linsep-negatives.hdf5'))
positives = xbob.io.base.load(F('linsep-positives.hdf5'))
negatives = xbob.io.base.load(F('linsep-negatives.hdf5'))
# References obtained using Bosaris 1.06
pmiss_pfa_ref = numpy.array([[1., 0., 0.], [0., 0., 1.]])
if HAVE_BOB_1_2_2: pmiss_pfa_ref = pmiss_pfa_ref[::-1,:]
......@@ -246,8 +246,8 @@ def test_rocch():
assert abs(eer-eer_ref) < 1e-4
# This test set is not separable.
positives = xbob.io.load(F('nonsep-positives.hdf5'))
negatives = xbob.io.load(F('nonsep-negatives.hdf5'))
positives = xbob.io.base.load(F('nonsep-positives.hdf5'))
negatives = xbob.io.base.load(F('nonsep-negatives.hdf5'))
# 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.]])
if HAVE_BOB_1_2_2: pmiss_pfa_ref = pmiss_pfa_ref[::-1,:]
......@@ -297,8 +297,8 @@ def test_calibration():
# Tests the cllr and min_cllr measures
# This test set is separable.
positives = xbob.io.load(F('linsep-positives.hdf5'))
negatives = xbob.io.load(F('linsep-negatives.hdf5'))
positives = xbob.io.base.load(F('linsep-positives.hdf5'))
negatives = xbob.io.base.load(F('linsep-negatives.hdf5'))
cllr = calibration.cllr(negatives, positives)
min_cllr = calibration.min_cllr(negatives, positives)
......@@ -309,8 +309,8 @@ def test_calibration():
nose.tools.assert_almost_equal(min_cllr, 0.)
# This test set is not separable.
positives = xbob.io.load(F('nonsep-positives.hdf5'))
negatives = xbob.io.load(F('nonsep-negatives.hdf5'))
positives = xbob.io.base.load(F('nonsep-positives.hdf5'))
negatives = xbob.io.base.load(F('nonsep-negatives.hdf5'))
cllr = calibration.cllr(negatives, positives)
min_cllr = calibration.min_cllr(negatives, positives)
......
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