Skip to content
Snippets Groups Projects
Commit ab1608e8 authored by Yannick DAYER's avatar Yannick DAYER
Browse files

Regen references files with hdf5 v3; Set the seeds

parent 79c69bb4
Branches
No related tags found
1 merge request!27Fix: hdf5 v3 not supported
Pipeline #58497 failed
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -95,7 +95,7 @@ def test_projector(): ...@@ -95,7 +95,7 @@ def test_projector():
) )
# Generate and project random feature # Generate and project random feature
feature = utils.random_array((20, 45), -5.0, 5.0, seed=84) feature = utils.random_array((20, 45), -5.0, 5.0, seed=seed_value)
projected = gmm1.project(feature) projected = gmm1.project(feature)
assert isinstance(projected, bob.learn.em.mixture.GMMStats) assert isinstance(projected, bob.learn.em.mixture.GMMStats)
...@@ -120,7 +120,7 @@ def test_enroll(): ...@@ -120,7 +120,7 @@ def test_enroll():
) )
gmm1.ubm = ubm gmm1.ubm = ubm
# Enroll the biometric reference from random features # Enroll the biometric reference from random features
enroll = utils.random_training_set((20, 45), 5, -5.0, 5.0, seed=21) enroll = utils.random_training_set((20, 45), 5, -5.0, 5.0, seed=seed_value)
biometric_reference = gmm1.enroll(enroll) biometric_reference = gmm1.enroll(enroll)
assert not biometric_reference.is_similar_to(biometric_reference.ubm) assert not biometric_reference.is_similar_to(biometric_reference.ubm)
assert isinstance(biometric_reference, GMMMachine) assert isinstance(biometric_reference, GMMMachine)
...@@ -153,9 +153,9 @@ def test_score(): ...@@ -153,9 +153,9 @@ def test_score():
probe = GMMStats.from_hdf5( probe = GMMStats.from_hdf5(
pkg_resources.resource_filename("bob.bio.gmm.test", "data/gmm_projected.hdf5") pkg_resources.resource_filename("bob.bio.gmm.test", "data/gmm_projected.hdf5")
) )
probe_data = utils.random_array((20, 45), -5.0, 5.0, seed=84) probe_data = utils.random_array((20, 45), -5.0, 5.0, seed=seed_value)
reference_score = -0.098980 reference_score = 0.593373
numpy.testing.assert_almost_equal( numpy.testing.assert_almost_equal(
gmm1.score(biometric_reference, probe), reference_score, decimal=5 gmm1.score(biometric_reference, probe), reference_score, decimal=5
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment