diff --git a/bob/bio/gmm/algorithm/GMM.py b/bob/bio/gmm/algorithm/GMM.py index 1f664ba71a6fe5490908e160f94e6c286a63f9c5..81f1c3474849fed47da147cc18a8cf0913be8cad 100644 --- a/bob/bio/gmm/algorithm/GMM.py +++ b/bob/bio/gmm/algorithm/GMM.py @@ -87,7 +87,7 @@ class GMM (Algorithm): def _check_feature(self, feature): """Checks that the features are appropriate""" - if not isinstance(feature, numpy.ndarray) or len(feature.shape) != 2 or feature.dtype != numpy.float64: + if not isinstance(feature, numpy.ndarray) or feature.ndim != 2 or feature.dtype != numpy.float64: raise ValueError("The given feature is not appropriate") if self.ubm is not None and feature.shape[1] != self.ubm.shape[1]: raise ValueError("The given feature is expected to have %d elements, but it has %d" % (self.ubm.shape[1], feature.shape[1])) diff --git a/bob/bio/gmm/algorithm/ISV.py b/bob/bio/gmm/algorithm/ISV.py index e0cf0ead399614f39b76211e92bbaf2f0c1bf0d8..c2fbe409ea980c9a9817e5c85801139848d2ad75 100644 --- a/bob/bio/gmm/algorithm/ISV.py +++ b/bob/bio/gmm/algorithm/ISV.py @@ -186,7 +186,7 @@ class ISV (GMM): assert isinstance(probe, (tuple, list)) assert len(probe) == 2 assert isinstance(probe[0], bob.learn.em.GMMStats) - assert isinstance(probe[1], numpy.ndarray) and len(probe[1].shape) == 1 and probe[1].dtype == numpy.float64 + assert isinstance(probe[1], numpy.ndarray) and probe[1].ndim == 1 and probe[1].dtype == numpy.float64 def score(self, model, probe): diff --git a/bob/bio/gmm/algorithm/IVector.py b/bob/bio/gmm/algorithm/IVector.py index 8f4c6918617089e6b995d9696b9d420e599bb5bd..5cb62b79349209d5ce8a821b2b10babf8932f817 100644 --- a/bob/bio/gmm/algorithm/IVector.py +++ b/bob/bio/gmm/algorithm/IVector.py @@ -57,7 +57,7 @@ class IVector (GMM): def _check_projected(self, feature): """Checks that the features are appropriate""" - if not isinstance(feature, numpy.ndarray) or len(feature.shape) != 1 or feature.dtype != numpy.float64: + if not isinstance(feature, numpy.ndarray) or feature.ndim != 1 or feature.dtype != numpy.float64: raise ValueError("The given feature is not appropriate") if self.whitener is not None and feature.shape[0] != self.whitener.shape[1]: raise ValueError("The given feature is expected to have %d elements, but it has %d" % (self.whitener.shape[1], feature.shape[0])) diff --git a/setup.py b/setup.py index 067e08d3347710839ac8b89c5fdca482a90ebb5a..9ec6e17e2fde817742a288ef09991118f1504837 100644 --- a/setup.py +++ b/setup.py @@ -104,7 +104,7 @@ setup( 'console_scripts' : [ 'verify_gmm.py = bob.bio.gmm.script.verify_gmm:main', 'verify_isv.py = bob.bio.gmm.script.verify_isv:main', - 'verify_ivector.py = bob.bio.gmm.script.verify_ivector:main', + 'verify_ivector.py = bob.bio.gmm.script.verify_ivector:main', ], 'bob.bio.database': [