Commit 66054f8e authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Remove bob.db.msumfsd_mod

parent c407c4ad
Pipeline #45272 failed with stage
in 2 minutes and 17 seconds
#!/usr/bin/env python
from bob.bio.face.database import MsuMfsdModBioDatabase
from bob.bio.base.pipelines.vanilla_biometrics import DatabaseConnector
from bob.extension import rc
msu_mfsd_mod_directory = rc["bob.db.msu_mfsd.directory"]
msu_mfsd_mod_licit = DatabaseConnector(
MsuMfsdModBioDatabase(
original_directory=msu_mfsd_mod_directory,
original_extension=".mov",
protocol="grandtest-licit",
)
)
msu_mfsd_mod_spoof = DatabaseConnector(
MsuMfsdModBioDatabase(
original_directory=msu_mfsd_mod_directory,
original_extension=".mov",
protocol="grandtest-spoof",
)
)
......@@ -11,7 +11,6 @@ from .lfw import LFWBioDatabase
from .multipie import MultipieBioDatabase
from .ijbc import IJBCBioDatabase
from .replaymobile import ReplayMobileBioDatabase
from .msu_mfsd_mod import MsuMfsdModBioDatabase
from .fargo import FargoBioDatabase
......@@ -36,14 +35,13 @@ __appropriate__(
FaceBioFile,
MobioBioDatabase,
ReplayBioDatabase,
AtntBioDatabase,
AtntBioDatabase,
GBUBioDatabase,
ARFaceBioDatabase,
LFWBioDatabase,
MultipieBioDatabase,
IJBCBioDatabase,
IJBCBioDatabase,
ReplayMobileBioDatabase,
MsuMfsdModBioDatabase,
FargoBioDatabase
)
__all__ = [_ for _ in dir() if not _.startswith('_')]
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Amir Mohammadi <amir.mohammadi@idiap.ch>
from .database import FaceBioFile
from bob.bio.base.database import BioDatabase
class MsuMfsdModBioFile(FaceBioFile):
"""FaceBioFile implementation of the MSU_MFSD_MOD Database"""
def __init__(self, f):
super(MsuMfsdModBioFile, 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', '.mp4'):
return self._f.load(directory, extension)
else:
return super(MsuMfsdModBioFile, self).load(directory, extension)
class MsuMfsdModBioDatabase(BioDatabase):
"""
MsuMfsdMod database implementation of
:py:class:`bob.bio.base.database.BioDatabase` interface. It is an extension
of an SQL-based database interface, which directly talks to MsuMfsdMod
database, for verification experiments (good to use in bob.bio.base
framework).
"""
def __init__(self, max_number_of_frames=None, **kwargs):
from bob.db.msu_mfsd_mod.verificationprotocol import Database \
as LowLevelDatabase
self._db = LowLevelDatabase(max_number_of_frames)
# call base class constructors to open a session to the database
super(MsuMfsdModBioDatabase, self).__init__(
name='msu-mfsd-mod', **kwargs)
self._kwargs['max_number_of_frames'] = max_number_of_frames
@property
def original_directory(self):
return self._db.original_directory
@original_directory.setter
def original_directory(self, value):
self._db.original_directory = value
def protocol_names(self):
return self._db.protocols()
def groups(self):
return self._db.groups()
def annotations(self, myfile):
"""
Will return the bounding box annotation of nth frame of the video.
"""
fn = myfile._f.framen
# Frame index, 4 coordinates of the face rectangle (left, top, right,
# bottom), 4 coordinates of the left and right eyes (xleft, yleft
# xright, yright).
annots = myfile._f._f.bbx(directory=self.original_directory)
annotations = {'leye': (annots[fn][8], annots[fn][7]),
'reye': (annots[fn][6], annots[fn][5])}
return annotations
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):
retval = self._db.objects(
groups, protocol, purposes, model_ids, **kwargs)
return [MsuMfsdModBioFile(f) for f in retval]
def arrange_by_client(self, files):
client_files = {}
for file in files:
if str(file.client_id) not in client_files:
client_files[str(file.client_id)] = []
client_files[str(file.client_id)].append(file)
files_by_clients = []
for client in sorted(client_files.keys()):
files_by_clients.append(client_files[client])
return files_by_clients
......@@ -229,42 +229,6 @@ def test_replaymobile_spoof():
"The annotations could not be queried; probably the annotation files are missing. Here is the error: '%s'" % e)
@db_available('msu_mfsd_mod')
def test_msu_mfsd_mod_licit():
database = bob.bio.base.load_resource(
'msu-mfsd-mod-licit', 'database', preferred_package='bob.bio.face')
try:
check_database(database, groups=('dev', 'eval'))
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)
try:
_check_annotations(database, topleft=False, limit_files=20)
except IOError as e:
raise SkipTest(
"The annotations could not be queried; probably the annotation "
"files are missing. Here is the error: '%s'" % e)
@db_available('msu_mfsd_mod')
def test_msu_mfsd_mod_spoof():
database = bob.bio.base.load_resource(
'msu-mfsd-mod-spoof', 'database', preferred_package='bob.bio.face')
try:
check_database(database, groups=('dev', 'eval'))
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)
try:
_check_annotations(database, topleft=False, limit_files=20)
except IOError as e:
raise SkipTest(
"The annotations could not be queried; probably the annotation "
"files are missing. Here is the error: '%s'" % e)
@db_available('ijbc')
def test_ijbc():
database = bob.bio.base.load_resource(
......
......@@ -77,7 +77,6 @@ test:
- bob.db.ijbc
- bob.db.lfw
- bob.db.mobio
- bob.db.msu_mfsd_mod
- bob.db.multipie
- bob.db.replay
- bob.db.replaymobile
......
......@@ -161,10 +161,6 @@ Here is the list of files and replacement strings for all databases that are reg
- Complete directory: ``[YOUR_REPLAY_MOBILE_DIRECTORY]``
* MSU MFSD Modified ``'msu-mfsd-mod-licit'``, ``'msu-mfsd-mod-spoof'``
- Complete directory: ``[YOUR_MSU_MFSD_MOD_DIRECTORY]``
* SC face: ``'scface'``
- Images: ``[YOUR_SC_FACE_DIRECTORY]``
......
......@@ -17,7 +17,6 @@ Databases
bob.bio.face.database.CaspealBioDatabase
bob.bio.face.database.ReplayBioDatabase
bob.bio.face.database.ReplayMobileBioDatabase
bob.bio.face.database.MsuMfsdModBioDatabase
bob.bio.face.database.GBUBioDatabase
bob.bio.face.database.LFWBioDatabase
bob.bio.face.database.MultipieBioDatabase
......
......@@ -116,15 +116,13 @@ setup(
'lfw-unrestricted = bob.bio.face.config.database.lfw_unrestricted:database',
'mobio-male = bob.bio.face.config.database.mobio_male:database',
'mobio-all = bob.bio.face.config.database.mobio_all:database',
'msu-mfsd-mod-licit = bob.bio.face.config.database.msu_mfsd_mod:msu_mfsd_mod_licit',
'msu-mfsd-mod-spoof = bob.bio.face.config.database.msu_mfsd_mod:msu_mfsd_mod_spoof',
'multipie = bob.bio.face.config.database.multipie:database',
'multipie-pose = bob.bio.face.config.database.multipie_pose: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',
'fargo = bob.bio.face.config.database.fargo:database',
],
......@@ -184,15 +182,13 @@ setup(
'lfw-unrestricted = bob.bio.face.config.database.lfw_unrestricted',
'mobio-male = bob.bio.face.config.database.mobio_male',
'mobio-all = bob.bio.face.config.database.mobio_all',
'msu-mfsd-mod-licit = bob.bio.face.config.database.msu_mfsd_mod',
'msu-mfsd-mod-spoof = bob.bio.face.config.database.msu_mfsd_mod',
'multipie = bob.bio.face.config.database.multipie',
'multipie-pose = bob.bio.face.config.database.multipie_pose',
'replay-img-licit = bob.bio.face.config.database.replay',
'replay-img-spoof = bob.bio.face.config.database.replay',
'replaymobile-img-licit = bob.bio.face.config.database.replaymobile',
'replaymobile-img-spoof = bob.bio.face.config.database.replaymobile',
'fargo = bob.bio.face.config.database.fargo',
],
......
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