diff --git a/bob/bio/face/test/test_databases.py b/bob/bio/face/test/test_databases.py index 6afcb84e1de98e69165ca15bacf338ab4cad9ebd..113befad57ebc44fec86f5a3d7a2bc1edb262616 100644 --- a/bob/bio/face/test/test_databases.py +++ b/bob/bio/face/test/test_databases.py @@ -68,114 +68,116 @@ def _check_annotations(database): def test_arface(): - database = bob.bio.base.load_resource('arface', 'database') + database = bob.bio.base.load_resource('arface', 'database', preferred_extension='bob.bio.face') try: _check_database(database, groups=('dev', 'eval')) _check_annotations(database) except IOError as e: - raise SkipTest("The database could not queried; probably the db.sql3 file is missing. Here is the import error: '%s'" % e) + raise SkipTest("The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e) def test_atnt(): - _check_database(bob.bio.base.load_resource('atnt', 'database')) + _check_database(bob.bio.base.load_resource('atnt', 'database', preferred_extension='bob.bio.face')) def test_banca(): - database = bob.bio.base.load_resource('banca', 'database') + database = bob.bio.base.load_resource('banca', 'database', preferred_extension='bob.bio.face') try: _check_database_zt(database) _check_annotations(database) except IOError as e: - raise SkipTest("The database could not be queried; probably the db.sql3 file is missing. Here is the import error: '%s'" % e) + raise SkipTest("The database could not be queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e) def test_caspeal(): - database = bob.bio.base.load_resource('caspeal', 'database') + database = bob.bio.base.load_resource('caspeal', 'database', preferred_extension='bob.bio.face') try: _check_database(database) _check_database(database, protocol = 'aging') _check_annotations(database) except IOError as e: - raise SkipTest("The database could not queried; probably the db.sql3 file is missing. Here is the import error: '%s'" % e) + raise SkipTest("The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e) def test_frgc(): import xml.sax - database = bob.bio.base.load_resource('frgc', 'database') + database = bob.bio.base.load_resource('frgc', 'database', preferred_extension='bob.bio.face') try: _check_database(database, models_depend = True) _check_database(database, protocol = '2.0.2', models_depend = True) _check_annotations(database) except xml.sax.SAXException as e: - raise SkipTest("The database could not be opened, probably the original directory is wrong. Here is the value error: '%s'" % e) + raise SkipTest("The database could not be opened, probably the original directory is wrong. Here is the error: '%s'" % e) def test_gbu(): - database = bob.bio.base.load_resource('gbu', 'database') + database = bob.bio.base.load_resource('gbu', 'database', preferred_extension='bob.bio.face') try: _check_database(database, models_depend=True) _check_database(database, protocol = 'Bad', models_depend=True) _check_database(database, protocol = 'Ugly', models_depend=True) _check_annotations(database) except IOError as e: - raise SkipTest("The database could not queried; probably the db.sql3 file is missing. Here is the import error: '%s'" % e) + raise SkipTest("The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e) def test_lfw(): - database = bob.bio.base.load_resource('lfw-restricted', 'database') + database = bob.bio.base.load_resource('lfw-restricted', 'database', preferred_extension='bob.bio.face') try: _check_database(database, training_depends = True, models_depend = True) _check_database(database, groups = ('dev', 'eval'), protocol = 'fold1', training_depends = True, models_depend = True) - _check_database(bob.bio.base.load_resource('lfw-unrestricted', 'database'), training_depends = True, models_depend = True) + _check_database(bob.bio.base.load_resource('lfw-unrestricted', 'database', preferred_extension='bob.bio.face'), training_depends = True, models_depend = True) _check_annotations(database) except IOError as e: - raise SkipTest("The database could not queried; probably the db.sql3 file is missing. Here is the import error: '%s'" % e) + raise SkipTest("The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e) def test_mobio(): - database = bob.bio.base.load_resource('mobio-image', 'database') + database = bob.bio.base.load_resource('mobio-image', 'database', preferred_extension='bob.bio.face') try: _check_database_zt(database, models_depend=True) _check_database_zt(database, protocol = 'female', models_depend=True) - _check_database_zt(bob.bio.base.load_resource('mobio-male', 'database'), models_depend=True) - _check_database_zt(bob.bio.base.load_resource('mobio-female', 'database'), models_depend=True) + _check_database_zt(bob.bio.base.load_resource('mobio-male', 'database', preferred_extension='bob.bio.face'), models_depend=True) + _check_database_zt(bob.bio.base.load_resource('mobio-female', 'database', preferred_extension='bob.bio.face'), models_depend=True) except IOError as e: - raise SkipTest("The database could not be queried; probably the db.sql3 file is missing. Here is the import error: '%s'" % e) + raise SkipTest("The database could not be queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e) try: _check_annotations(database) except IOError as e: - raise SkipTest("The annotations could not be queried; probably the annotation files are missing. Here is the import error: '%s'" % e) + raise SkipTest("The annotations could not be queried; probably the annotation files are missing. Here is the error: '%s'" % e) def test_multipie(): - database = bob.bio.base.load_resource('multipie', 'database') + database = bob.bio.base.load_resource('multipie', 'database', preferred_extension='bob.bio.face') try: _check_database_zt(database, training_depends = True) - _check_database_zt(bob.bio.base.load_resource('multipie-pose', 'database'), training_depends = True) + _check_database_zt(bob.bio.base.load_resource('multipie-pose', 'database', preferred_extension='bob.bio.face'), training_depends = True) except IOError as e: - raise SkipTest("The database could not queried; probably the db.sql3 file is missing. Here is the import error: '%s'" % e) + raise SkipTest("The database could not queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e) + except ValueError as e: + raise SkipTest("The database could not queried; probably the protocol is missing inside the db.sql3 file. Here is the error: '%s'" % e) try: _check_annotations(database) except IOError as e: - raise SkipTest("The annotations could not be queried; probably the annotation files are missing. Here is the import error: '%s'" % e) + raise SkipTest("The annotations could not be queried; probably the annotation files are missing. Here is the error: '%s'" % e) def test_scface(): - database = bob.bio.base.load_resource('scface', 'database') + database = bob.bio.base.load_resource('scface', 'database', preferred_extension='bob.bio.face') try: _check_database_zt(database) _check_annotations(database) except IOError as e: - raise SkipTest("The database could not be queried; probably the db.sql3 file is missing. Here is the import error: '%s'" % e) + raise SkipTest("The database could not be queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e) def test_xm2vts(): - database = bob.bio.base.load_resource('xm2vts', 'database') + database = bob.bio.base.load_resource('xm2vts', 'database', preferred_extension='bob.bio.face') try: _check_database(database, groups=('dev', 'eval')) _check_database(database, groups=('dev', 'eval'), protocol = 'darkened-lp1') _check_annotations(database) except IOError as e: - raise SkipTest("The database could not be queried; probably the db.sql3 file is missing. Here is the import error: '%s'" % e) + raise SkipTest("The database could not be queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e)