Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.pad.base
Commits
a590ba6e
Commit
a590ba6e
authored
Nov 30, 2017
by
Amir MOHAMMADI
Browse files
Add an option to return a flat list
parent
45fed636
Pipeline
#14440
failed with stages
in 8 minutes and 54 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/pad/base/database/database.py
View file @
a590ba6e
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment