From 5dea52570522be61de851b3b65e97c7ccff4072f Mon Sep 17 00:00:00 2001 From: Manuel Guenther <manuel.guenther@idiap.ch> Date: Mon, 17 Sep 2012 15:41:17 +0200 Subject: [PATCH] Corrected the scripts so that they now run with the latest version of Bob and the xbob.db.atnt database. --- buildout.cfg | 1 + faceverify/dct_ubm.py | 6 +++--- faceverify/gabor_phase.py | 2 +- setup.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/buildout.cfg b/buildout.cfg index aa737a6..e1ad958 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -6,6 +6,7 @@ [buildout] parts = external python +newest = false develop = . ; required packages: sphinx (to generate the documentation), bob, and our package. diff --git a/faceverify/dct_ubm.py b/faceverify/dct_ubm.py index 20c5210..d5bdf96 100644 --- a/faceverify/dct_ubm.py +++ b/faceverify/dct_ubm.py @@ -16,7 +16,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 - 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 images = {} for key, image_name in file_names.iteritems(): @@ -37,7 +37,7 @@ def extract_feature(image): """Extracts the DCT features for the given image""" # 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') # fill image blocks @@ -155,7 +155,7 @@ def main(): gmm_trainer.set_prior_gmm(ubm) # create a GMM model for each model identity - model_ids = atnt_db.client_ids(groups = 'dev') + model_ids = atnt_db.clients(groups = 'dev') models = {} for model_id in model_ids: # load images for the current model id diff --git a/faceverify/gabor_phase.py b/faceverify/gabor_phase.py index 3cc9451..3609709 100644 --- a/faceverify/gabor_phase.py +++ b/faceverify/gabor_phase.py @@ -97,7 +97,7 @@ def main(): print "Computing scores" # 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 for model_key, model_feature in model_features.iteritems(): diff --git a/setup.py b/setup.py index cac4713..f85c720 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,7 @@ setup( # TODO: Add a version number requirement to bob, when ready install_requires=[ "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 ], -- GitLab