Commit aa4903a7 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

[refactoring2016] Moved highlevel interface to bob.bio.face

parent c988740d
Pipeline #3651 failed with stages
in 72 minutes and 32 seconds
......@@ -33,7 +33,7 @@ variables:
variables: &build_variables
BOB_DOCUMENTATION_SERVER: "http://www.idiap.ch/software/bob/docs/latest/bob/%s/master/"
script:
- ./bin/buildout
- ./bin/buildout -c buildout-dev.cfg
- if [ -x ./bin/bob_dbmanage.py ]; then ./bin/bob_dbmanage.py all download --force; fi
- ./bin/sphinx-build doc sphinx
- ./bin/python setup.py bdist_wheel --python-tag ${WHEEL_TAG}
......
#!/usr/bin/env python
from bob.bio.face.database import ARFaceBioDatabase
arface_directory = "[YOUR_ARFACE_DIRECTORY]"
database = ARFaceBioDatabase(
original_directory=arface_directory,
original_extension=".png",
protocol='all'
)
#!/usr/bin/env python
from bob.bio.face.database import AtntBioDatabase
atnt_directory = "[YOUR_ATNT_DIRECTORY]"
database = AtntBioDatabase(
original_directory=atnt_directory,
)
#!/usr/bin/env python
from bob.bio.face.database import BancaBioDatabase
banca_directory = "[YOUR_BANCA_DIRECTORY]"
database = BancaBioDatabase(
original_directory=banca_directory,
original_extension=".ppm",
protocol='P'
)
#!/usr/bin/env python
from bob.bio.face.database import CaspealBioDatabase
caspeal_directory = "[YOUR_CAS-PEAL_DIRECTORY]"
database = CaspealBioDatabase(
original_directory=caspeal_directory,
protocol='lighting'
)
#!/usr/bin/env python
from bob.bio.face.database import FRGCBioDatabase
frgc_directory = "[YOUR_FRGC_DIRECTORY]"
database = FRGCBioDatabase(
original_directory=frgc_directory,
protocol='2.0.1',
models_depend_on_protocol=True
)
#!/usr/bin/env python
from bob.bio.face.database import GBUBioDatabase
mbgc_v1_directory = "[YOUR_MBGC-V1_DIRECTORY]"
database = GBUBioDatabase(
original_directory=mbgc_v1_directory,
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
from bob.bio.face.database import LFWBioDatabase
lfw_directory = "[YOUR_LFW_FUNNELED_DIRECTORY]"
database = LFWBioDatabase(
original_directory=lfw_directory,
annotation_type='funneled',
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
from bob.bio.face.database import LFWBioDatabase
lfw_directory = "[YOUR_LFW_FUNNELED_DIRECTORY]"
database = LFWBioDatabase(
original_directory=lfw_directory,
annotation_type='funneled',
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
from bob.bio.face.database import MobioBioDatabase
mobio_image_directory = "[YOUR_MOBIO_IMAGE_DIRECTORY]"
mobio_annotation_directory = "[YOUR_MOBIO_ANNOTATION_DIRECTORY]"
database = MobioBioDatabase(
original_directory=mobio_image_directory,
original_extension=".png",
annotation_directory=mobio_annotation_directory,
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
from bob.bio.face.database import MobioBioDatabase
mobio_image_directory = "[YOUR_MOBIO_IMAGE_DIRECTORY]"
mobio_annotation_directory = "[YOUR_MOBIO_ANNOTATION_DIRECTORY]"
database = MobioBioDatabase(
original_directory=mobio_image_directory,
original_extension=".png",
annotation_directory=mobio_annotation_directory,
protocol='male',
models_depend_on_protocol = True,
)
#!/usr/bin/env python
from bob.bio.face.database import MobioBioDatabase
mobio_image_directory = "[YOUR_MOBIO_IMAGE_DIRECTORY]"
mobio_annotation_directory = "[YOUR_MOBIO_ANNOTATION_DIRECTORY]"
database = MobioBioDatabase(
original_directory=mobio_image_directory,
original_extension=".png",
annotation_directory=mobio_annotation_directory,
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
from bob.bio.face.database import MultipieBioDatabase
multipie_image_directory = "[YOUR_MULTI-PIE_IMAGE_DIRECTORY]"
multipie_annotation_directory = "[YOUR_MULTI-PIE_ANNOTATION_DIRECTORY]"
database = MultipieBioDatabase(
original_directory=multipie_image_directory,
annotation_directory=multipie_annotation_directory,
protocol='U',
training_depends_on_protocol = True
)
#!/usr/bin/env python
from bob.bio.face.database import MultipieBioDatabase
# 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')
multipie_image_directory = "[YOUR_MULTI-PIE_IMAGE_DIRECTORY]"
multipie_annotation_directory = "[YOUR_MULTI-PIE_ANNOTATION_DIRECTORY]"
database = MultipieBioDatabase(
original_directory=multipie_image_directory,
annotation_directory=multipie_annotation_directory,
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
from bob.bio.face.database import SCFaceBioDatabase
scface_directory = "[YOUR_SC_FACE_DIRECTORY]"
database = SCFaceBioDatabase(
original_directory=scface_directory,
protocol='combined'
)
#!/usr/bin/env python
from bob.bio.face.database import XM2VTSBioDatabase
xm2vts_directory = "[YOUR_XM2VTS_DIRECTORY]"
database = XM2VTSBioDatabase(
original_directory=xm2vts_directory,
protocol='lp1'
)
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
from .mobio import MobioBioDatabase
from .replay import ReplayBioDatabase
from .atnt import AtntBioDatabase
from .banca import BancaBioDatabase
from .gbu import GBUBioDatabase
from .arface import ARFaceBioDatabase
from .caspeal import CaspealBioDatabase
from .lfw import LFWBioDatabase
from .multipie import MultipieBioDatabase
from .ijba import IJBABioDatabase
from .xm2vts import XM2VTSBioDatabase
from .frgc import FRGCBioDatabase
from .cuhk_cufs import CUHK_CUFSBioDatabase
from .scface import SCFaceBioDatabase
# gets sphinx autodoc done right - don't remove it
__all__ = [_ for _ in dir() if not _.startswith('_')]
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Tiago de Freitas Pereira <tiago.pereira@idiap.ch>
# Sat 20 Aug 15:43:10 CEST 2016
"""
ARFACE database implementation of bob.bio.base.database.ZTDatabase interface.
It is an extension of an SQL-based database interface, which directly talks to ARFACE database, for
verification experiments (good to use in bob.bio.base framework).
"""
from .database import FaceBioFile
from bob.bio.base.database import BioDatabase, BioFile
class ARFaceBioDatabase(BioDatabase):
"""
Implements verification API for querying ARFACE database.
"""
def __init__(
self,
**kwargs
):
# call base class constructors to open a session to the database
super(ARFaceBioDatabase, self).__init__(name='arface', **kwargs)
from bob.db.arface.query import Database as LowLevelDatabase
self.__db = LowLevelDatabase()
def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs):
return self.__db.model_ids(groups=groups, protocol=protocol)
def objects(self, groups=None, protocol=None, purposes=None, model_ids=None, **kwargs):
retval = self.__db.objects(groups=groups, protocol=protocol, purposes=purposes, model_ids=model_ids, **kwargs)
return [FaceBioFile(BioFile(client_id=f.client_id, path=f.path, file_id=f.id)) for f in retval]
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Amir Mohammadi <amir.mohammadi@idiap.ch>
# Wed 13 Jul 16:43:22 CEST 2016
"""
Atnt database implementation of bob.bio.base.database.Database interface.
It is an extension of an SQL-based database interface, which directly talks to Atnt database, for
verification experiments (good to use in bob.bio.base framework).
"""
from .database import FaceBioFile
from bob.bio.base.database import BioDatabase, BioFile
class AtntBioDatabase(BioDatabase):
"""
Implements verification API for querying Atnt database.
"""
def __init__(
self,
**kwargs
):
# call base class constructors to open a session to the database
super(AtntBioDatabase, self).__init__(name='atnt', **kwargs)
from bob.db.atnt.query import Database as LowLevelDatabase
self.__db = LowLevelDatabase()
def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs):
return self.__db.model_ids(groups=groups, protocol=protocol)
def objects(self, groups=None, protocol=None, purposes=None, model_ids=None, **kwargs):
retval = self.__db.objects(groups=groups, protocol=protocol, purposes=purposes, model_ids=model_ids, **kwargs)
return [FaceBioFile(f) for f in retval]
Supports Markdown
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