Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.example.faceverify
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
Model registry
Operate
Environments
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.example.faceverify
Commits
f99a6f08
Commit
f99a6f08
authored
11 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Update Eigenfaces after API change in Bob
parent
a735d85f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/examples.rst
+1
-1
1 addition, 1 deletion
doc/examples.rst
faceverify/eigenface.py
+3
-3
3 additions, 3 deletions
faceverify/eigenface.py
with
4 additions
and
4 deletions
doc/examples.rst
+
1
−
1
View file @
f99a6f08
...
...
@@ -63,7 +63,7 @@ which is used to train a ``bob.machine.LinearMachine``:
.. code-block:: python
>>> pca_trainer = bob.trainer.
SVD
PCATrainer()
>>> 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.
...
...
This diff is collapsed.
Click to expand it.
faceverify/eigenface.py
+
3
−
3
View file @
f99a6f08
...
...
@@ -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
.
SVD
PCATrainer
()
# 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
...
...
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