Commit 9d25c860 authored by Amir Mohammadi's avatar Amir Mohammadi

Add replay mobile bob.db.replaymobile

parent 0fdbc700
#!/usr/bin/env python
from bob.bio.face.database import ReplayMobileBioDatabase
replay_mobile_directory = "[YOUR_REPLAY_MOBILE_DIRECTORY]"
replay_licit = ReplayMobileBioDatabase(
original_directory=replay_mobile_directory,
original_extension=".mov",
protocol='grandtest-licit',
)
replay_spoof = ReplayMobileBioDatabase(
original_directory=replay_mobile_directory,
original_extension=".mov",
protocol='grandtest-spoof',
)
......@@ -16,6 +16,7 @@ from .xm2vts import XM2VTSBioDatabase
from .frgc import FRGCBioDatabase
from .cuhk_cufs import CUHK_CUFSBioDatabase
from .scface import SCFaceBioDatabase
from .replaymobile import ReplayMobileBioDatabase
# gets sphinx autodoc done right - don't remove it
def __appropriate__(*args):
......
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
""" The Replay-Mobile Database for face spoofing implementation of
bob.bio.base.database.BioDatabase interface."""
from .database import FaceBioFile
from bob.bio.base.database import BioDatabase
class ReplayMobileBioFile(FaceBioFile):
"""FaceBioFile implementation of the Replay Mobile Database"""
def __init__(self, f):
super(FaceBioFile, self).__init__(client_id=f.client_id, path=f.path, file_id=f.id)
self._f = f
def load(self, directory=None, extension=None):
if extension in (None, '.mov'):
return self._f.load(directory, extension)
else:
return super(ReplayMobileBioFile, self).load(directory, extension)
class ReplayMobileBioDatabase(BioDatabase):
"""
Implements verification API for querying Replay Mobile database.
Please refer to low-level db self._db for more documentation
"""
__doc__ = __doc__
def __init__(self, max_number_of_frames=None, **kwargs):
# call base class constructors to open a session to the database
super(ReplayMobileBioDatabase, self).__init__(name='replay', **kwargs)
from bob.db.replaymobile.verificationprotocol import Database as LowLevelDatabase
self._db = LowLevelDatabase(max_number_of_frames)
def protocol_names(self):
return self._db.protocols()
def groups(self):
return self._db.groups()
def annotations(self, file):
return self._db.annotations(file)
def model_ids_with_protocol(self, groups=None, protocol=None, **kwargs):
return self._db.model_ids_with_protocol(groups, protocol, **kwargs)
def objects(self, groups=None, protocol=None, purposes=None, model_ids=None, **kwargs):
return self._db.objects(groups, protocol, purposes, model_ids, **kwargs)
......@@ -214,3 +214,14 @@ def test_replay():
except IOError as e:
raise SkipTest(
"The database could not be queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e)
@db_available('replaymobile')
def test_replaymobile():
database = bob.bio.base.load_resource('replaymobile', 'database', preferred_package='bob.bio.face')
try:
check_database(database, groups=('dev', 'eval'))
_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 error: '%s'" % e)
......@@ -4,7 +4,26 @@
[buildout]
parts = scripts
eggs = bob.bio.face
eggs = bob.extension
bob.blitz
bob.core
bob.io.base
bob.io.image
bob.learn.activation
bob.math
bob.learn.linear
bob.sp
bob.ip.base
bob.ip.color
bob.ip.draw
bob.ip.gabor
bob.learn.em
bob.measure
bob.db.base
bob.learn.boosting
bob.ip.facedetect
bob.ip.flandmark
bob.db.atnt
bob.db.arface
bob.db.banca
bob.db.caspeal
......@@ -16,8 +35,11 @@ eggs = bob.bio.face
bob.db.scface
bob.db.xm2vts
bob.db.replay
bob.db.replaymobile
gridtk
bob.bio.base
bob.bio.face
extensions = bob.buildout
mr.developer
auto-checkout = *
......@@ -37,11 +59,10 @@ develop = src/bob.extension
src/bob.learn.em
src/bob.measure
src/bob.db.base
src/bob.db.atnt
src/bob.bio.base
src/bob.learn.boosting
src/bob.ip.facedetect
src/bob.ip.flandmark
src/bob.db.atnt
src/bob.db.arface
src/bob.db.banca
src/bob.db.caspeal
......@@ -53,6 +74,10 @@ develop = src/bob.extension
src/bob.db.scface
src/bob.db.xm2vts
src/bob.db.replay
src/bob.db.replaymobile
src/gridtk
src/bob.bio.base
src/bob.bio.face
.
; options for bob.buildout
......@@ -68,31 +93,34 @@ bob.io.base = git https://gitlab.idiap.ch/bob/bob.io.base
bob.io.image = git https://gitlab.idiap.ch/bob/bob.io.image
bob.learn.activation = git https://gitlab.idiap.ch/bob/bob.learn.activation
bob.math = git https://gitlab.idiap.ch/bob/bob.math
bob.learn.linear = git https://gitlab.idiap.ch/bob/bob.learn.linear
bob.sp = git https://gitlab.idiap.ch/bob/bob.sp
bob.ip.base = git https://gitlab.idiap.ch/bob/bob.ip.base
bob.ip.color = git https://gitlab.idiap.ch/bob/bob.ip.color
bob.ip.draw = git https://gitlab.idiap.ch/bob/bob.ip.draw
bob.ip.gabor = git https://gitlab.idiap.ch/bob/bob.ip.gabor
bob.learn.linear = git https://gitlab.idiap.ch/bob/bob.learn.linear
bob.learn.em = git https://gitlab.idiap.ch/bob/bob.learn.em
bob.measure = git https://gitlab.idiap.ch/bob/bob.measure
bob.db.base = git https://gitlab.idiap.ch/bob/bob.db.base
bob.db.atnt = git https://gitlab.idiap.ch/bob/bob.db.atnt
bob.bio.base = git https://gitlab.idiap.ch/bob/bob.bio.base
bob.learn.boosting = git https://gitlab.idiap.ch/bob/bob.learn.boosting
bob.ip.facedetect = git https://gitlab.idiap.ch/bob/bob.ip.facedetect
bob.ip.flandmark = git https://gitlab.idiap.ch/bob/bob.ip.flandmark
bob.db.atnt = git https://gitlab.idiap.ch/bob/bob.db.atnt
bob.db.arface = git https://gitlab.idiap.ch/bob/bob.db.arface
bob.db.banca = git https://gitlab.idiap.ch/bob/bob.db.banca
bob.db.caspeal = git https://gitlab.idiap.ch/bob/bob.db.caspeal
bob.db.frgc = git https://gitlab.idiap.ch/bob/bob.db.frgc
bob.db.frgc = git https://gitlab.idiap.ch/bob/bob.db.frgc
bob.db.gbu = git https://gitlab.idiap.ch/bob/bob.db.gbu
bob.db.lfw = git https://gitlab.idiap.ch/bob/bob.db.lfw
bob.db.lfw = git https://gitlab.idiap.ch/bob/bob.db.lfw
bob.db.mobio = git https://gitlab.idiap.ch/bob/bob.db.mobio
bob.db.multipie = git https://gitlab.idiap.ch/bob/bob.db.multipie
bob.db.scface = git https://gitlab.idiap.ch/bob/bob.db.scface
bob.db.xm2vts = git https://gitlab.idiap.ch/bob/bob.db.xm2vts
bob.db.replay = git https://gitlab.idiap.ch/bob/bob.db.replay
bob.db.replaymobile = git https://gitlab.idiap.ch/bob/bob.db.replaymobile
gridtk = git https://gitlab.idiap.ch/bob/gridtk
bob.bio.base = git https://gitlab.idiap.ch/bob/bob.bio.base
bob.bio.face = git https://gitlab.idiap.ch/bob/bob.bio.face
[scripts]
recipe = bob.buildout:scripts
......
......@@ -124,6 +124,8 @@ setup(
'xm2vts = bob.bio.face.config.database.xm2vts:database',
'replay-img-licit = bob.bio.face.config.database.replay:replay_licit',
'replay-img-spoof = bob.bio.face.config.database.replay:replay_spoof',
'replaymobile-img-licit = bob.bio.face.config.database.replaymobile:replaymobile_licit',
'replaymobile-img-spoof = bob.bio.face.config.database.replaymobile:replaymobile_spoof',
],
'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