Skip to content
Snippets Groups Projects
Commit f5d0d2f8 authored by Olegs NIKISINS's avatar Olegs NIKISINS
Browse files

Added config file for Replay-Mobile + doc to resources + entry point

parent 8dfd2640
No related branches found
No related tags found
1 merge request!4High Level Database Interface (HLDI) for Replay-Mobile + doc + unit tests
#!/usr/bin/env python
"""`Replay-Mobile`_ is a database for face PAD experiments.
The Replay-Mobile Database for face spoofing consists of 1030 video clips of photo and video attack attempts to 40 clients,
under different lighting conditions.
These videos were recorded with current devices from the market -- an iPad Mini2 (running iOS) and a LG-G4 smartphone (running Android).
This Database was produced at the Idiap Research Institute (Switzerland) within the framework
of collaboration with Galician Research and Development Center in Advanced Telecommunications - Gradiant (Spain).
The reference citation is [CBVM16]_.
You can download the raw data of the `Replay-Mobile`_ database by following
the link.
.. include:: links.rst
"""
from bob.pad.face.database import ReplayMobilePadDatabase
# Directory where the data files are stored.
# This directory is given in the .bob_bio_databases.txt file located in your home directory
original_directory = "[YOUR_REPLAY_MOBILE_DIRECTORY]"
"""Value of ``~/.bob_bio_databases.txt`` for this database"""
original_extension = ".mov" # extension of the data files
database = ReplayMobilePadDatabase(
protocol='grandtest',
original_directory=original_directory,
original_extension=original_extension,
training_depends_on_protocol=True,
)
"""The :py:class:`bob.pad.base.database.PadDatabase` derivative with Replay-Mobile
database settings.
.. warning::
This class only provides a programmatic interface to load data in an orderly
manner, respecting usage protocols. It does **not** contain the raw
data files. You should procure those yourself.
Notice that ``original_directory`` is set to ``[YOUR_REPLAY_MOBILE_DIRECTORY]``.
You must make sure to create ``${HOME}/.bob_bio_databases.txt`` setting this
value to the place where you actually installed the Replay-Mobile Database, as
explained in the section :ref:`bob.pad.face.baselines`.
"""
\ No newline at end of file
...@@ -22,3 +22,20 @@ def test_replay(): ...@@ -22,3 +22,20 @@ def test_replay():
except IOError as e: except IOError as e:
raise SkipTest( raise SkipTest(
"The database could not be queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e) "The database could not be queried; probably the db.sql3 file is missing. Here is the error: '%s'" % e)
@db_available('replay-mobile')
def test_replaymobile():
replaymobile = bob.bio.base.load_resource('replay-mobile', 'database', preferred_package='bob.pad.face', package_prefix='bob.pad.')
try:
assert len( replaymobile.objects(groups=['train', 'dev', 'eval']) )== 1030
assert len( replaymobile.objects(groups=['train', 'dev']) ) == 728
assert len( replaymobile.objects(groups=['train']) ) == 312
assert len( replaymobile.objects(groups=['train', 'dev', 'eval'], protocol = 'grandtest') )== 1030
assert len( replaymobile.objects(groups=['train', 'dev', 'eval'], protocol = 'grandtest', purposes='real') ) == 390
assert len( replaymobile.objects(groups=['train', 'dev', 'eval'], protocol = 'grandtest', purposes='attack') ) == 640
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)
\ No newline at end of file
...@@ -10,5 +10,6 @@ ...@@ -10,5 +10,6 @@
.. _installation: https://www.idiap.ch/software/bob/install .. _installation: https://www.idiap.ch/software/bob/install
.. _bob.pad.base: https://pypi.python.org/pypi/bob.pad.base .. _bob.pad.base: https://pypi.python.org/pypi/bob.pad.base
.. _replayattack: https://www.idiap.ch/dataset/replayattack .. _replayattack: https://www.idiap.ch/dataset/replayattack
.. _replay-mobile: https://www.idiap.ch/dataset/replay-mobile
.. _dependencies: https://gitlab.idiap.ch/bob/bob/wikis/Dependencies .. _dependencies: https://gitlab.idiap.ch/bob/bob/wikis/Dependencies
...@@ -24,12 +24,22 @@ These configuration files/resources contain entry points for the ``--database`` ...@@ -24,12 +24,22 @@ These configuration files/resources contain entry points for the ``--database``
.. _bob.pad.face.resources.databases.replay: .. _bob.pad.face.resources.databases.replay:
Replay-attack Database Replay-Attack Database
================================================================================ ================================================================================
.. automodule:: bob.pad.face.config.database.replay .. automodule:: bob.pad.face.config.database.replay
:members: :members:
.. _bob.pad.face.resources.databases.replay_mobile:
Replay-Mobile Database
================================================================================
.. automodule:: bob.pad.face.config.database.replay_mobile
:members:
--------------------------------- ---------------------------------
......
...@@ -96,6 +96,7 @@ setup( ...@@ -96,6 +96,7 @@ setup(
# registered databases: # registered databases:
'bob.pad.database': [ 'bob.pad.database': [
'replay = bob.pad.face.config.database.replay:database', 'replay = bob.pad.face.config.database.replay:database',
'replay-mobile = bob.pad.face.config.database.replay_mobile:database',
], ],
# registered configurations: # registered configurations:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment