From f9982baffd169abffbfd01ffa072bb82b9c9ff65 Mon Sep 17 00:00:00 2001 From: Manuel Guenther <manuel.guenther@idiap.ch> Date: Mon, 1 Jun 2015 11:39:22 +0200 Subject: [PATCH] Improved build system --- bob/bio/face/test/test_algorithms.py | 58 ------------------------- buildout.cfg | 64 +++++++++++++++++++++++----- requirements.txt | 25 +++++++++++ setup.py | 12 +++--- 4 files changed, 85 insertions(+), 74 deletions(-) create mode 100644 requirements.txt diff --git a/bob/bio/face/test/test_algorithms.py b/bob/bio/face/test/test_algorithms.py index 4df36601..180315f6 100644 --- a/bob/bio/face/test/test_algorithms.py +++ b/bob/bio/face/test/test_algorithms.py @@ -25,7 +25,6 @@ import os import numpy import math import tempfile -import facereclib from nose.plugins.skip import SkipTest import pkg_resources @@ -112,60 +111,3 @@ def test_lgbphs(): reference *= 2. assert abs(lgbphs.score(model2, feature2) - reference) < 1e-5 assert abs(lgbphs.score_for_multiple_probes(model2, [feature2, feature2]) - reference) < 1e-5 - - -""" - def test09_plda(self): - # read input - feature = facereclib.utils.load(self.input_dir('linearize.hdf5')) - # assure that the config file is readable - tool = self.config('pca+plda') - self.assertTrue(isinstance(tool, facereclib.tools.PLDA)) - - # here, we use a reduced complexity for test purposes - tool = facereclib.tools.PLDA( - subspace_dimension_of_f = 2, - subspace_dimension_of_g = 2, - subspace_dimension_pca = 10, - plda_training_iterations = 1, - INIT_SEED = seed_value, - ) - self.assertFalse(tool.performs_projection) - self.assertTrue(tool.requires_enroller_training) - - # train the projector - t = tempfile.mkstemp('pca+plda.hdf5', prefix='frltest_')[1] - tool.train_enroller(facereclib.utils.tests.random_training_set_by_id(feature.shape, count=20, minimum=0., maximum=255.), t) - if regenerate_refs: - import shutil - shutil.copy2(t, self.reference_dir('pca+plda_enroller.hdf5')) - - # load the projector file - tool.load_enroller(self.reference_dir('pca+plda_enroller.hdf5')) - # compare the resulting machines - test_file = bob.io.base.HDF5File(t) - test_file.cd('/pca') - pca_machine = bob.learn.linear.Machine(test_file) - test_file.cd('/plda') - plda_machine = bob.learn.em.PLDABase(test_file) - # TODO: compare the PCA machines - #self.assertEqual(pca_machine, tool.m_pca_machine) - # TODO: compare the PLDA machines - #self.assertEqual(plda_machine, tool.m_plda_base_machine) - os.remove(t) - - # enroll model - model = tool.enroll([feature]) - if regenerate_refs: - model.save(bob.io.base.HDF5File(self.reference_dir('pca+plda_model.hdf5'), 'w')) - # TODO: compare the models with the reference - #reference_model = tool.read_model(self.reference_dir('pca+plda_model.hdf5')) - #self.assertEqual(model, reference_model) - - # score - sim = tool.score(model, feature) - self.assertAlmostEqual(sim, 0.) - # score with a concatenation of the probe - self.assertAlmostEqual(tool.score_for_multiple_probes(model, [feature, feature]), 0.) - -""" diff --git a/buildout.cfg b/buildout.cfg index f282fcd5..303ea632 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -4,17 +4,35 @@ [buildout] parts = scripts -eggs = bob.learn.linear - bob.learn.em - bob.bio.base - bob.bio.gmm - bob.bio.face +eggs = bob.bio.face + gridtk + extensions = bob.buildout - -develop = ../../bob/layers/1/bob.learn.linear - ../../bob/layers/1/bob.learn.em - ../bob.bio.base - ../bob.bio.gmm + mr.developer +auto-checkout = * +develop = src/bob.extension + src/bob.blitz + src/bob.core + src/bob.io.base + src/bob.io.image + src/bob.learn.activation + src/bob.math + src/bob.learn.linear + src/bob.sp + src/bob.ip.base + src/bob.ip.color + src/bob.ip.draw + src/bob.ip.gabor + src/bob.learn.em + src/bob.measure + src/bob.db.base + src/bob.db.verification.utils + src/bob.db.verification.filelist + src/bob.db.atnt + src/bob.bio.base + src/bob.learn.boosting + src/bob.ip.facedetect + src/bob.ip.flandmark . ; options for bob.buildout @@ -22,6 +40,32 @@ debug = true verbose = true newest = false +[sources] +bob.extension = git https://github.com/bioidiap/bob.extension +bob.blitz = git https://github.com/bioidiap/bob.blitz +bob.core = git https://github.com/bioidiap/bob.core +bob.io.base = git https://github.com/bioidiap/bob.io.base +bob.io.image = git https://github.com/bioidiap/bob.io.image +bob.learn.activation = git https://github.com/bioidiap/bob.learn.activation +bob.math = git https://github.com/bioidiap/bob.math +bob.sp = git https://github.com/bioidiap/bob.sp +bob.ip.base = git https://github.com/bioidiap/bob.ip.base +bob.ip.color = git https://github.com/bioidiap/bob.ip.color +bob.ip.draw = git https://github.com/bioidiap/bob.ip.draw +bob.ip.gabor = git https://github.com/bioidiap/bob.ip.gabor +bob.learn.linear = git https://github.com/bioidiap/bob.learn.linear +bob.learn.em = git https://github.com/bioidiap/bob.learn.em +bob.measure = git https://github.com/bioidiap/bob.measure +bob.db.base = git https://github.com/bioidiap/bob.db.base +bob.db.verification.utils = git https://github.com/bioidiap/bob.db.verification.utils +bob.db.verification.filelist = git https://github.com/bioidiap/bob.db.verification.filelist +bob.db.atnt = git https://github.com/bioidiap/bob.db.atnt +bob.bio.base = git https://github.com/bioidiap/bob.bio.base +bob.learn.boosting = git https://github.com/bioidiap/bob.learn.boosting +bob.ip.facedetect = git https://github.com/bioidiap/bob.ip.facedetect +bob.ip.flandmark = git https://github.com/bioidiap/bob.ip.flandmark + + [scripts] recipe = bob.buildout:scripts dependent-scripts = true diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..f86ce3b1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,25 @@ +setuptools +bob.extension +bob.blitz +bob.core +bob.io.base +bob.io.image +bob.learn.activation +bob.math +bob.sp +bob.ip.base +bob.ip.color +bob.ip.draw +bob.ip.gabor +bob.learn.linear +bob.learn.em +bob.measure +bob.db.base +bob.db.verification.utils +bob.db.verification.filelist +bob.db.atnt # required for testing +bob.bio.base +bob.learn.boosting +bob.ip.facedetect +bob.ip.flandmark +matplotlib # for plotting diff --git a/setup.py b/setup.py index 0c923fcf..7f000b62 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,11 @@ # allows you to test your package with new python dependencies w/o requiring # administrative interventions. -from setuptools import setup, find_packages +from setuptools import setup, find_packages, dist +dist.Distribution(dict(setup_requires=['bob.extension'])) + +from bob.extension.utils import load_requirements +install_requires = load_requirements() # The only thing we do in this file is to call the setup() function with all # parameters that define our package. @@ -64,11 +68,7 @@ setup( # 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 # privileges when using buildout. - install_requires = [ - 'setuptools', - 'bob.bio.base', - 'bob.bio.gmm', - ], + install_requires = install_requires, # Your project should be called something like 'bob.<foo>' or # 'bob.<foo>.<bar>'. To implement this correctly and still get all your -- GitLab