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

Merge branch 'dev_branch' into 'master'

Added configuration files for all databases, updated the doc accordingly

Closes #2 and #3

See merge request !11
parents fa40c092 3f2ec445
No related branches found
No related tags found
1 merge request!11Added configuration files for all databases, updated the doc accordingly
Pipeline #
Showing with 299 additions and 162 deletions
#!/usr/bin/env python
"""Aggregated Db is a database for face PAD experiments.
This database aggregates the data from 3 publicly available data-sets:
`REPLAYATTACK`_, `REPLAY-MOBILE`_ and `MSU MFSD`_.
You can download the data for the above databases by following the corresponding
links.
The reference citation for the `REPLAYATTACK`_ is [CAM12]_.
The reference citation for the `REPLAY-MOBILE`_ is [CBVM16]_.
The reference citation for the `MSU MFSD`_ is [WHJ15]_.
.. include:: links.rst
"""
from bob.pad.face.database import AggregatedDbPadDatabase
# 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_AGGREGATED_DB_DIRECTORIES]"
"""Value of ``~/.bob_bio_databases.txt`` for this database"""
ORIGINAL_EXTENSION = ".mov" # extension of the data files
database = AggregatedDbPadDatabase(
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 Aggregated Db
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_AGGREGATED_DB_DIRECTORIES]``.
You must make sure to create ``${HOME}/.bob_bio_databases.txt`` file setting this
value to the places where you actually installed the Replay-Attack, Replay-Mobile
and MSU MFSD Databases. In particular, the paths pointing to these 3 databases
must be separated with a space. See the following note with an example of
``[YOUR_AGGREGATED_DB_DIRECTORIES]`` entry in the ``${HOME}/.bob_bio_databases.txt`` file.
.. note::
[YOUR_AGGREGATED_DB_DIRECTORIES] = <PATH_TO_REPLAY_ATTACK> <PATH_TO_REPLAY_MOBILE> <PATH_TO_MSU_MFSD>
"""
protocol = 'grandtest'
"""The default protocol to use for reproducing the baselines.
You may modify this at runtime by specifying the option ``--protocol`` on the
command-line of ``spoof.py`` or using the keyword ``protocol`` on a
configuration file that is loaded **after** this configuration resource.
"""
groups = ["train", "dev", "eval"]
"""The default groups to use for reproducing the baselines.
You may modify this at runtime by specifying the option ``--groups`` on the
command-line of ``spoof.py`` or using the keyword ``groups`` on a
configuration file that is loaded **after** this configuration resource.
"""
...@@ -11,18 +11,9 @@ kernel_type = 'RBF' ...@@ -11,18 +11,9 @@ kernel_type = 'RBF'
n_samples = 10000 n_samples = 10000
# trainer_grid_search_params = {'cost': [2**p for p in range(-5, 16, 2)], 'gamma': [2**p for p in range(-15, 4, 2)]} # trainer_grid_search_params = {'cost': [2**p for p in range(-5, 16, 2)], 'gamma': [2**p for p in range(-15, 4, 2)]}
trainer_grid_search_params = {'cost': [2**p for p in range(-3, 14, 2)], 'gamma': [2**p for p in range(-15, 0, 2)]} trainer_grid_search_params = {'cost': [2**p for p in range(-3, 14, 2)], 'gamma': [2**p for p in range(-15, 0, 2)]}
mean_std_norm_flag = False mean_std_norm_flag = True
frame_level_scores_flag = False # one score per video(!) in this case frame_level_scores_flag = False # one score per video(!) in this case
video_svm_pad_algorithm_10k_grid = VideoSvmPadAlgorithm(machine_type = machine_type,
kernel_type = kernel_type,
n_samples = n_samples,
trainer_grid_search_params = trainer_grid_search_params,
mean_std_norm_flag = mean_std_norm_flag,
frame_level_scores_flag = frame_level_scores_flag)
mean_std_norm_flag = True # enable mean-std normalization
video_svm_pad_algorithm_10k_grid_mean_std = VideoSvmPadAlgorithm(machine_type = machine_type, video_svm_pad_algorithm_10k_grid_mean_std = VideoSvmPadAlgorithm(machine_type = machine_type,
kernel_type = kernel_type, kernel_type = kernel_type,
n_samples = n_samples, n_samples = n_samples,
...@@ -46,4 +37,4 @@ video_svm_pad_algorithm_default_svm_param_mean_std_frame_level = VideoSvmPadAlgo ...@@ -46,4 +37,4 @@ video_svm_pad_algorithm_default_svm_param_mean_std_frame_level = VideoSvmPadAlgo
n_samples = n_samples, n_samples = n_samples,
trainer_grid_search_params = trainer_grid_search_params, trainer_grid_search_params = trainer_grid_search_params,
mean_std_norm_flag = mean_std_norm_flag, mean_std_norm_flag = mean_std_norm_flag,
frame_level_scores_flag = frame_level_scores_flag) frame_level_scores_flag = frame_level_scores_flag)
\ No newline at end of file
...@@ -12,8 +12,5 @@ overlap=0 ...@@ -12,8 +12,5 @@ overlap=0
frame_diff_feat_extr_w20_over0 = FrameDiffFeatures(window_size=window_size, frame_diff_feat_extr_w20_over0 = FrameDiffFeatures(window_size=window_size,
overlap=overlap) overlap=overlap)
window_size=100
frame_diff_feat_extr_w100_over0 = FrameDiffFeatures(window_size=window_size,
overlap=overlap)
#!/usr/bin/env python
"""`MSU MFSD`_ is a database for face PAD experiments.
Database created at MSU, for face-PAD experiments. The public version of the database contains
280 videos corresponding to 35 clients. The videos are grouped as 'genuine' and 'attack'.
The attack videos have been constructed from the genuine ones,
and consist of three kinds: print, iPad (video-replay), and iPhone (video-replay).
Face-locations are also provided for each frame of each video, but some (6 videos) face-locations are not reliable,
because the videos are not correctly oriented.
The reference citation is [WHJ15]_.
You can download the raw data of the `MSU MFSD`_ database by following
the link.
.. include:: links.rst
"""
from bob.pad.face.database import MsuMfsdPadDatabase
# 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_MSU_MFSD_DIRECTORY]"
"""Value of ``~/.bob_bio_databases.txt`` for this database"""
ORIGINAL_EXTENSION = "none" # extension is not used to load the data in the HLDI of this database
database = MsuMfsdPadDatabase(
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 MSU MFSD
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_MSU_MFSD_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`.
"""
protocol = 'grandtest'
"""The default protocol to use for reproducing the baselines.
You may modify this at runtime by specifying the option ``--protocol`` on the
command-line of ``spoof.py`` or using the keyword ``protocol`` on a
configuration file that is loaded **after** this configuration resource.
"""
groups = ["train", "dev", "eval"]
"""The default groups to use for reproducing the baselines.
You may modify this at runtime by specifying the option ``--groups`` on the
command-line of ``spoof.py`` or using the keyword ``groups`` on a
configuration file that is loaded **after** this configuration resource.
"""
#!/usr/bin/env python
from bob.pad.face.preprocessor import FrameDifference
#=======================================================================================
# Define instances here:
NUMBER_OF_FRAMES = 200 # process at most 200 frames
CHECK_FACE_SIZE_FLAG = True # Check size of the face
MIN_FACE_SIZE = 50
frame_diff_min_size_50_200_frames = FrameDifference(number_of_frames = NUMBER_OF_FRAMES,
check_face_size_flag = CHECK_FACE_SIZE_FLAG,
min_face_size = MIN_FACE_SIZE)
#!/usr/bin/env python
from bob.pad.face.preprocessor import VideoFaceCrop
#=======================================================================================
# Define instances here:
cropped_image_size = (64, 64) # The size of the resulting face
cropped_positions = {'topleft' : (0,0) , 'bottomright' : cropped_image_size}
fixed_positions = None
mask_sigma = None # The sigma for random values areas outside image
mask_neighbors = 5 # The number of neighbors to consider while extrapolating
mask_seed = None # The seed for generating random values during extrapolation
check_face_size_flag = False # Don't check the size of the face
min_face_size = 50
use_local_cropper_flag = False # Use the cropper of bob.bio.face
color_channel = 'gray' # Convert image to gray-scale format
video_face_crop_preproc_64_64 = VideoFaceCrop(cropped_image_size = cropped_image_size,
cropped_positions = cropped_positions,
fixed_positions = fixed_positions,
mask_sigma = mask_sigma,
mask_neighbors = mask_neighbors,
mask_seed = None,
check_face_size_flag = check_face_size_flag,
min_face_size = min_face_size,
use_local_cropper_flag = use_local_cropper_flag,
color_channel = color_channel)
check_face_size_flag = True # Check the size of the face
min_face_size = 50
video_face_crop_preproc_64_64_face_50 = VideoFaceCrop(cropped_image_size = cropped_image_size,
cropped_positions = cropped_positions,
fixed_positions = fixed_positions,
mask_sigma = mask_sigma,
mask_neighbors = mask_neighbors,
mask_seed = None,
check_face_size_flag = check_face_size_flag,
min_face_size = min_face_size,
use_local_cropper_flag = use_local_cropper_flag,
color_channel = color_channel)
use_local_cropper_flag = True # Use the local face cropping class (identical to Ivana's paper)
video_face_crop_preproc_64_64_face_50_local_cropper = VideoFaceCrop(cropped_image_size = cropped_image_size,
cropped_positions = cropped_positions,
fixed_positions = fixed_positions,
mask_sigma = mask_sigma,
mask_neighbors = mask_neighbors,
mask_seed = None,
check_face_size_flag = check_face_size_flag,
min_face_size = min_face_size,
use_local_cropper_flag = use_local_cropper_flag,
color_channel = color_channel)
rgb_output_flag = True # Return RGB cropped face using local cropper
video_face_crop_preproc_64_64_face_50_local_cropper_rgb = VideoFaceCrop(cropped_image_size = cropped_image_size,
cropped_positions = cropped_positions,
fixed_positions = fixed_positions,
mask_sigma = mask_sigma,
mask_neighbors = mask_neighbors,
mask_seed = None,
check_face_size_flag = check_face_size_flag,
min_face_size = min_face_size,
use_local_cropper_flag = use_local_cropper_flag,
rgb_output_flag = rgb_output_flag)
\ No newline at end of file
#!/usr/bin/env python
"""`Replayattack`_ is a database for face PAD experiments.
The Replay-Attack Database for face spoofing consists of 1300 video clips of photo and video attack attempts to 50 clients,
under different lighting conditions. This Database was produced at the Idiap Research Institute, in Switzerland.
The reference citation is [CAM12]_.
You can download the raw data of the `Replayattack`_ database by following
the link.
.. include:: links.rst
"""
from bob.pad.face.database import ReplayPadDatabase
# 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_ATTACK_DIRECTORY]"
"""Value of ``~/.bob_bio_databases.txt`` for this database"""
ORIGINAL_EXTENSION = ".mov" # extension of the data files
database = ReplayPadDatabase(
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 Replayattack
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_ATTACK_DIRECTORY]``.
You must make sure to create ``${HOME}/.bob_bio_databases.txt`` setting this
value to the place where you actually installed the Replayattack Database, as
explained in the section :ref:`bob.pad.face.baselines`.
"""
protocol = 'grandtest'
"""The default protocol to use for reproducing the baselines.
You may modify this at runtime by specifying the option ``--protocol`` on the
command-line of ``spoof.py`` or using the keyword ``protocol`` on a
configuration file that is loaded **after** this configuration resource.
"""
groups = ["train", "dev", "eval"]
"""The default groups to use for reproducing the baselines.
You may modify this at runtime by specifying the option ``--groups`` on the
command-line of ``spoof.py`` or using the keyword ``groups`` on a
configuration file that is loaded **after** this configuration resource.
"""
#!/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`.
"""
protocol = 'grandtest'
"""The default protocol to use for reproducing the baselines.
You may modify this at runtime by specifying the option ``--protocol`` on the
command-line of ``spoof.py`` or using the keyword ``protocol`` on a
configuration file that is loaded **after** this configuration resource.
"""
groups = ["train", "dev", "eval"]
"""The default groups to use for reproducing the baselines.
You may modify this at runtime by specifying the option ``--groups`` on the
command-line of ``spoof.py`` or using the keyword ``groups`` on a
configuration file that is loaded **after** this configuration resource.
"""
...@@ -19,7 +19,7 @@ To see the description of the script you can type in the console: ...@@ -19,7 +19,7 @@ To see the description of the script you can type in the console:
.. code-block:: sh .. code-block:: sh
$ ./bin/verify.py --help $ spoof.py --help
This script is explained in more detail in :ref:`bob.pad.base.experiments`. This script is explained in more detail in :ref:`bob.pad.base.experiments`.
...@@ -85,6 +85,7 @@ Baselines on REPLAY-ATTACK database ...@@ -85,6 +85,7 @@ Baselines on REPLAY-ATTACK database
-------------------------------------- --------------------------------------
This section summarizes the results of baseline face PAD experiments on the REPLAY-ATTACK (`replayattack`_) database. This section summarizes the results of baseline face PAD experiments on the REPLAY-ATTACK (`replayattack`_) database.
The description of the database-related settings, which are used to run face PAD baselines on the Replay-Attack is given here :ref:`bob.pad.face.resources.databases.replay`. To understand the settings in more details you can check the corresponding configuration file : ``bob/pad/face/config/replay_attack.py``.
LBP features of facial region + SVM classifier LBP features of facial region + SVM classifier
...@@ -96,8 +97,7 @@ To run this baseline on the `replayattack`_ database, using the ``grandtest`` pr ...@@ -96,8 +97,7 @@ To run this baseline on the `replayattack`_ database, using the ``grandtest`` pr
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py lbp-svm \ $ spoof.py replay-attack lbp-svm \
--database replay --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -107,8 +107,7 @@ To run this baseline on the `replayattack`_ database, using the ``grandtest`` pr ...@@ -107,8 +107,7 @@ To run this baseline on the `replayattack`_ database, using the ``grandtest`` pr
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py lbp-svm \ $ spoof.py replay-attack lbp-svm \
--database replay --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> \ --sub-directory <PATH_TO_STORE_THE_RESULTS> \
--grid idiap --grid idiap
...@@ -120,7 +119,7 @@ following command: ...@@ -120,7 +119,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "LBP features of facial region + SVM classifier + REPLAY-ATTACK database" \ --legends "LBP features of facial region + SVM classifier + REPLAY-ATTACK database" \
...@@ -153,8 +152,7 @@ To run this baseline on the `replayattack`_ database, using the ``grandtest`` pr ...@@ -153,8 +152,7 @@ To run this baseline on the `replayattack`_ database, using the ``grandtest`` pr
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py qm-svm \ $ spoof.py replay-attack qm-svm \
--database replay --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -169,7 +167,7 @@ following command: ...@@ -169,7 +167,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "IQM features of facial region + SVM classifier + REPLAY-ATTACK database" \ --legends "IQM features of facial region + SVM classifier + REPLAY-ATTACK database" \
...@@ -201,8 +199,7 @@ To run this baseline on the `replayattack`_ database, using the ``grandtest`` pr ...@@ -201,8 +199,7 @@ To run this baseline on the `replayattack`_ database, using the ``grandtest`` pr
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py frame-diff-svm \ $ spoof.py replay-attack frame-diff-svm \
--database replay --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -217,7 +214,7 @@ following command: ...@@ -217,7 +214,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "10 features for each window in Frame Differences + SVM classifier + REPLAY-ATTACK database" \ --legends "10 features for each window in Frame Differences + SVM classifier + REPLAY-ATTACK database" \
...@@ -245,8 +242,7 @@ Baselines on REPLAY-MOBILE database ...@@ -245,8 +242,7 @@ Baselines on REPLAY-MOBILE database
-------------------------------------- --------------------------------------
This section summarizes the results of baseline face PAD experiments on the `Replay-Mobile`_ database. This section summarizes the results of baseline face PAD experiments on the `Replay-Mobile`_ database.
The description of the database instance, which can be used to run face PAD experiments on the Replay-Mobile is given The description of the database-related settings, which are used to run face PAD baselines on the Replay-Mobile is given here :ref:`bob.pad.face.resources.databases.replay_mobile`. To understand the settings in more details you can check the corresponding configuration file : ``bob/pad/face/config/replay_mobile.py``.
here :ref:`bob.pad.face.resources.databases.replay_mobile`.
LBP features of facial region + SVM classifier LBP features of facial region + SVM classifier
...@@ -259,8 +255,7 @@ To run this baseline on the `Replay-Mobile`_ database, using the ``grandtest`` p ...@@ -259,8 +255,7 @@ To run this baseline on the `Replay-Mobile`_ database, using the ``grandtest`` p
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py lbp-svm \ $ spoof.py replay-mobile lbp-svm \
--database replay-mobile --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -275,7 +270,7 @@ following command: ...@@ -275,7 +270,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "LBP features of facial region + SVM classifier + Replay-Mobile database" \ --legends "LBP features of facial region + SVM classifier + Replay-Mobile database" \
...@@ -308,8 +303,7 @@ To run this baseline on the `Replay-Mobile`_ database, using the ``grandtest`` p ...@@ -308,8 +303,7 @@ To run this baseline on the `Replay-Mobile`_ database, using the ``grandtest`` p
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py qm-svm \ $ spoof.py replay-mobile qm-svm \
--database replay-mobile --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -324,7 +318,7 @@ following command: ...@@ -324,7 +318,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "IQM features of facial region + SVM classifier + Replay-Mobile database" \ --legends "IQM features of facial region + SVM classifier + Replay-Mobile database" \
...@@ -357,8 +351,7 @@ To run this baseline on the `Replay-Mobile`_ database, using the ``grandtest`` p ...@@ -357,8 +351,7 @@ To run this baseline on the `Replay-Mobile`_ database, using the ``grandtest`` p
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py frame-diff-svm \ $ spoof.py replay-mobile frame-diff-svm \
--database replay-mobile --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -373,7 +366,7 @@ following command: ...@@ -373,7 +366,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "10 features for each window in Frame Differences + SVM classifier + Replay-Mobile database" \ --legends "10 features for each window in Frame Differences + SVM classifier + Replay-Mobile database" \
...@@ -401,8 +394,7 @@ Baselines on MSU MFSD database ...@@ -401,8 +394,7 @@ Baselines on MSU MFSD database
-------------------------------------- --------------------------------------
This section summarizes the results of baseline face PAD experiments on the `MSU MFSD`_ database. This section summarizes the results of baseline face PAD experiments on the `MSU MFSD`_ database.
The description of the database instance, which can be used to run face PAD experiments on the MSU MFSD is given The description of the database-related settings, which are used to run face PAD baselines on the MSU MFSD is given here :ref:`bob.pad.face.resources.databases.msu_mfsd`. To understand the settings in more details you can check the corresponding configuration file : ``bob/pad/face/config/msu_mfsd.py``.
here :ref:`bob.pad.face.resources.databases.msu_mfsd`.
LBP features of facial region + SVM classifier LBP features of facial region + SVM classifier
...@@ -415,8 +407,7 @@ To run this baseline on the `MSU MFSD`_ database, using the ``grandtest`` protoc ...@@ -415,8 +407,7 @@ To run this baseline on the `MSU MFSD`_ database, using the ``grandtest`` protoc
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py lbp-svm \ $ spoof.py msu-mfsd lbp-svm \
--database msu-mfsd --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -431,7 +422,7 @@ following command: ...@@ -431,7 +422,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "LBP features of facial region + SVM classifier + MSU MFSD database" \ --legends "LBP features of facial region + SVM classifier + MSU MFSD database" \
...@@ -464,8 +455,7 @@ To run this baseline on the `MSU MFSD`_ database, using the ``grandtest`` protoc ...@@ -464,8 +455,7 @@ To run this baseline on the `MSU MFSD`_ database, using the ``grandtest`` protoc
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py qm-svm \ $ spoof.py msu-mfsd qm-svm \
--database msu-mfsd --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -480,7 +470,7 @@ following command: ...@@ -480,7 +470,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "IQM features of facial region + SVM classifier + MSU MFSD database" \ --legends "IQM features of facial region + SVM classifier + MSU MFSD database" \
...@@ -513,8 +503,7 @@ To run this baseline on the `MSU MFSD`_ database, using the ``grandtest`` protoc ...@@ -513,8 +503,7 @@ To run this baseline on the `MSU MFSD`_ database, using the ``grandtest`` protoc
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py frame-diff-svm \ $ spoof.py msu-mfsd frame-diff-svm \
--database msu-mfsd --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -529,7 +518,7 @@ following command: ...@@ -529,7 +518,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "10 features for each window in Frame Differences + SVM classifier + MSU MFSD database" \ --legends "10 features for each window in Frame Differences + SVM classifier + MSU MFSD database" \
...@@ -558,10 +547,7 @@ Baselines on Aggregated Database ...@@ -558,10 +547,7 @@ Baselines on Aggregated Database
-------------------------------------- --------------------------------------
This section summarizes the results of baseline face PAD experiments on the Aggregated Database. This section summarizes the results of baseline face PAD experiments on the Aggregated Database.
The description of the database instance, which can be used to run face PAD experiments on the Aggregated Database is given The description of the database-related settings, which are used to run face PAD baselines on the Aggregated Db is given here :ref:`bob.pad.face.resources.databases.aggregated_db`. To understand the settings in more details you can check the corresponding configuration file : ``bob/pad/face/config/aggregated_db.py``.
here :ref:`bob.pad.face.resources.databases.aggregated_db`.
To understand the settings of this database instance in more details you can check the
corresponding configuration file: ``bob/pad/face/config/database/aggregated_db.py``.
------------ ------------
...@@ -575,8 +561,7 @@ To run this baseline on the :ref:`bob.pad.face.resources.databases.aggregated_db ...@@ -575,8 +561,7 @@ To run this baseline on the :ref:`bob.pad.face.resources.databases.aggregated_db
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py lbp-svm-aggregated-db \ $ spoof.py aggregated-db lbp-svm-aggregated-db \
--database aggregated-db --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -591,7 +576,7 @@ following command: ...@@ -591,7 +576,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "LBP features of facial region + SVM classifier + Aggregated database" \ --legends "LBP features of facial region + SVM classifier + Aggregated database" \
...@@ -623,8 +608,7 @@ To run this baseline on the :ref:`bob.pad.face.resources.databases.aggregated_db ...@@ -623,8 +608,7 @@ To run this baseline on the :ref:`bob.pad.face.resources.databases.aggregated_db
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py qm-svm-aggregated-db \ $ spoof.py aggregated-db qm-svm-aggregated-db \
--database aggregated-db --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -639,7 +623,7 @@ following command: ...@@ -639,7 +623,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "IQM features of facial region + SVM classifier + Aggregated database" \ --legends "IQM features of facial region + SVM classifier + Aggregated database" \
...@@ -671,8 +655,7 @@ To run this baseline on the :ref:`bob.pad.face.resources.databases.aggregated_db ...@@ -671,8 +655,7 @@ To run this baseline on the :ref:`bob.pad.face.resources.databases.aggregated_db
.. code-block:: sh .. code-block:: sh
$ ./bin/spoof.py frame-diff-svm-aggregated-db \ $ spoof.py aggregated-db frame-diff-svm-aggregated-db \
--database aggregated-db --protocol grandtest --groups train dev eval \
--sub-directory <PATH_TO_STORE_THE_RESULTS> --sub-directory <PATH_TO_STORE_THE_RESULTS>
.. tip:: .. tip::
...@@ -687,7 +670,7 @@ following command: ...@@ -687,7 +670,7 @@ following command:
.. code-block:: sh .. code-block:: sh
./bin/evaluate.py \ evaluate.py \
--dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \
--eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \
--legends "10 features for each window in Frame Differences + SVM classifier + Aggregated Db" \ --legends "10 features for each window in Frame Differences + SVM classifier + Aggregated Db" \
......
...@@ -17,8 +17,12 @@ this package. ...@@ -17,8 +17,12 @@ this package.
Databases Databases
------------ ------------
These configuration files/resources contain entry points for the ``--database`` command line argument of the These configuration files/resources contain parameters of available databases.
``spoof.py`` script. The configuration files contain at least the following arguments of the ``spoof.py`` script:
* ``database``
* ``protocol``
* ``groups``
.. _bob.pad.face.resources.databases.replay: .. _bob.pad.face.resources.databases.replay:
...@@ -26,7 +30,7 @@ These configuration files/resources contain entry points for the ``--database`` ...@@ -26,7 +30,7 @@ These configuration files/resources contain entry points for the ``--database``
Replay-Attack Database Replay-Attack Database
================================================================================ ================================================================================
.. automodule:: bob.pad.face.config.database.replay .. automodule:: bob.pad.face.config.replay_attack
:members: :members:
...@@ -35,7 +39,7 @@ Replay-Attack Database ...@@ -35,7 +39,7 @@ Replay-Attack Database
Replay-Mobile Database Replay-Mobile Database
================================================================================ ================================================================================
.. automodule:: bob.pad.face.config.database.replay_mobile .. automodule:: bob.pad.face.config.replay_mobile
:members: :members:
...@@ -44,7 +48,7 @@ Replay-Mobile Database ...@@ -44,7 +48,7 @@ Replay-Mobile Database
MSU MFSD Database MSU MFSD Database
================================================================================ ================================================================================
.. automodule:: bob.pad.face.config.database.msu_mfsd .. automodule:: bob.pad.face.config.msu_mfsd
:members: :members:
...@@ -53,7 +57,7 @@ MSU MFSD Database ...@@ -53,7 +57,7 @@ MSU MFSD Database
Aggregated Database Aggregated Database
================================================================================ ================================================================================
.. automodule:: bob.pad.face.config.database.aggregated_db .. automodule:: bob.pad.face.config.aggregated_db
:members: :members:
--------------------------------- ---------------------------------
......
...@@ -63,7 +63,7 @@ setup( ...@@ -63,7 +63,7 @@ setup(
# registered databases: # registered databases:
'bob.pad.database': [ 'bob.pad.database': [
'replay = bob.pad.face.config.database.replay:database', 'replay-attack = bob.pad.face.config.database.replay_attack:database',
'replay-mobile = bob.pad.face.config.database.replay_mobile:database', 'replay-mobile = bob.pad.face.config.database.replay_mobile:database',
'msu-mfsd = bob.pad.face.config.database.msu_mfsd:database', 'msu-mfsd = bob.pad.face.config.database.msu_mfsd:database',
'aggregated-db = bob.pad.face.config.database.aggregated_db:database', 'aggregated-db = bob.pad.face.config.database.aggregated_db:database',
...@@ -71,6 +71,11 @@ setup( ...@@ -71,6 +71,11 @@ setup(
# registered configurations: # registered configurations:
'bob.bio.config': [ 'bob.bio.config': [
# databases
'replay-attack = bob.pad.face.config.replay_attack',
'replay-mobile = bob.pad.face.config.replay_mobile',
'msu-mfsd = bob.pad.face.config.msu_mfsd',
'aggregated-db = bob.pad.face.config.aggregated_db',
# baselines: # baselines:
'lbp-svm = bob.pad.face.config.lbp_svm', 'lbp-svm = bob.pad.face.config.lbp_svm',
...@@ -83,12 +88,7 @@ setup( ...@@ -83,12 +88,7 @@ setup(
# registered preprocessors: # registered preprocessors:
'bob.pad.preprocessor': [ 'bob.pad.preprocessor': [
'video-face-crop-preproc-64 = bob.pad.face.config.preprocessor.video_face_crop:video_face_crop_preproc_64_64',
'video-face-crop-preproc-64-face-50 = bob.pad.face.config.preprocessor.video_face_crop:video_face_crop_preproc_64_64_face_50',
'video-face-crop-preproc-64-face-50-local-cropper = bob.pad.face.config.preprocessor.video_face_crop:video_face_crop_preproc_64_64_face_50_local_cropper',
'video-face-crop-preproc-64-face-50-local-cropper-rgb = bob.pad.face.config.preprocessor.video_face_crop:video_face_crop_preproc_64_64_face_50_local_cropper_rgb',
'empty-preprocessor = bob.pad.face.config.preprocessor.filename:empty_preprocessor', # no preprocessing 'empty-preprocessor = bob.pad.face.config.preprocessor.filename:empty_preprocessor', # no preprocessing
'frame-diff-min-size-50-200-frames = bob.pad.face.config.preprocessor.frame_difference:frame_diff_min_size_50_200_frames',
], ],
# registered preprocessors: # registered preprocessors:
...@@ -96,12 +96,10 @@ setup( ...@@ -96,12 +96,10 @@ setup(
'video-lbp-histogram-extractor-n8r1-uniform = bob.pad.face.config.extractor.video_lbp_histogram:video_lbp_histogram_extractor_n8r1_uniform', 'video-lbp-histogram-extractor-n8r1-uniform = bob.pad.face.config.extractor.video_lbp_histogram:video_lbp_histogram_extractor_n8r1_uniform',
'video-quality-measure-galbally-msu = bob.pad.face.config.extractor.video_quality_measure:video_quality_measure_galbally_msu', 'video-quality-measure-galbally-msu = bob.pad.face.config.extractor.video_quality_measure:video_quality_measure_galbally_msu',
'frame-diff-feat-extr-w20-over0 = bob.pad.face.config.extractor.frame_diff_features:frame_diff_feat_extr_w20_over0', 'frame-diff-feat-extr-w20-over0 = bob.pad.face.config.extractor.frame_diff_features:frame_diff_feat_extr_w20_over0',
'frame-diff-feat-extr-w100-over0 = bob.pad.face.config.extractor.frame_diff_features:frame_diff_feat_extr_w100_over0',
], ],
# registered algorithms: # registered algorithms:
'bob.pad.algorithm': [ 'bob.pad.algorithm': [
'video-svm-pad-algorithm-10k-grid = bob.pad.face.config.algorithm.video_svm_pad_algorithm:video_svm_pad_algorithm_10k_grid',
'video-svm-pad-algorithm-10k-grid-mean-std = bob.pad.face.config.algorithm.video_svm_pad_algorithm:video_svm_pad_algorithm_10k_grid_mean_std', 'video-svm-pad-algorithm-10k-grid-mean-std = bob.pad.face.config.algorithm.video_svm_pad_algorithm:video_svm_pad_algorithm_10k_grid_mean_std',
'video-svm-pad-algorithm-10k-grid-mean-std-frame-level = bob.pad.face.config.algorithm.video_svm_pad_algorithm:video_svm_pad_algorithm_10k_grid_mean_std_frame_level', 'video-svm-pad-algorithm-10k-grid-mean-std-frame-level = bob.pad.face.config.algorithm.video_svm_pad_algorithm:video_svm_pad_algorithm_10k_grid_mean_std_frame_level',
'video-svm-pad-algorithm-default-svm-param-mean-std-frame-level = bob.pad.face.config.algorithm.video_svm_pad_algorithm:video_svm_pad_algorithm_default_svm_param_mean_std_frame_level', 'video-svm-pad-algorithm-default-svm-param-mean-std-frame-level = bob.pad.face.config.algorithm.video_svm_pad_algorithm:video_svm_pad_algorithm_default_svm_param_mean_std_frame_level',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment