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

Fixed eigenface example.

parent 8a34ca20
No related branches found
Tags v0.3.2
No related merge requests found
doc/eigenface.png

38.4 KiB | W: | H:

doc/eigenface.png

38.6 KiB | W: | H:

doc/eigenface.png
doc/eigenface.png
doc/eigenface.png
doc/eigenface.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -82,13 +82,13 @@ After training, the model and probe images are loaded, linearized, and projected
... probe_image = bob.io.load(filename)
... probe_feature = pca_machine(probe_image.flatten())
To compute the verification result, each model feature is compared to each probe feature by computing the Euclidean distance:
To compute the verification result, each model feature is compared to each probe feature by computing the negative Euclidean distance:
.. code-block:: python
>>> for model_feature in model_features:
... for probe_feature in probe_features:
... score = bob.math.euclidean_distance(model_feature, probe_feature)
... score = - bob.math.euclidean_distance(model_feature, probe_feature)
The results are divided into a list of positive scores (model and probe are from the same identity) and a a list of negative scores (identities of model and probe differ).
Using these lists, the ROC curve is plotted:
......@@ -107,12 +107,12 @@ and the performance is computed:
>>> threshold = bob.measure.eer_threshold(negatives, positives)
>>> FAR, FRR = bob.measure.farfrr(negatives, positives, threshold)
The expected result is: FAR 83.6% and FRR 83.6% at distance threshold 2048.9
The expected result is: FAR 16.4% and FRR 16.4% at distance threshold 2048.9
.. note::
Computing eigenfaces with such a low amount of training data is usually not an excellent idea.
Hence, the performance in this example is extremely poor.
Computing eigenfaces with a low amount of training data is usually not an excellent idea.
Hence, the performance in this example is relatively poor.
Gabor jet comparisons
......
......@@ -135,8 +135,8 @@ def main():
# iterate through models and probes and compute scores
for model_key, model_feature in model_features.iteritems():
for probe_key, probe_feature in probe_features.iteritems():
# compute score
score = distance_function(model_feature, probe_feature)
# compute score as negative distance
score = - distance_function(model_feature, probe_feature)
# check if this is a positive score
if atnt_db.get_client_id_from_file_id(model_key) == atnt_db.get_client_id_from_file_id(probe_key):
......
......@@ -28,7 +28,7 @@ setup(
# This is the basic information about your project. Modify all this
# information before releasing code publicly.
name='bob.example.faceverify',
version='0.3.1',
version='0.3.2',
description='Example for using Bob to create face verification systems',
url='http://pypi.python.org/pypi/bob.example.faceverify',
license='GPLv3',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment