From ef97e51a803d941ce3862706e443b265de26e2e8 Mon Sep 17 00:00:00 2001
From: Guillaume HEUSCH <guillaume.heusch@idiap.ch>
Date: Tue, 22 Jan 2019 15:42:22 +0100
Subject: [PATCH] [database] fixed high-level interface for CASIA-SURF

---
 bob/pad/face/database/casiasurf.py | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/bob/pad/face/database/casiasurf.py b/bob/pad/face/database/casiasurf.py
index b58b0a7e..7b2102b9 100644
--- a/bob/pad/face/database/casiasurf.py
+++ b/bob/pad/face/database/casiasurf.py
@@ -46,12 +46,11 @@ class CasiaSurfPadFile(VideoPadFile):
             client_id=s.id,
             file_id=s.id,
             attack_type=attack_type,
-            path='')
-
+            path=s.id)
       
 
     def load(self, directory=None, extension='.jpg', frame_selector=FrameSelector(selection_style='all')):
-        """Overridden version of the load method defined in ``VideoPadFile``.
+        """Overloaded version of the load method defined in ``VideoPadFile``.
 
         Parameters
         ----------
@@ -165,9 +164,7 @@ class CasiaSurfPadDatabase(PadDatabase):
             A list of CasiaSurfPadFile objects.
         """
 
-        print(groups)
         groups = self.convert_names_to_lowlevel(groups, self.low_level_group_names, self.high_level_group_names)
-        print(groups)
 
         if groups is not None:
           
@@ -179,17 +176,11 @@ class CasiaSurfPadDatabase(PadDatabase):
             lowlevel_purposes.append('attack') 
 
           # for dev and eval
-          if ('validation' in groups or 'test' in groups) and purposes == 'real':
-            lowlevel_purposes.append('unknown')
-          if ('validation' in groups or 'test' in groups) and purposes == 'attack':
+          if ('validation' in groups or 'test' in groups) and 'attack' in purposes:
             lowlevel_purposes.append('unknown')
 
-        print("In high-level DB: groups = {}".format(groups))
-        print("In high-level DB: purposes = {}".format(lowlevel_purposes))
-        print(lowlevel_purposes)
         samples = self.db.objects(groups=groups, purposes=lowlevel_purposes, **kwargs)
         samples = [CasiaSurfPadFile(s, stream_type=protocol) for s in samples]
-
         return samples
 
     
@@ -197,4 +188,3 @@ class CasiaSurfPadDatabase(PadDatabase):
         """No annotations are provided with this DB
         """
         return None
-
-- 
GitLab