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

Corrected the scripts so that they now run with the latest version of Bob and...

Corrected the scripts so that they now run with the latest version of Bob and the xbob.db.atnt database.
parent 7061231a
Branches
Tags
No related merge requests found
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
[buildout] [buildout]
parts = external python parts = external python
newest = false
develop = . develop = .
; required packages: sphinx (to generate the documentation), bob, and our package. ; required packages: sphinx (to generate the documentation), bob, and our package.
......
...@@ -16,7 +16,7 @@ ATNT_IMAGE_EXTENSION = ".pgm" ...@@ -16,7 +16,7 @@ ATNT_IMAGE_EXTENSION = ".pgm"
def load_images(db, group = None, purpose = None, client_id = None): 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""" """Reads the images for the given group and the given client id from the given database"""
# get the file names from the database # get the file names from the database
file_names = db.files(groups = group, purposes = purpose, client_ids = client_id, directory = ATNT_IMAGE_DIRECTORY, extension = ATNT_IMAGE_EXTENSION) file_names = db.files(groups = group, purposes = purpose, model_ids = client_id, directory = ATNT_IMAGE_DIRECTORY, extension = ATNT_IMAGE_EXTENSION)
# iterate through the list of file names # iterate through the list of file names
images = {} images = {}
for key, image_name in file_names.iteritems(): for key, image_name in file_names.iteritems():
...@@ -37,7 +37,7 @@ def extract_feature(image): ...@@ -37,7 +37,7 @@ def extract_feature(image):
"""Extracts the DCT features for the given image""" """Extracts the DCT features for the given image"""
# compute shape of the image blocks # compute shape of the image blocks
block_shape = bob.ip.get_block_shape(image, DCT_BLOCK_SIZE, DCT_BLOCK_SIZE, DCT_BLOCK_OVERLAP, DCT_BLOCK_OVERLAP) block_shape = bob.ip.get_block_3d_output_shape(image, DCT_BLOCK_SIZE, DCT_BLOCK_SIZE, DCT_BLOCK_OVERLAP, DCT_BLOCK_OVERLAP)
image_blocks = numpy.ndarray(block_shape, 'float64') image_blocks = numpy.ndarray(block_shape, 'float64')
# fill image blocks # fill image blocks
...@@ -155,7 +155,7 @@ def main(): ...@@ -155,7 +155,7 @@ def main():
gmm_trainer.set_prior_gmm(ubm) gmm_trainer.set_prior_gmm(ubm)
# create a GMM model for each model identity # create a GMM model for each model identity
model_ids = atnt_db.client_ids(groups = 'dev') model_ids = atnt_db.clients(groups = 'dev')
models = {} models = {}
for model_id in model_ids: for model_id in model_ids:
# load images for the current model id # load images for the current model id
......
...@@ -97,7 +97,7 @@ def main(): ...@@ -97,7 +97,7 @@ def main():
print "Computing scores" print "Computing scores"
# define a certain Gabor jet similarity function that should be used # define a certain Gabor jet similarity function that should be used
similarity_function = bob.machine.DisparityCorrectedPhaseDifference() similarity_function = bob.machine.GaborJetSimilarity(bob.machine.gabor_jet_similarity_type.PHASE_DIFF)
# iterate through models and probes and compute scores # iterate through models and probes and compute scores
for model_key, model_feature in model_features.iteritems(): for model_key, model_feature in model_features.iteritems():
......
...@@ -49,7 +49,7 @@ setup( ...@@ -49,7 +49,7 @@ setup(
# TODO: Add a version number requirement to bob, when ready # TODO: Add a version number requirement to bob, when ready
install_requires=[ install_requires=[
"sphinx", # to generate the documentation "sphinx", # to generate the documentation
"bob", # base signal proc./machine learning library "bob >= 1.1.0a0", # base signal proc./machine learning library
"xbob.db.atnt", # the AT&T (ORL) database of images "xbob.db.atnt", # the AT&T (ORL) database of images
], ],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment