Commit 7cbba66f authored by Manuel Günther's avatar Manuel Günther

Added databases.

parent 54106258
#!/usr/bin/env python
import bob.db.arface
import bob.bio.base
arface_directory = "[YOUR_ARFACE_DIRECTORY]"
database = bob.bio.base.database.DatabaseBob(
database = bob.db.arface.Database(
original_directory = arface_directory
),
name = 'arface',
protocol = 'all'
)
#!/usr/bin/env python
import bob.db.atnt
import bob.bio.base
atnt_directory = "[YOUR_ATNT_DIRECTORY]"
database = bob.bio.base.database.DatabaseBob(
database = bob.db.atnt.Database(
original_directory = atnt_directory
),
name = 'atnt'
)
#!/usr/bin/env python
import bob.db.banca
import bob.bio.base
banca_directory = "[YOUR_BANCA_DIRECTORY]"
database = bob.bio.base.database.DatabaseBobZT(
database = bob.db.banca.Database(
original_directory = banca_directory,
original_extension = '.ppm'
),
name = "banca",
protocol = 'P'
)
#!/usr/bin/env python
import bob.db.caspeal
import bob.bio.base
caspeal_directory = "[YOUR_CAS-PEAL_DIRECTORY]"
database = bob.bio.base.database.DatabaseBob(
database = bob.db.caspeal.Database(
original_directory = caspeal_directory
),
name = "caspeal",
protocol = 'lighting'
)
#!/usr/bin/env python
import bob.db.frgc
import bob.bio.base
frgc_directory = "[YOUR_FRGC_DIRECTORY]"
database = bob.bio.base.database.DatabaseBob(
database = bob.db.frgc.Database(frgc_directory),
name = "frgc",
protocol = '2.0.1',
models_depend_on_protocol = True
)
#!/usr/bin/env python
import bob.db.gbu
import bob.bio.base
mbgc_v1_directory = "[YOUR_MBGC-V1_DIRECTORY]"
database = bob.bio.base.database.DatabaseBob(
database = bob.db.gbu.Database(
original_directory = mbgc_v1_directory
),
name = "gbu",
protocol = 'Good',
models_depend_on_protocol = True,
all_files_options = { 'subworld': 'x2' },
extractor_training_options = { 'subworld': 'x2' },
projector_training_options = { 'subworld': 'x2' },
enroller_training_options = { 'subworld': 'x2' }
)
#!/usr/bin/env python
import bob.db.lfw
import bob.bio.base
lfw_directory = "[YOUR_LFW_FUNNELED_DIRECTORY]"
database = bob.bio.base.database.DatabaseBob(
database = bob.db.lfw.Database(
original_directory = lfw_directory,
annotation_type = 'funneled'
),
name = 'lfw',
protocol = 'view1',
training_depends_on_protocol = True,
models_depend_on_protocol = True,
all_files_options = { 'world_type' : 'restricted' },
extractor_training_options = { 'world_type' : 'restricted' }, # 'subworld' : 'twofolds'
projector_training_options = { 'world_type' : 'restricted' }, # 'subworld' : 'twofolds'
enroller_training_options = { 'world_type' : 'restricted' } # 'subworld' : 'twofolds'
)
#!/usr/bin/env python
import bob.db.lfw
import bob.bio.base
lfw_directory = "[YOUR_LFW_FUNNELED_DIRECTORY]"
database = bob.bio.base.database.DatabaseBob(
database = bob.db.lfw.Database(
original_directory = lfw_directory,
annotation_type = 'funneled'
),
name = 'lfw',
protocol = 'view1',
training_depends_on_protocol = True,
models_depend_on_protocol = True,
all_files_options = { 'world_type' : 'unrestricted' },
extractor_training_options = { 'world_type' : 'unrestricted' }, # 'subworld' : 'twofolds'
projector_training_options = { 'world_type' : 'unrestricted' }, # 'subworld' : 'twofolds'
enroller_training_options = { 'world_type' : 'unrestricted' } # 'subworld' : 'twofolds'
)
#!/usr/bin/env python
import bob.db.mobio
import bob.bio.base
mobio_image_directory = "[YOUR_MOBIO_IMAGE_DIRECTORY]"
mobio_annotation_directory = "[YOUR_MOBIO_ANNOTATION_DIRECTORY]"
database = bob.bio.base.database.DatabaseBobZT(
database = bob.db.mobio.Database(
original_directory = mobio_image_directory,
original_extension = ".png",
annotation_directory = mobio_annotation_directory,
),
name = "mobio-female",
protocol = 'female',
models_depend_on_protocol = True,
all_files_options = { 'gender' : 'female' },
extractor_training_options = { 'gender' : 'female' },
projector_training_options = { 'gender' : 'female' },
enroller_training_options = { 'gender' : 'female' },
z_probe_options = { 'gender' : 'female' }
)
#!/usr/bin/env python
import bob.db.mobio
import bob.bio.base
mobio_image_directory = "[YOUR_MOBIO_IMAGE_DIRECTORY]"
mobio_annotation_directory = "[YOUR_MOBIO_ANNOTATION_DIRECTORY]"
database = bob.bio.base.database.DatabaseBobZT(
database = bob.db.mobio.Database(
original_directory = mobio_image_directory,
original_extension = '.png',
annotation_directory = mobio_annotation_directory,
),
name = "mobio",
protocol = 'male',
models_depend_on_protocol = True
)
#!/usr/bin/env python
import bob.db.mobio
import bob.bio.base
mobio_image_directory = "[YOUR_MOBIO_IMAGE_DIRECTORY]"
mobio_annotation_directory = "[YOUR_MOBIO_ANNOTATION_DIRECTORY]"
database = bob.bio.base.database.DatabaseBobZT(
database = bob.db.mobio.Database(
original_directory = mobio_image_directory,
original_extension = ".png",
annotation_directory = mobio_annotation_directory,
),
name = "mobio-male",
protocol = 'male',
models_depend_on_protocol = True,
all_files_options = { 'gender' : 'male' },
extractor_training_options = { 'gender' : 'male' },
projector_training_options = { 'gender' : 'male' },
enroller_training_options = { 'gender' : 'male' },
z_probe_options = { 'gender' : 'male' }
)
#!/usr/bin/env python
import bob.db.multipie
import bob.bio.base
multipie_image_directory = "[YOUR_MULTI-PIE_IMAGE_DIRECTORY]"
multipie_annotation_directory = "[YOUR_MULTI-PIE_ANNOTATION_DIRECTORY]"
database = bob.bio.base.database.DatabaseBobZT(
database = bob.db.multipie.Database(
original_directory = multipie_image_directory,
annotation_directory = multipie_annotation_directory
),
name = "multipie",
protocol = 'U',
training_depends_on_protocol = True
)
#!/usr/bin/env python
import bob.db.multipie
import bob.bio.base
multipie_image_directory = "[YOUR_MULTI-PIE_IMAGE_DIRECTORY]"
multipie_annotation_directory = "[YOUR_MULTI-PIE_ANNOTATION_DIRECTORY]"
# here, we only want to have the cameras that are used in the P protocol
cameras = ('24_0', '01_0', '20_0', '19_0', '04_1', '05_0', '05_1', '14_0', '13_0', '08_0', '09_0', '12_0', '11_0')
database = bob.bio.base.database.DatabaseBobZT(
database = bob.db.multipie.Database(
original_directory = multipie_image_directory,
annotation_directory = multipie_annotation_directory
),
name = "multipie-pose",
protocol = 'P',
training_depends_on_protocol = True,
all_files_options = {'cameras' : cameras},
extractor_training_options = {'cameras' : cameras},
projector_training_options = {'cameras' : cameras, 'world_sampling': 3, 'world_first': True},
enroller_training_options = {'cameras' : cameras}
)
#!/usr/bin/env python
import bob.db.scface
import bob.bio.base
scface_directory = "[YOUR_SC_FACE_DIRECTORY]"
# setup for SCface database
database = bob.bio.base.database.DatabaseBobZT(
database = bob.db.scface.Database(
original_directory = scface_directory
),
name = 'scface',
protocol = 'combined'
)
#!/usr/bin/env python
import bob.db.xm2vts
import bob.bio.base
xm2vts_directory = "[YOUR_XM2VTS_IMAGE_DIRECTORY]"
# setup for XM2VTS
database = bob.bio.base.database.DatabaseBob(
database = bob.db.xm2vts.Database(
original_directory = xm2vts_directory
),
name = "xm2vts",
protocol = 'lp1'
)
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# @author: Manuel Guenther <Manuel.Guenther@idiap.ch>
# @date: Thu May 24 10:41:42 CEST 2012
#
# Copyright (C) 2011-2012 Idiap Research Institute, Martigny, Switzerland
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
from nose.plugins.skip import SkipTest
import bob.bio.base
def _check_database(database, groups = ('dev',), protocol = None, training_depends = False, models_depend = False):
assert isinstance(database, bob.bio.base.database.DatabaseBob)
if protocol: database.protocol = protocol
assert len(database.all_files()) > 0
assert len(database.training_files('train_extractor')) > 0
assert len(database.training_files('train_enroller', arrange_by_client = True)) > 0
for group in groups:
model_ids = database.model_ids(group)
assert len(model_ids) > 0
assert database.client_id_from_model_id(model_ids[0]) is not None
assert len(database.enroll_files(model_ids[0], group)) > 0
assert len(database.probe_files(model_ids[0], group)) > 0
assert database.training_depends_on_protocol == training_depends
assert database.models_depend_on_protocol == models_depend
def _check_database_zt(database, groups = ('dev', 'eval'), protocol = None, training_depends = False, models_depend = False):
_check_database(database, groups, protocol, training_depends, models_depend)
assert isinstance(database, bob.bio.base.database.DatabaseBobZT)
for group in groups:
t_model_ids = database.t_model_ids(group)
assert len(t_model_ids) > 0
assert database.client_id_from_model_id(t_model_ids[0]) is not None
assert len(database.t_enroll_files(t_model_ids[0], group)) > 0
assert len(database.z_probe_files(group)) > 0
def _check_annotations(database):
for file in database.all_files():
annotations = database.annotations(file)
if annotations is not None:
assert isinstance(annotations, dict)
assert 'reye' in annotations
assert 'leye' in annotations
def test_arface():
database = bob.bio.base.load_resource('arface', 'database')
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)
def test_atnt():
_check_database(bob.bio.base.load_resource('atnt', 'database'))
def test_banca():
database = bob.bio.base.load_resource('banca', 'database')
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)
def test_caspeal():
database = bob.bio.base.load_resource('caspeal', 'database')
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)
def test_frgc():
try:
database = bob.bio.base.load_resource('frgc', 'database')
except ValueError as e:
raise SkipTest("The database could not be opened, probably the original directory is wrong. Here is the value error: '%s'" % e)
_check_database(database, models_depend = True)
_check_database(database, protocol = '2.0.2', models_depend = True)
_check_annotations(database)
def test_gbu():
database = bob.bio.base.load_resource('gbu', 'database')
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)
def test_lfw():
database = bob.bio.base.load_resource('lfw-restricted', 'database')
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_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)
def test_mobio():
database = bob.bio.base.load_resource('mobio-image', 'database')
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)
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)
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)
def test_multipie():
# raise SkipTest('This test definitely takes too much time. If you want the tests enabled, please disable this exception temporarily.')
database = bob.bio.base.load_resource('multipie', 'database')
try:
_check_database_zt(database, training_depends = True)
_check_database_zt(bob.bio.base.load_resource('multipie-pose', 'database'), 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)
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)
def test_scface():
database = bob.bio.base.load_resource('scface', 'database')
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)
def test_xm2vts():
database = bob.bio.base.load_resource('xm2vts', 'database')
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)
...@@ -5,6 +5,17 @@ ...@@ -5,6 +5,17 @@
[buildout] [buildout]
parts = scripts parts = scripts
eggs = bob.bio.face eggs = bob.bio.face
bob.db.arface
bob.db.banca
bob.db.caspeal
bob.db.gbu
bob.db.frgc
bob.db.gbu
bob.db.lfw
bob.db.mobio
bob.db.multipie
bob.db.scface
bob.db.xm2vts
gridtk gridtk
extensions = bob.buildout extensions = bob.buildout
...@@ -33,6 +44,17 @@ develop = src/bob.extension ...@@ -33,6 +44,17 @@ develop = src/bob.extension
src/bob.learn.boosting src/bob.learn.boosting
src/bob.ip.facedetect src/bob.ip.facedetect
src/bob.ip.flandmark src/bob.ip.flandmark
src/bob.db.arface
src/bob.db.banca
src/bob.db.caspeal
src/bob.db.gbu
src/bob.db.frgc
src/bob.db.gbu
src/bob.db.lfw
src/bob.db.mobio
src/bob.db.multipie
src/bob.db.scface
src/bob.db.xm2vts
. .
; options for bob.buildout ; options for bob.buildout
...@@ -65,6 +87,18 @@ bob.learn.boosting = git https://github.com/bioidiap/bob.learn.boosting ...@@ -65,6 +87,18 @@ bob.learn.boosting = git https://github.com/bioidiap/bob.learn.boosting
bob.ip.facedetect = git https://github.com/bioidiap/bob.ip.facedetect bob.ip.facedetect = git https://github.com/bioidiap/bob.ip.facedetect
bob.ip.flandmark = git https://github.com/bioidiap/bob.ip.flandmark bob.ip.flandmark = git https://github.com/bioidiap/bob.ip.flandmark
bob.db.arface = git https://github.com/bioidiap/bob.db.arface
bob.db.banca = git https://github.com/bioidiap/bob.db.banca
bob.db.caspeal = git https://github.com/bioidiap/bob.db.caspeal
bob.db.gbu = git https://github.com/bioidiap/bob.db.gbu
bob.db.frgc = git https://github.com/bioidiap/bob.db.frgc
bob.db.gbu = git https://github.com/bioidiap/bob.db.gbu
bob.db.lfw = git https://github.com/bioidiap/bob.db.lfw
bob.db.mobio = git https://github.com/bioidiap/bob.db.mobio
bob.db.multipie = git https://github.com/bioidiap/bob.db.multipie
bob.db.scface = git https://github.com/bioidiap/bob.db.scface
bob.db.xm2vts = git https://github.com/bioidiap/bob.db.xm2vts
[scripts] [scripts]
recipe = bob.buildout:scripts recipe = bob.buildout:scripts
......
...@@ -106,6 +106,22 @@ setup( ...@@ -106,6 +106,22 @@ setup(
], ],
'bob.bio.database': [ 'bob.bio.database': [
'atnt = bob.bio.face.config.database.atnt:database',
'arface = bob.bio.face.config.database.arface:database',
'banca = bob.bio.face.config.database.banca_english:database',
'caspeal = bob.bio.face.config.database.caspeal:database',
'frgc = bob.bio.face.config.database.frgc:database',
'gbu = bob.bio.face.config.database.gbu:database',
'lfw-restricted = bob.bio.face.config.database.lfw_restricted:database',
'lfw-unrestricted = bob.bio.face.config.database.lfw_unrestricted:database',
'mobio-image = bob.bio.face.config.database.mobio_image:database',
'mobio-male = bob.bio.face.config.database.mobio_male:database', # MOBIO gender-dependent training
'mobio-female = bob.bio.face.config.database.mobio_female:database', # MOBIO gender-dependent training
'multipie = bob.bio.face.config.database.multipie:database',
'multipie-pose = bob.bio.face.config.database.multipie_pose:database',
'scface = bob.bio.face.config.database.scface:database',
'xm2vts = bob.bio.face.config.database.xm2vts:database',
], ],
'bob.bio.preprocessor': [ 'bob.bio.preprocessor': [
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment