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

Reduce ties with Bob/C++

parent 809d1d53
Branches
Tags
No related merge requests found
...@@ -13,11 +13,6 @@ import numpy ...@@ -13,11 +13,6 @@ import numpy
import nose.tools import nose.tools
import bob.io.base import bob.io.base
from .version import externals
from distutils.version import StrictVersion
if StrictVersion(externals['Bob'][0]) < '1.3.0a0': HAVE_BOB_1_2_2 = True
else: HAVE_BOB_1_2_2 = False
def F(f): def F(f):
"""Returns the test file on the "data" subdirectory""" """Returns the test file on the "data" subdirectory"""
import pkg_resources import pkg_resources
...@@ -189,7 +184,6 @@ def test_plots(): ...@@ -189,7 +184,6 @@ def test_plots():
# 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 = bob.io.base.load(F('nonsep-roc.hdf5')) xyref = bob.io.base.load(F('nonsep-roc.hdf5'))
if HAVE_BOB_1_2_2: xyref = xyref[::-1,:]
assert numpy.array_equal(xy, xyref) assert numpy.array_equal(xy, xyref)
# This example will test the Precision-Recall plot calculation functionality. # This example will test the Precision-Recall plot calculation functionality.
...@@ -204,7 +198,6 @@ def test_plots(): ...@@ -204,7 +198,6 @@ def test_plots():
# 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 = bob.io.base.load(F('nonsep-det.hdf5')) det_xyzw_ref = bob.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) assert numpy.allclose(det_xyzw, det_xyzw_ref, atol=1e-15)
# This example will test the EPC plot calculation functionality. For the # This example will test the EPC plot calculation functionality. For the
...@@ -235,7 +228,6 @@ def test_rocch(): ...@@ -235,7 +228,6 @@ def test_rocch():
negatives = bob.io.base.load(F('linsep-negatives.hdf5')) negatives = bob.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,:]
eer_ref = 0. eer_ref = 0.
# Computes # Computes
pmiss_pfa = rocch(negatives, positives) pmiss_pfa = rocch(negatives, positives)
...@@ -250,7 +242,6 @@ def test_rocch(): ...@@ -250,7 +242,6 @@ def test_rocch():
negatives = bob.io.base.load(F('nonsep-negatives.hdf5')) negatives = bob.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,:]
eer_ref = 0.116363636363636 eer_ref = 0.116363636363636
# Computes # Computes
pmiss_pfa = rocch(negatives, positives) pmiss_pfa = rocch(negatives, positives)
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include <Python.h> #include <Python.h>
#include <bob/config.h>
#include <string> #include <string>
#include <cstdlib> #include <cstdlib>
#include <blitz/blitz.h> #include <blitz/blitz.h>
...@@ -81,13 +79,6 @@ static PyObject* python_version() { ...@@ -81,13 +79,6 @@ static PyObject* python_version() {
return Py_BuildValue("s", f.str().c_str()); return Py_BuildValue("s", f.str().c_str());
} }
/**
* Bob version, API version and platform
*/
static PyObject* bob_version() {
return Py_BuildValue("sis", BOB_VERSION, BOB_API_VERSION, BOB_PLATFORM);
}
/** /**
* Numpy version * Numpy version
*/ */
...@@ -123,7 +114,6 @@ static PyObject* build_version_dictionary() { ...@@ -123,7 +114,6 @@ static PyObject* build_version_dictionary() {
if (!dict_steal(retval, "NumPy", numpy_version())) return 0; if (!dict_steal(retval, "NumPy", numpy_version())) return 0;
if (!dict_steal(retval, "bob.blitz", bob_blitz_version())) return 0; if (!dict_steal(retval, "bob.blitz", bob_blitz_version())) return 0;
if (!dict_steal(retval, "bob.core", bob_core_version())) return 0; if (!dict_steal(retval, "bob.core", bob_core_version())) return 0;
if (!dict_steal(retval, "Bob", bob_version())) return 0;
Py_INCREF(retval); Py_INCREF(retval);
return retval; return retval;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment