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

Changed configuration to the latest nightlies version of bob; added new database interface.

parent 612b840e
No related branches found
No related tags found
No related merge requests found
...@@ -13,13 +13,18 @@ eggs = sphinx ...@@ -13,13 +13,18 @@ eggs = sphinx
bob bob
bob.example.faceverify bob.example.faceverify
; This points to the bob databases that are installed locally at Idiap
; TODO: remove this as soon as the databases are published at pypi
find-links = http://www.idiap.ch/software/bob/packages/xbob/nightlies/last
; This defines the installation directory of Bob. ; This defines the installation directory of Bob.
; The current setup should work fine for use at Idiap. ; The current setup should work fine for use at Idiap.
; If you are not at Idiap, and bob is not installed in the default location, ; If you are not at Idiap, and bob is not installed in the default location,
; please modify the egg-directories accordingly. ; please modify the egg-directories accordingly.
; TODO: Change this directory back to the stable version of bob, when appropriate
[external] [external]
recipe = xbob.buildout:external recipe = xbob.buildout:external
egg-directories = /idiap/group/torch5spro/releases/bob-1.0.5/install/linux-x86_64-release/lib egg-directories = /idiap/group/torch5spro/nightlies/last/install/linux-x86_64-release/lib
[python] [python]
......
import bob import bob
import xbob.db.atnt
import os, sys import os, sys
import numpy import numpy
from matplotlib import pyplot from matplotlib import pyplot
...@@ -121,7 +122,7 @@ def main(): ...@@ -121,7 +122,7 @@ def main():
"""This function will perform an a DCT block extraction and a UBM/GMM modeling test on the AT&T database""" """This function will perform an a DCT block extraction and a UBM/GMM modeling test on the AT&T database"""
# use the bob.db interface to retrieve information about the Database # use the bob.db interface to retrieve information about the Database
atnt_db = bob.db.atnt.Database() atnt_db = xbob.db.atnt.Database()
# check if the AT&T database directory is overwritten by the command line # check if the AT&T database directory is overwritten by the command line
global ATNT_IMAGE_DIRECTORY global ATNT_IMAGE_DIRECTORY
...@@ -136,7 +137,7 @@ def main(): ...@@ -136,7 +137,7 @@ def main():
##################################################################### #####################################################################
### UBM Training ### UBM Training
# load all training images # load all training images
training_images = load_images(atnt_db, group = 'train') training_images = load_images(atnt_db, group = 'world')
print "Extracting training features" print "Extracting training features"
training_features = {} training_features = {}
...@@ -154,11 +155,11 @@ def main(): ...@@ -154,11 +155,11 @@ 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 = 'test') model_ids = atnt_db.client_ids(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
model_images = load_images(atnt_db, group = 'test', purpose = 'enrol', client_id = model_id) model_images = load_images(atnt_db, group = 'dev', purpose = 'enrol', client_id = model_id)
models_for_current_id = {} models_for_current_id = {}
# extract model features # extract model features
for key, image in model_images.iteritems(): for key, image in model_images.iteritems():
...@@ -171,7 +172,7 @@ def main(): ...@@ -171,7 +172,7 @@ def main():
### probe stats ### probe stats
print "Computing probe statistics" print "Computing probe statistics"
probe_images = load_images(atnt_db, group = 'test', purpose = 'probe') probe_images = load_images(atnt_db, group = 'dev', purpose = 'probe')
probes = {} probes = {}
for key, image in probe_images.iteritems(): for key, image in probe_images.iteritems():
# extract probe features # extract probe features
......
import bob import bob
import xbob.db.atnt
import os, sys import os, sys
import numpy import numpy
from matplotlib import pyplot from matplotlib import pyplot
...@@ -64,7 +65,7 @@ def main(): ...@@ -64,7 +65,7 @@ def main():
"""This function will perform an eigenface test on the AT&T database""" """This function will perform an eigenface test on the AT&T database"""
# use the bob.db interface to retrieve information about the Database # use the bob.db interface to retrieve information about the Database
atnt_db = bob.db.atnt.Database() atnt_db = xbob.db.atnt.Database()
# check if the AT&T database directory is overwritten by the command line # check if the AT&T database directory is overwritten by the command line
global ATNT_IMAGE_DIRECTORY global ATNT_IMAGE_DIRECTORY
...@@ -80,7 +81,7 @@ def main(): ...@@ -80,7 +81,7 @@ def main():
### Training ### Training
# load all training images # load all training images
training_images = load_images(atnt_db, group = 'train') training_images = load_images(atnt_db, group = 'world')
print "Training PCA machine" print "Training PCA machine"
pca_machine = train(training_images) pca_machine = train(training_images)
...@@ -89,8 +90,8 @@ def main(): ...@@ -89,8 +90,8 @@ def main():
### extract eigenface features of model and probe images ### extract eigenface features of model and probe images
# load model and probe images # load model and probe images
model_images = load_images(atnt_db, group = 'test', purpose = 'enrol') model_images = load_images(atnt_db, group = 'dev', purpose = 'enrol')
probe_images = load_images(atnt_db, group = 'test', purpose = 'probe') probe_images = load_images(atnt_db, group = 'dev', purpose = 'probe')
print "Extracting models" print "Extracting models"
model_features = {} model_features = {}
......
import bob import bob
import xbob.db.atnt
import os, sys import os, sys
import numpy import numpy
from matplotlib import pyplot from matplotlib import pyplot
...@@ -52,7 +53,7 @@ def main(): ...@@ -52,7 +53,7 @@ def main():
"""This function will perform Gabor graph comparison test on the AT&T database""" """This function will perform Gabor graph comparison test on the AT&T database"""
# use the bob.db interface to retrieve information about the Database # use the bob.db interface to retrieve information about the Database
atnt_db = bob.db.atnt.Database() atnt_db = xbob.db.atnt.Database()
# check if the AT&T database directory is overwritten by the command line # check if the AT&T database directory is overwritten by the command line
global ATNT_IMAGE_DIRECTORY global ATNT_IMAGE_DIRECTORY
...@@ -76,8 +77,8 @@ def main(): ...@@ -76,8 +77,8 @@ def main():
##################################################################### #####################################################################
### extract Gabor graph features for all model and probe images ### extract Gabor graph features for all model and probe images
# load all model and probe images # load all model and probe images
model_images = load_images(atnt_db, group = 'test', purpose = 'enrol') model_images = load_images(atnt_db, group = 'dev', purpose = 'enrol')
probe_images = load_images(atnt_db, group = 'test', purpose = 'probe') probe_images = load_images(atnt_db, group = 'dev', purpose = 'probe')
print "Extracting models" print "Extracting models"
model_features = {} model_features = {}
......
...@@ -45,9 +45,12 @@ setup( ...@@ -45,9 +45,12 @@ setup(
# on the current system will be installed locally and only visible to the # on the current system will be installed locally and only visible to the
# scripts of this package. Don't worry - You won't need administrative # scripts of this package. Don't worry - You won't need administrative
# privileges when using buildout. # privileges when using buildout.
# 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 >= 1.0.0, < 1.1.0", # base signal proc./machine learning library "bob", # base signal proc./machine learning library
"xbob.db.atnt", # the AT&T (ORL) database of images
], ],
# This entry defines which scripts you will have inside the 'bin' directory # This entry defines which scripts you will have inside the 'bin' directory
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment