Commit a590ba6e authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

Add an option to return a flat list

parent 45fed636
Pipeline #14440 failed with stages
in 8 minutes and 54 seconds
......@@ -130,7 +130,7 @@ class PadDatabase(BioDatabase):
######### Methods to provide common functionality ###############
#################################################################
def all_files(self, groups=('train', 'dev', 'eval')):
def all_files(self, groups=('train', 'dev', 'eval'), flat=False):
"""all_files(groups=('train', 'dev', 'eval')) -> files
Returns all files of the database, respecting the current protocol.
......@@ -140,6 +140,7 @@ class PadDatabase(BioDatabase):
groups : some of ``('train', 'dev', 'eval')`` or ``None``
The groups to get the data for.
flat : if True, it will merge the real and attack files into one list.
**Returns:**
......@@ -148,6 +149,8 @@ class PadDatabase(BioDatabase):
"""
realset = self.sort(self.objects(protocol=self.protocol, groups=groups, purposes='real', **self.all_files_options))
attackset = self.sort(self.objects(protocol=self.protocol, groups=groups, purposes='attack', **self.all_files_options))
if flat:
return realset + attackset
return [realset, attackset]
def training_files(self, step=None, arrange_by_client=False):
......
Markdown is supported
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