diff --git a/bob/pad/face/config/aggregated_db.py b/bob/pad/face/config/aggregated_db.py new file mode 100644 index 0000000000000000000000000000000000000000..89b4b6413dbec8b38f5d4d658c95c37a596efe12 --- /dev/null +++ b/bob/pad/face/config/aggregated_db.py @@ -0,0 +1,66 @@ +#!/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. +""" diff --git a/bob/pad/face/config/algorithm/video_svm_pad_algorithm.py b/bob/pad/face/config/algorithm/video_svm_pad_algorithm.py index cd6fc1ad3081e0409cb3769b17923fcc5180fc97..639279d8a0079b7b3ff98497b12bee9ddadb4a30 100644 --- a/bob/pad/face/config/algorithm/video_svm_pad_algorithm.py +++ b/bob/pad/face/config/algorithm/video_svm_pad_algorithm.py @@ -11,18 +11,9 @@ kernel_type = 'RBF' 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(-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 -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, kernel_type = kernel_type, n_samples = n_samples, @@ -46,4 +37,4 @@ video_svm_pad_algorithm_default_svm_param_mean_std_frame_level = VideoSvmPadAlgo 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) \ No newline at end of file + frame_level_scores_flag = frame_level_scores_flag) diff --git a/bob/pad/face/config/database/replay.py b/bob/pad/face/config/database/replay_attack.py similarity index 100% rename from bob/pad/face/config/database/replay.py rename to bob/pad/face/config/database/replay_attack.py diff --git a/bob/pad/face/config/extractor/frame_diff_features.py b/bob/pad/face/config/extractor/frame_diff_features.py index d0e6fb398d4a216ed90877d286b42599793eda02..00fcccc1e520249ff3065eaa9810d027cfcf2de7 100644 --- a/bob/pad/face/config/extractor/frame_diff_features.py +++ b/bob/pad/face/config/extractor/frame_diff_features.py @@ -12,8 +12,5 @@ overlap=0 frame_diff_feat_extr_w20_over0 = FrameDiffFeatures(window_size=window_size, overlap=overlap) -window_size=100 -frame_diff_feat_extr_w100_over0 = FrameDiffFeatures(window_size=window_size, - overlap=overlap) diff --git a/bob/pad/face/config/msu_mfsd.py b/bob/pad/face/config/msu_mfsd.py new file mode 100644 index 0000000000000000000000000000000000000000..133cc2ff8554395ecc1f0b27abe2e5f5876372f7 --- /dev/null +++ b/bob/pad/face/config/msu_mfsd.py @@ -0,0 +1,63 @@ +#!/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. +""" diff --git a/bob/pad/face/config/preprocessor/frame_difference.py b/bob/pad/face/config/preprocessor/frame_difference.py deleted file mode 100644 index 349f172d2991113939ad131ec29c0989a920eca6..0000000000000000000000000000000000000000 --- a/bob/pad/face/config/preprocessor/frame_difference.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/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) - diff --git a/bob/pad/face/config/preprocessor/video_face_crop.py b/bob/pad/face/config/preprocessor/video_face_crop.py deleted file mode 100644 index 5ab32d17af692c94c5735addffb382742dfec666..0000000000000000000000000000000000000000 --- a/bob/pad/face/config/preprocessor/video_face_crop.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/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 diff --git a/bob/pad/face/config/replay_attack.py b/bob/pad/face/config/replay_attack.py new file mode 100644 index 0000000000000000000000000000000000000000..3992d6fe94b7c5bcf4857c980e0c3ab131cfee41 --- /dev/null +++ b/bob/pad/face/config/replay_attack.py @@ -0,0 +1,59 @@ +#!/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. +""" diff --git a/bob/pad/face/config/replay_mobile.py b/bob/pad/face/config/replay_mobile.py new file mode 100644 index 0000000000000000000000000000000000000000..453ca410c4c8fc966929d1bec281ea96d3c77a15 --- /dev/null +++ b/bob/pad/face/config/replay_mobile.py @@ -0,0 +1,62 @@ +#!/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. +""" diff --git a/doc/baselines.rst b/doc/baselines.rst index 5e13f51ecc53e518e88708f49058f10db20be84d..55720e682f9c55f1a39416793d9c3d89a2ed8e62 100644 --- a/doc/baselines.rst +++ b/doc/baselines.rst @@ -19,7 +19,7 @@ To see the description of the script you can type in the console: .. code-block:: sh - $ ./bin/verify.py --help + $ spoof.py --help This script is explained in more detail in :ref:`bob.pad.base.experiments`. @@ -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. +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 @@ -96,8 +97,7 @@ To run this baseline on the `replayattack`_ database, using the ``grandtest`` pr .. code-block:: sh - $ ./bin/spoof.py lbp-svm \ - --database replay --protocol grandtest --groups train dev eval \ + $ spoof.py replay-attack lbp-svm \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -107,8 +107,7 @@ To run this baseline on the `replayattack`_ database, using the ``grandtest`` pr .. code-block:: sh - $ ./bin/spoof.py lbp-svm \ - --database replay --protocol grandtest --groups train dev eval \ + $ spoof.py replay-attack lbp-svm \ --sub-directory <PATH_TO_STORE_THE_RESULTS> \ --grid idiap @@ -120,7 +119,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --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 .. code-block:: sh - $ ./bin/spoof.py qm-svm \ - --database replay --protocol grandtest --groups train dev eval \ + $ spoof.py replay-attack qm-svm \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -169,7 +167,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --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 .. code-block:: sh - $ ./bin/spoof.py frame-diff-svm \ - --database replay --protocol grandtest --groups train dev eval \ + $ spoof.py replay-attack frame-diff-svm \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -217,7 +214,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --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" \ @@ -245,8 +242,7 @@ Baselines on 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 -here :ref:`bob.pad.face.resources.databases.replay_mobile`. +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``. LBP features of facial region + SVM classifier @@ -259,8 +255,7 @@ To run this baseline on the `Replay-Mobile`_ database, using the ``grandtest`` p .. code-block:: sh - $ ./bin/spoof.py lbp-svm \ - --database replay-mobile --protocol grandtest --groups train dev eval \ + $ spoof.py replay-mobile lbp-svm \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -275,7 +270,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --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 .. code-block:: sh - $ ./bin/spoof.py qm-svm \ - --database replay-mobile --protocol grandtest --groups train dev eval \ + $ spoof.py replay-mobile qm-svm \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -324,7 +318,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --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 .. code-block:: sh - $ ./bin/spoof.py frame-diff-svm \ - --database replay-mobile --protocol grandtest --groups train dev eval \ + $ spoof.py replay-mobile frame-diff-svm \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -373,7 +366,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --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" \ @@ -401,8 +394,7 @@ Baselines on 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 -here :ref:`bob.pad.face.resources.databases.msu_mfsd`. +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``. LBP features of facial region + SVM classifier @@ -415,8 +407,7 @@ To run this baseline on the `MSU MFSD`_ database, using the ``grandtest`` protoc .. code-block:: sh - $ ./bin/spoof.py lbp-svm \ - --database msu-mfsd --protocol grandtest --groups train dev eval \ + $ spoof.py msu-mfsd lbp-svm \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -431,7 +422,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --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 .. code-block:: sh - $ ./bin/spoof.py qm-svm \ - --database msu-mfsd --protocol grandtest --groups train dev eval \ + $ spoof.py msu-mfsd qm-svm \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -480,7 +470,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --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 .. code-block:: sh - $ ./bin/spoof.py frame-diff-svm \ - --database msu-mfsd --protocol grandtest --groups train dev eval \ + $ spoof.py msu-mfsd frame-diff-svm \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -529,7 +518,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --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" \ @@ -558,10 +547,7 @@ Baselines on 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 -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``. +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``. ------------ @@ -575,8 +561,7 @@ To run this baseline on the :ref:`bob.pad.face.resources.databases.aggregated_db .. code-block:: sh - $ ./bin/spoof.py lbp-svm-aggregated-db \ - --database aggregated-db --protocol grandtest --groups train dev eval \ + $ spoof.py aggregated-db lbp-svm-aggregated-db \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -591,7 +576,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --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 .. code-block:: sh - $ ./bin/spoof.py qm-svm-aggregated-db \ - --database aggregated-db --protocol grandtest --groups train dev eval \ + $ spoof.py aggregated-db qm-svm-aggregated-db \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -639,7 +623,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --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 .. code-block:: sh - $ ./bin/spoof.py frame-diff-svm-aggregated-db \ - --database aggregated-db --protocol grandtest --groups train dev eval \ + $ spoof.py aggregated-db frame-diff-svm-aggregated-db \ --sub-directory <PATH_TO_STORE_THE_RESULTS> .. tip:: @@ -687,7 +670,7 @@ following command: .. code-block:: sh - ./bin/evaluate.py \ + evaluate.py \ --dev-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-dev \ --eval-files <PATH_TO_STORE_THE_RESULTS>/grandtest/scores/scores-eval \ --legends "10 features for each window in Frame Differences + SVM classifier + Aggregated Db" \ diff --git a/doc/resources.rst b/doc/resources.rst index 2407852e7ffe3777d74e71c60e146f8fef74736d..30bf78198744d430a2c405342b3e045b5dfed4a1 100644 --- a/doc/resources.rst +++ b/doc/resources.rst @@ -17,8 +17,12 @@ this package. Databases ------------ -These configuration files/resources contain entry points for the ``--database`` command line argument of the -``spoof.py`` script. +These configuration files/resources contain parameters of available databases. +The configuration files contain at least the following arguments of the ``spoof.py`` script: + + * ``database`` + * ``protocol`` + * ``groups`` .. _bob.pad.face.resources.databases.replay: @@ -26,7 +30,7 @@ These configuration files/resources contain entry points for the ``--database`` Replay-Attack Database ================================================================================ -.. automodule:: bob.pad.face.config.database.replay +.. automodule:: bob.pad.face.config.replay_attack :members: @@ -35,7 +39,7 @@ Replay-Attack Database Replay-Mobile Database ================================================================================ -.. automodule:: bob.pad.face.config.database.replay_mobile +.. automodule:: bob.pad.face.config.replay_mobile :members: @@ -44,7 +48,7 @@ Replay-Mobile Database MSU MFSD Database ================================================================================ -.. automodule:: bob.pad.face.config.database.msu_mfsd +.. automodule:: bob.pad.face.config.msu_mfsd :members: @@ -53,7 +57,7 @@ MSU MFSD Database Aggregated Database ================================================================================ -.. automodule:: bob.pad.face.config.database.aggregated_db +.. automodule:: bob.pad.face.config.aggregated_db :members: --------------------------------- diff --git a/requirements.txt b/requirements.txt index fba91180c7a495b9d0c05130f390777816d35fdc..795e4100ff0332650da93fc9470405eefac9649e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ setuptools six sphinx -nose numpy bob.extension bob.bio.base diff --git a/setup.py b/setup.py index e0ac7ee6cbf6fbe56e0b6a9754bded38486ae3db..efe8b2ab31e4fbd15b6e53cf718bd6631b88dc0f 100644 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ setup( # registered databases: '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', 'msu-mfsd = bob.pad.face.config.database.msu_mfsd:database', 'aggregated-db = bob.pad.face.config.database.aggregated_db:database', @@ -71,6 +71,11 @@ setup( # registered configurations: '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: 'lbp-svm = bob.pad.face.config.lbp_svm', @@ -83,12 +88,7 @@ setup( # registered preprocessors: '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 - 'frame-diff-min-size-50-200-frames = bob.pad.face.config.preprocessor.frame_difference:frame_diff_min_size_50_200_frames', ], # registered preprocessors: @@ -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-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-w100-over0 = bob.pad.face.config.extractor.frame_diff_features:frame_diff_feat_extr_w100_over0', ], # registered algorithms: '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-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', diff --git a/test-requirements.txt b/test-requirements.txt index f7509181fd4249e73b5187b198e77f5881677ea2..9c59832182371a73802a46b035a5fbbb852980e5 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,4 @@ +nose bob.db.replay bob.db.replaymobile bob.db.msu_mfsd_mod \ No newline at end of file