From a1fc10eead4bf79263f5628ffc1575141adec8af Mon Sep 17 00:00:00 2001
From: Guillaume HEUSCH <guillaume.heusch@idiap.ch>
Date: Wed, 14 Mar 2018 16:58:35 +0100
Subject: [PATCH] [database] finished - i.e. working, but should be polished -
 3DMAD high-level interface

---
 bob/pad/face/database/__init__.py     |  1 +
 bob/pad/face/database/maskattack.py   | 27 ++++++++++++++++++++++++---
 bob/pad/face/preprocessor/__init__.py |  1 +
 setup.py                              |  1 +
 4 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/bob/pad/face/database/__init__.py b/bob/pad/face/database/__init__.py
index d92ad1f2..2b0ed210 100644
--- a/bob/pad/face/database/__init__.py
+++ b/bob/pad/face/database/__init__.py
@@ -5,6 +5,7 @@ from .msu_mfsd import MsuMfsdPadDatabase
 from .aggregated_db import AggregatedDbPadDatabase
 from .mifs import MIFSPadDatabase
 from .maskattack import MaskAttackPadDatabase
+from .batl import BatlPadDatabase
 
 
 # gets sphinx autodoc done right - don't remove it
diff --git a/bob/pad/face/database/maskattack.py b/bob/pad/face/database/maskattack.py
index f6a54c98..a4d8daf7 100644
--- a/bob/pad/face/database/maskattack.py
+++ b/bob/pad/face/database/maskattack.py
@@ -74,7 +74,7 @@ class MaskAttackPadDatabase(PadDatabase):
 
     def __init__(
             self,
-            protocol=None,  # grandtest is the default protocol for this database
+            protocol=None,  
             original_directory=None,
             original_extension='.avi',
             **kwargs):
@@ -101,7 +101,7 @@ class MaskAttackPadDatabase(PadDatabase):
         # Since the high level API expects different group names than what the low
         # level API offers, you need to convert them when necessary
         self.low_level_group_names = (
-            'world', 'devel',
+            'world', 'dev',
             'test')  # group names in the low-level database interface
         self.high_level_group_names = (
             'train', 'dev',
@@ -164,7 +164,28 @@ class MaskAttackPadDatabase(PadDatabase):
             groups, self.low_level_group_names, self.high_level_group_names)
         # Since this database was designed for PAD experiments, nothing special
         # needs to be done here.
-        files = self.db.objects(groups=groups, **kwargs)
+
+        print("Objects method called with groups = {}, protocol = {}, purposes = {}, model_ids = {}".format(groups, protocol, purposes, model_ids))
+        #print("Kwargs -> {}".format(**kwargs))
+        #print("Translated groups = {}".frima)
+        
+        # for training
+
+        # for dev
+
+        # for eval
+        lowlevel_purposes = []
+        if purposes == 'real':
+          lowlevel_purposes = ['trainReal', 'probeReal', 'classifyReal']
+        else:
+          lowlevel_purposes = ['trainMask', 'probeMask', 'classifyMask']
+          
+        #if groups == ['world']:
+        #    lowlevel_purposes = ['trainMask']
+        #  if groups == ['world']:
+        #    lowlevel_purposes = ['trainMask']
+        #print(lowlevel_purposes)
+        files = self.db.objects(sets=groups, purposes=lowlevel_purposes, **kwargs)
 
         files = [MaskAttackPadFile(f) for f in files]
 
diff --git a/bob/pad/face/preprocessor/__init__.py b/bob/pad/face/preprocessor/__init__.py
index ced731f7..c23622e9 100644
--- a/bob/pad/face/preprocessor/__init__.py
+++ b/bob/pad/face/preprocessor/__init__.py
@@ -6,6 +6,7 @@ from .VideoSparseCoding import VideoSparseCoding
 from .Li import Li
 from .Chrom import Chrom
 from .SSR import SSR
+from .PPGSecure import PPGSecure
 
 def __appropriate__(*args):
     """Says object was actually declared here, and not in the import module.
diff --git a/setup.py b/setup.py
index eb007c7c..abd87e7f 100644
--- a/setup.py
+++ b/setup.py
@@ -64,6 +64,7 @@ setup(
             'aggregated-db = bob.pad.face.config.database.aggregated_db:database',
             'mifs = bob.pad.face.config.database.mifs:database',
             'maskattack = bob.pad.face.config.database.maskattack:database',
+            'batl = bob.pad.face.config.database.batl:database',
         ],
 
         # registered configurations:
-- 
GitLab