diff --git a/bob/bio/gmm/algorithm/GMM.py b/bob/bio/gmm/algorithm/GMM.py index 81f1c3474849fed47da147cc18a8cf0913be8cad..675910c9322bdde1d2a78a367b6df4d81856bfda 100644 --- a/bob/bio/gmm/algorithm/GMM.py +++ b/bob/bio/gmm/algorithm/GMM.py @@ -253,6 +253,7 @@ class GMMRegular (GMM): def train_enroller(self, train_features, enroller_file): """Computes the Universal Background Model from the training ("world") data""" + train_features = [feature for client in train_features for feature in client] return self.train_projector(train_features, enroller_file) diff --git a/bob/bio/gmm/config/algorithm/ivector_plda.py b/bob/bio/gmm/config/algorithm/ivector_plda.py new file mode 100644 index 0000000000000000000000000000000000000000..3a5e830c797dfdc7ecb36e881d2a0d7089a59ca9 --- /dev/null +++ b/bob/bio/gmm/config/algorithm/ivector_plda.py @@ -0,0 +1,14 @@ +import bob.bio.gmm + +algorithm = bob.bio.gmm.algorithm.IVector( + # IVector parameters + subspace_dimension_of_t = 100, + update_sigma = True, + tv_training_iterations = 25, # Number of EM iterations for the TV training + # GMM parameters + number_of_gaussians = 256, + use_plda = True, + plda_dim_F = 50, + plda_dim_G = 50, + plda_training_iterations = 200, +) diff --git a/bob/bio/gmm/test/test_algorithms.py b/bob/bio/gmm/test/test_algorithms.py index bac0c0e647184aadec3133f1af0f6dd47571ecd2..3cb845bf3ca54a647ca1155e683d66ada46b961a 100644 --- a/bob/bio/gmm/test/test_algorithms.py +++ b/bob/bio/gmm/test/test_algorithms.py @@ -148,8 +148,8 @@ def test_gmm_regular(): train_data = utils.random_training_set((100,45), count=5, minimum=-5., maximum=5.) reference_file = pkg_resources.resource_filename('bob.bio.gmm.test', 'data/gmm_projector.hdf5') try: - # train the projector - gmm2.train_enroller(train_data, temp_file) + # train the enroler + gmm2.train_enroller([train_data], temp_file) assert os.path.exists(temp_file) @@ -331,7 +331,7 @@ def test_jfa(): def test_ivector_cosine(): temp_file = bob.io.base.test_utils.temporary_filename() - ivec1 = bob.bio.base.load_resource("ivector", "algorithm") + ivec1 = bob.bio.base.load_resource("ivector-cosine", "algorithm") assert isinstance(ivec1, bob.bio.gmm.algorithm.IVector) assert isinstance(ivec1, bob.bio.gmm.algorithm.GMM) assert isinstance(ivec1, bob.bio.base.algorithm.Algorithm) @@ -396,7 +396,7 @@ def test_ivector_cosine(): def test_ivector_plda(): temp_file = bob.io.base.test_utils.temporary_filename() - ivec1 = bob.bio.base.load_resource("ivector", "algorithm") + ivec1 = bob.bio.base.load_resource("ivector-plda", "algorithm") ivec1.use_plda = True # create smaller IVector object @@ -458,7 +458,7 @@ def test_ivector_plda(): def test_ivector_lda_wccn_plda(): temp_file = bob.io.base.test_utils.temporary_filename() - ivec1 = bob.bio.base.load_resource("ivector", "algorithm") + ivec1 = bob.bio.base.load_resource("ivector-lda-wccn-plda", "algorithm") ivec1.use_lda = True ivec1.use_wccn = True ivec1.use_plda = True diff --git a/setup.py b/setup.py index 5e93b9e14d5d5b47a3f6b00c76bf016253a951c0..109e4dd2132fc1c18fbca0645d75901deaf62154 100644 --- a/setup.py +++ b/setup.py @@ -124,6 +124,7 @@ setup( 'jfa = bob.bio.gmm.config.algorithm.jfa:algorithm', 'isv = bob.bio.gmm.config.algorithm.isv:algorithm', 'ivector-cosine = bob.bio.gmm.config.algorithm.ivector_cosine:algorithm', + 'ivector-plda = bob.bio.gmm.config.algorithm.ivector_plda:algorithm', 'ivector-lda-wccn-plda = bob.bio.gmm.config.algorithm.ivector_lda_wccn_plda:algorithm', ], },