Skip to content
Snippets Groups Projects
Commit f99a6f08 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Update Eigenfaces after API change in Bob

parent a735d85f
Branches
Tags
No related merge requests found
......@@ -63,7 +63,7 @@ which is used to train a ``bob.machine.LinearMachine``:
.. code-block:: python
>>> pca_trainer = bob.trainer.SVDPCATrainer()
>>> pca_trainer = bob.trainer.PCATrainer()
>>> pca_machine, eigen_values = pca_trainer.train(training_set)
For some distance functions, the eigenvalues are needed, but in our example we just ignore them.
......
......@@ -50,14 +50,14 @@ KEPT_EIGENFACES = 5
def train(training_images):
"""Trains the PCA module with the given list of training images"""
# perform training using a SVD PCA trainer
pca_trainer = bob.trainer.SVDPCATrainer()
# perform training using a PCA trainer
pca_trainer = bob.trainer.PCATrainer()
# create array set used for training
# iterate through the training examples and linearize the images
training_set = numpy.vstack([image.flatten() for image in training_images.values()])
# training the SVD PCA returns a machine that can be used for projection
# training the PCA returns a machine that can be used for projection
pca_machine, eigen_values = pca_trainer.train(training_set)
# limit the number of kept eigenfaces
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment