Commit 5ceb3da4 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Removed the ICB 2013 path

parent 5e509838
......@@ -12,75 +12,36 @@ import os
class File(FileBase):
def __init__(self, f, icb2013=False):
def __init__(self, f):
"""
Initializes this File object with our own File equivalent
icb2013: Flag selecting the icb2013 anonymous test set
"""
self.__f = f
self.__icb2013 = icb2013
def videofile(self, directory=None):
if(self.__icb2013):
if(directory == None):
return self.__f.videofile(directory=os.path.join("anonymized_test_set","videos"))
else:
return self.__f.videofile(directory=os.path.join(directory,"anonymized_test_set","videos"))
return self.__f.videofile(directory=directory)
videofile.__doc__ = FileBase.videofile.__doc__
def facefile(self, directory=None):
if(self.__icb2013):
if(directory == None):
return self.__f.facefile(directory=os.path.join("anonymized_test_set"))
else:
return self.__f.facefile(directory=os.path.join(directory,"anonymized_test_set"))
return self.__f.facefile(directory=directory)
facefile.__doc__ = FileBase.facefile.__doc__
def bbx(self, directory=None):
if(self.__icb2013):
if(directory == None):
return self.__f.bbx(directory=os.path.join("anonymized_test_set"))
else:
return self.__f.bbx(directory=os.path.join(directory,"anonymized_test_set"))
return self.__f.bbx(directory=directory)
bbx.__doc__ = FileBase.bbx.__doc__
def load(self, directory=None, extension='.hdf5'):
if(self.__icb2013):
if(directory == None):
return self.__f.load(directory=os.path.join("anonymized_test_set","videos"), extension=extension)
else:
return self.__f.load(directory=os.path.join(directory,"anonymized_test_set","videos"), extension=extension)
return self.__f.load(directory=directory, extension=extension)
load.__doc__ = FileBase.bbx.__doc__
def save(self, data, directory=None, extension='.hdf5'):
if(self.__icb2013):
if(directory == None):
return self.__f.save(data, directory=os.path.join("anonymized_test_set","videos"), extension=extension)
else:
return self.__f.save(data, directory=os.path.join(directory,"anonymized_test_set","videos"), extension=extension)
return self.__f.save(data, directory=directory, extension=extension)
save.__doc__ = FileBase.save.__doc__
def make_path(self, directory=None, extension=None):
if(self.__icb2013):
if(directory == None):
return self.__f.make_path(directory=os.path.join("anonymized_test_set","videos"), extension=extension)
else:
return self.__f.make_path(directory=os.path.join(directory,"anonymized_test_set","videos"), extension=extension)
return self.__f.make_path(directory=directory, extension=extension)
make_path.__doc__ = FileBase.make_path.__doc__
......@@ -99,10 +60,8 @@ class Database(DatabaseBase):
self.__db = ReplayDatabase()
self.__kwargs = {}
self.__icb2013 = False
if args is not None:
self.__icb2013 = args.icb2013
self.__kwargs = {
'protocol': args.replay_protocol,
......@@ -139,8 +98,6 @@ class Database(DatabaseBase):
identities = [k.id for k in self.__db.clients()]
p.add_argument('--client', type=int, action='append', choices=identities, dest='replay_client', help="Client identifier (if unset, the default, use all)")
p.add_argument('--ICB-2013', default=False, action='store_true', dest='icb2013', help="Retrieve the File list of the ICB 2013 competition anonymized test set (The 2nd competition on counter measures to 2D facial spoofing attacks).")
p.set_defaults(name=entry_point_name)
p.set_defaults(cls=Database)
......@@ -194,9 +151,6 @@ class Database(DatabaseBase):
get_devel_data.__doc__ = DatabaseBase.get_devel_data.__doc__
def get_test_data(self):
if(self.__icb2013):
return self.get_ICB2013_test_data()
return self.get_data('test')
get_test_data.__doc__ = DatabaseBase.get_test_data.__doc__
......@@ -205,20 +159,6 @@ class Database(DatabaseBase):
return ('device', 'support', 'light')
def get_ICB2013_test_data(self):
"""
Return a list of File objects containing the ICB 2013 test set
"""
icb2013_test_data = []
#There are 480 files
import xbob
icb2013_test_data = [File(
xbob.db.replay.models.File(None,"test_sequence_" + str(i).zfill(3),None),
self.__icb2013) for i in range(1,481)]
return icb2013_test_data,[]
def get_filtered_test_data(self, filter):
def device_filter(obj, filter):
......@@ -254,11 +194,5 @@ class Database(DatabaseBase):
self.get_test_filters()
def get_all_data(self):
if(self.__icb2013):
train_real,train_attack = self.get_train_data()
devel_real,devel_attack = self.get_devel_data()
anonymous_data,_ = self.get_ICB2013_test_data()
return train_real + devel_real + anonymous_data, train_attack + devel_attack
return self.get_data(None)
get_all_data.__doc__ = DatabaseBase.get_all_data.__doc__
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment