Skip to content
Snippets Groups Projects
Commit a590ba6e authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

Add an option to return a flat list

parent 45fed636
No related branches found
No related tags found
1 merge request!23Add an option to return a flat list
Pipeline #
...@@ -130,7 +130,7 @@ class PadDatabase(BioDatabase): ...@@ -130,7 +130,7 @@ class PadDatabase(BioDatabase):
######### Methods to provide common functionality ############### ######### 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 """all_files(groups=('train', 'dev', 'eval')) -> files
Returns all files of the database, respecting the current protocol. Returns all files of the database, respecting the current protocol.
...@@ -140,6 +140,7 @@ class PadDatabase(BioDatabase): ...@@ -140,6 +140,7 @@ class PadDatabase(BioDatabase):
groups : some of ``('train', 'dev', 'eval')`` or ``None`` groups : some of ``('train', 'dev', 'eval')`` or ``None``
The groups to get the data for. The groups to get the data for.
flat : if True, it will merge the real and attack files into one list.
**Returns:** **Returns:**
...@@ -148,6 +149,8 @@ class PadDatabase(BioDatabase): ...@@ -148,6 +149,8 @@ class PadDatabase(BioDatabase):
""" """
realset = self.sort(self.objects(protocol=self.protocol, groups=groups, purposes='real', **self.all_files_options)) 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)) attackset = self.sort(self.objects(protocol=self.protocol, groups=groups, purposes='attack', **self.all_files_options))
if flat:
return realset + attackset
return [realset, attackset] return [realset, attackset]
def training_files(self, step=None, arrange_by_client=False): def training_files(self, step=None, arrange_by_client=False):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment