diff --git a/bob/pad/face/config/database/__init__.py b/bob/pad/face/config/database/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/bob/pad/face/config/database/batl/__init__.py b/bob/pad/face/config/database/batl/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/bob/pad/face/config/batl_db.py b/bob/pad/face/config/database/batl/batl_db.py similarity index 100% rename from bob/pad/face/config/batl_db.py rename to bob/pad/face/config/database/batl/batl_db.py diff --git a/bob/pad/face/config/batl_db_depth.py b/bob/pad/face/config/database/batl/batl_db_depth.py similarity index 100% rename from bob/pad/face/config/batl_db_depth.py rename to bob/pad/face/config/database/batl/batl_db_depth.py diff --git a/bob/pad/face/config/batl_db_infrared.py b/bob/pad/face/config/database/batl/batl_db_infrared.py similarity index 100% rename from bob/pad/face/config/batl_db_infrared.py rename to bob/pad/face/config/database/batl/batl_db_infrared.py diff --git a/bob/pad/face/config/database/batl/batl_db_rgb_ir_d_grandtest.py b/bob/pad/face/config/database/batl/batl_db_rgb_ir_d_grandtest.py new file mode 100644 index 0000000000000000000000000000000000000000..6fc2381bca64f7327b7f632458c574061af054f0 --- /dev/null +++ b/bob/pad/face/config/database/batl/batl_db_rgb_ir_d_grandtest.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +""" +Idiap BATL DB is a database for face PAD experiments. +""" + +from bob.pad.face.database import BatlPadDatabase + +# 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_BATL_DB_DIRECTORY]" +"""Value of ``~/.bob_bio_databases.txt`` for this database""" + +ORIGINAL_EXTENSION = ".h5" # extension of the data files + +ANNOTATIONS_TEMP_DIR = "" # NOTE: this variable is NOT assigned in the instance of the BatlPadDatabase, thus "rc" functionality defined in bob.extension will be involved + +PROTOCOL = 'grandtest-color*infrared*depth-10' # use 10 frames for PAD experiments + +database = BatlPadDatabase( + protocol=PROTOCOL, + original_directory=ORIGINAL_DIRECTORY, + original_extension=ORIGINAL_EXTENSION, + landmark_detect_method="mtcnn", # detect annotations using mtcnn + exclude_attacks_list=['makeup'], + exclude_pai_all_sets=True, # exclude makeup from all the sets, which is the default behavior for grandtest protocol + append_color_face_roi_annot=False) # do not append annotations, defining ROI in the cropped face image, to the dictionary of annotations + +"""The :py:class:`bob.pad.base.database.BatlPadDatabase` derivative with BATL 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_BATL_DB_DIRECTORY]``. +You must make sure to create ``${HOME}/.bob_bio_databases.txt`` file setting this +value to the places where you actually installed the BATL Govt database. +""" + +protocol = PROTOCOL +""" +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/batl_db_thermal.py b/bob/pad/face/config/database/batl/batl_db_thermal.py similarity index 100% rename from bob/pad/face/config/batl_db_thermal.py rename to bob/pad/face/config/database/batl/batl_db_thermal.py diff --git a/setup.py b/setup.py index fc569e4cc7411124897617e443f7e190406e2bd7..bdd290b8954e7a34de517cdd0ff11462021d1ff4 100644 --- a/setup.py +++ b/setup.py @@ -68,10 +68,11 @@ setup( 'msu-mfsd = bob.pad.face.config.msu_mfsd:database', 'aggregated-db = bob.pad.face.config.aggregated_db:database', 'mifs = bob.pad.face.config.mifs:database', - 'batl-db = bob.pad.face.config.batl_db:database', - 'batl-db-infrared = bob.pad.face.config.batl_db_infrared:database', - 'batl-db-depth = bob.pad.face.config.batl_db_depth:database', - 'batl-db-thermal = bob.pad.face.config.batl_db_thermal:database', + 'batl-db = bob.pad.face.config.database.batl.batl_db:database', + 'batl-db-infrared = bob.pad.face.config.database.batl.batl_db_infrared:database', + 'batl-db-depth = bob.pad.face.config.database.batl.batl_db_depth:database', + 'batl-db-thermal = bob.pad.face.config.database.batl.batl_db_thermal:database', + 'batl-db-rgb-ir-d-grandtest = bob.pad.face.config.database.batl.batl_db_rgb_ir_d_grandtest:database', 'celeb-a = bob.pad.face.config.celeb_a:database', 'maskattack = bob.pad.face.config.maskattack:database', ], @@ -84,10 +85,11 @@ setup( 'msu-mfsd = bob.pad.face.config.msu_mfsd', 'aggregated-db = bob.pad.face.config.aggregated_db', 'mifs = bob.pad.face.config.mifs', - 'batl-db = bob.pad.face.config.batl_db', - 'batl-db-infrared = bob.pad.face.config.batl_db_infrared', - 'batl-db-depth = bob.pad.face.config.batl_db_depth', - 'batl-db-thermal = bob.pad.face.config.batl_db_thermal', + 'batl-db = bob.pad.face.config.database.batl.batl_db', + 'batl-db-infrared = bob.pad.face.config.database.batl.batl_db_infrared', + 'batl-db-depth = bob.pad.face.config.database.batl.batl_db_depth', + 'batl-db-thermal = bob.pad.face.config.database.batl.batl_db_thermal', + 'batl-db-rgb-ir-d-grandtest = bob.pad.face.config.database.batl.batl_db_rgb_ir_d_grandtest', 'celeb-a = bob.pad.face.config.celeb_a', 'maskattack = bob.pad.face.config.maskattack', @@ -118,9 +120,6 @@ setup( 'rgb-face-detect-mtcnn = bob.pad.face.config.preprocessor.video_face_crop:rgb_face_detector_mtcnn', # detect faces locally replacing database annotations 'bw-face-detect-mtcnn = bob.pad.face.config.preprocessor.video_face_crop:bw_face_detect_mtcnn', # detect faces locally, return BW image 'rgb-face-detect-check-quality-128x128 = bob.pad.face.config.preprocessor.face_feature_crop_quality_check:face_feature_0_128x128_crop_rgb', # detect faces locally replacing database annotations, also check face quality by trying to detect the eyes in cropped face. - - - 'video-face-crop-align-bw-ir-d-channels-3x128x128 = bob.pad.face.config.preprocessor.video_face_crop_align_block_patch:video_face_crop_align_bw_ir_d_channels_3x128x128', # Extract a BW-NIR-D patch of size (3 x 128 x 128) containing aligned face ],