Skip to content
Snippets Groups Projects
Commit e26e2727 authored by Manuel Günther's avatar Manuel Günther
Browse files

Fixed issues with Distance algorithm

parent 4f81b606
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ import numpy ...@@ -6,6 +6,7 @@ import numpy
import scipy.spatial import scipy.spatial
from .Algorithm import Algorithm from .Algorithm import Algorithm
from .. import utils
import logging import logging
logger = logging.getLogger("bob.bio.base") logger = logging.getLogger("bob.bio.base")
...@@ -72,6 +73,25 @@ class Distance (Algorithm): ...@@ -72,6 +73,25 @@ class Distance (Algorithm):
# just store all the features # just store all the features
return numpy.vstack([f.flatten() for f in enroll_features]) return numpy.vstack([f.flatten() for f in enroll_features])
def read_probe(self, probe_file):
"""read_probe(probe_file) -> probe
Reads the probe feature from the given HDF5 file.
**Parameters:**
probe_file : str or :py:class:`bob.io.base.HDF5File`
The file (open for reading) or the name of an existing file to read from.
**Returns:**
probe : object
The probe.
"""
return utils.load(feature_file)
def score(self, model, probe): def score(self, model, probe):
"""score(model, probe) -> float """score(model, probe) -> float
...@@ -104,7 +124,7 @@ class Distance (Algorithm): ...@@ -104,7 +124,7 @@ class Distance (Algorithm):
def train_projector(*args,**kwargs): raise NotImplementedError() def train_projector(*args,**kwargs): raise NotImplementedError()
def load_projector(*args,**kwargs): pass def load_projector(*args,**kwargs): pass
def project(*args,**kwargs): raise NotImplementedError() def project(*args,**kwargs): raise NotImplementedError()
def write_feature(*args,**kwargs): raise NotImplementedError()
def read_feature(*args,**kwargs): raise NotImplementedError() def read_feature(*args,**kwargs): raise NotImplementedError()
def write_feature(*args,**kwargs): raise NotImplementedError()
def train_enroller(*args,**kwargs): raise NotImplementedError() def train_enroller(*args,**kwargs): raise NotImplementedError()
def load_enroller(*args,**kwargs): pass def load_enroller(*args,**kwargs): pass
...@@ -24,6 +24,7 @@ Implementations ...@@ -24,6 +24,7 @@ Implementations
.. autosummary:: .. autosummary::
bob.bio.base.extractor.Linearize bob.bio.base.extractor.Linearize
bob.bio.base.algorithm.Distance
bob.bio.base.algorithm.PCA bob.bio.base.algorithm.PCA
bob.bio.base.algorithm.LDA bob.bio.base.algorithm.LDA
bob.bio.base.algorithm.PLDA bob.bio.base.algorithm.PLDA
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment