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
b2af052c
Commit
b2af052c
authored
12 years ago
by
Manuel Günther
Browse files
Options
Downloads
Patches
Plain Diff
Corrected bug in DCT_UBM toolchain; added --help option; added source file headers.
parent
1ad53869
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
faceverify/__init__.py
+20
-0
20 additions, 0 deletions
faceverify/__init__.py
faceverify/dct_ubm.py
+27
-3
27 additions, 3 deletions
faceverify/dct_ubm.py
faceverify/eigenface.py
+24
-1
24 additions, 1 deletion
faceverify/eigenface.py
faceverify/gabor_phase.py
+29
-1
29 additions, 1 deletion
faceverify/gabor_phase.py
with
100 additions
and
5 deletions
faceverify/__init__.py
+
20
−
0
View file @
b2af052c
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# @author: Manuel Guenther <Manuel.Guenther@idiap.ch>
# @date: Wed May 1 11:33:00 CEST 2013
#
# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
This diff is collapsed.
Click to expand it.
faceverify/dct_ubm.py
+
27
−
3
View file @
b2af052c
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# @author: Manuel Guenther <Manuel.Guenther@idiap.ch>
# @date: Wed May 1 11:33:00 CEST 2013
#
# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
bob
import
xbob.db.atnt
import
os
,
sys
...
...
@@ -16,7 +36,7 @@ ATNT_IMAGE_EXTENSION = ".pgm"
def
load_images
(
db
,
group
=
None
,
purpose
=
None
,
client_id
=
None
):
"""
Reads the images for the given group and the given client id from the given database
"""
# get the file names from the database
files
=
db
.
objects
(
groups
=
group
,
purposes
=
purpose
)
files
=
db
.
objects
(
groups
=
group
,
purposes
=
purpose
,
model_ids
=
client_id
)
# iterate through the list of file names
images
=
{}
for
k
in
files
:
...
...
@@ -121,6 +141,10 @@ def main():
# check if the AT&T database directory is overwritten by the command line
global
ATNT_IMAGE_DIRECTORY
if
len
(
sys
.
argv
)
>
1
:
if
sys
.
argv
[
1
].
lower
()
in
(
'
-h
'
,
'
--help
'
):
print
"
Usage:
"
,
sys
.
argv
[
0
],
"
[DatabaseDirectory]
"
print
"
NOTE: DatabaseDirectory defaults to the
'
./Database
'
or to the environment variable
'
ATNT_DATABASE_DIRECTORY
'
, if set
"
return
ATNT_IMAGE_DIRECTORY
=
sys
.
argv
[
1
]
# check if the database directory exists
...
...
@@ -148,8 +172,8 @@ def main():
gmm_trainer
.
max_iterations
=
1
gmm_trainer
.
set_prior_gmm
(
ubm
)
#
create
a GMM model for each model identity
model_ids
=
atnt_db
.
clients
(
groups
=
'
dev
'
)
#
enroll
a GMM model for each model identity
(i.e., each client)
model_ids
=
[
client
.
id
for
client
in
atnt_db
.
clients
(
groups
=
'
dev
'
)
]
models
=
{}
for
model_id
in
model_ids
:
# load images for the current model id
...
...
This diff is collapsed.
Click to expand it.
faceverify/eigenface.py
+
24
−
1
View file @
b2af052c
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# @author: Manuel Guenther <Manuel.Guenther@idiap.ch>
# @date: Wed May 1 11:33:00 CEST 2013
#
# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
bob
import
xbob.db.atnt
import
os
,
sys
...
...
@@ -9,7 +29,6 @@ from matplotlib import pyplot
global
ATNT_IMAGE_DIRECTORY
ATNT_IMAGE_DIRECTORY
=
os
.
environ
[
'
ATNT_DATABASE_DIRECTORY
'
]
if
'
ATNT_DATABASE_DIRECTORY
'
in
os
.
environ
else
"
Database
"
# The default file name extension of the AT&T images
ATNT_IMAGE_EXTENSION
=
"
.pgm
"
...
...
@@ -68,6 +87,10 @@ def main():
# check if the AT&T database directory is overwritten by the command line
global
ATNT_IMAGE_DIRECTORY
if
len
(
sys
.
argv
)
>
1
:
if
sys
.
argv
[
1
].
lower
()
in
(
'
-h
'
,
'
--help
'
):
print
"
Usage:
"
,
sys
.
argv
[
0
],
"
[DatabaseDirectory]
"
print
"
NOTE: DatabaseDirectory defaults to the
'
./Database
'
or to the environment variable
'
ATNT_DATABASE_DIRECTORY
'
, if set
"
return
ATNT_IMAGE_DIRECTORY
=
sys
.
argv
[
1
]
# check if the database directory exists
...
...
This diff is collapsed.
Click to expand it.
faceverify/gabor_phase.py
+
29
−
1
View file @
b2af052c
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# @author: Manuel Guenther <Manuel.Guenther@idiap.ch>
# @date: Wed May 1 11:33:00 CEST 2013
#
# Copyright (C) 2011-2013 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
bob
import
xbob.db.atnt
import
os
,
sys
...
...
@@ -58,6 +78,10 @@ def main():
# check if the AT&T database directory is overwritten by the command line
global
ATNT_IMAGE_DIRECTORY
if
len
(
sys
.
argv
)
>
1
:
if
sys
.
argv
[
1
].
lower
()
in
(
'
-h
'
,
'
--help
'
):
print
"
Usage:
"
,
sys
.
argv
[
0
],
"
[DatabaseDirectory]
"
print
"
NOTE: DatabaseDirectory defaults to the
'
./Database
'
or to the environment variable
'
ATNT_DATABASE_DIRECTORY
'
, if set
"
return
ATNT_IMAGE_DIRECTORY
=
sys
.
argv
[
1
]
# check if the database directory exists
...
...
@@ -100,7 +124,11 @@ def main():
similarity_function
=
bob
.
machine
.
GaborJetSimilarity
(
bob
.
machine
.
gabor_jet_similarity_type
.
PHASE_DIFF
)
# iterate through models and probes and compute scores
model_count
=
1
for
model_key
,
model_feature
in
model_features
.
iteritems
():
print
"
\r
Model
"
,
model_count
,
"
of
"
,
len
(
model_features
),
sys
.
stdout
.
flush
()
model_count
+=
1
for
probe_key
,
probe_feature
in
probe_features
.
iteritems
():
# compute score using the desired Gabor jet similarity function
score
=
graph_machine
.
similarity
(
model_feature
,
probe_feature
,
similarity_function
)
...
...
@@ -111,7 +139,7 @@ def main():
else
:
negative_scores
.
append
(
score
)
print
"
Evaluation
"
print
"
\n
Evaluation
"
# convert list of scores to numpy arrays
positives
=
numpy
.
array
(
positive_scores
)
negatives
=
numpy
.
array
(
negative_scores
)
...
...
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