Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.base
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.base
Commits
e26e2727
Commit
e26e2727
authored
9 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Fixed issues with Distance algorithm
parent
4f81b606
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/bio/base/algorithm/Distance.py
+21
-1
21 additions, 1 deletion
bob/bio/base/algorithm/Distance.py
doc/implemented.rst
+1
-0
1 addition, 0 deletions
doc/implemented.rst
with
22 additions
and
1 deletion
bob/bio/base/algorithm/Distance.py
+
21
−
1
View file @
e26e2727
...
...
@@ -6,6 +6,7 @@ import numpy
import
scipy.spatial
from
.Algorithm
import
Algorithm
from
..
import
utils
import
logging
logger
=
logging
.
getLogger
(
"
bob.bio.base
"
)
...
...
@@ -72,6 +73,25 @@ class Distance (Algorithm):
# just store all the 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
):
"""
score(model, probe) -> float
...
...
@@ -104,7 +124,7 @@ class Distance (Algorithm):
def
train_projector
(
*
args
,
**
kwargs
):
raise
NotImplementedError
()
def
load_projector
(
*
args
,
**
kwargs
):
pass
def
project
(
*
args
,
**
kwargs
):
raise
NotImplementedError
()
def
write_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
load_enroller
(
*
args
,
**
kwargs
):
pass
This diff is collapsed.
Click to expand it.
doc/implemented.rst
+
1
−
0
View file @
e26e2727
...
...
@@ -24,6 +24,7 @@ Implementations
.. autosummary::
bob.bio.base.extractor.Linearize
bob.bio.base.algorithm.Distance
bob.bio.base.algorithm.PCA
bob.bio.base.algorithm.LDA
bob.bio.base.algorithm.PLDA
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment