Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.pad.face
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.pad.face
Commits
81659bf9
There was a problem fetching the pipeline summary.
Commit
81659bf9
authored
7 years ago
by
Olegs NIKISINS
Browse files
Options
Downloads
Patches
Plain Diff
Added an option to exclude specific types of attacks from train set in BATL DB
parent
92c95a47
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!66
Added an option to exclude specific types of attacks from train set in BATL DB
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/pad/face/database/batl.py
+20
-0
20 additions, 0 deletions
bob/pad/face/database/batl.py
with
20 additions
and
0 deletions
bob/pad/face/database/batl.py
+
20
−
0
View file @
81659bf9
...
...
@@ -150,6 +150,7 @@ class BatlPadDatabase(PadDatabase):
original_extension
=
'
.h5
'
,
annotations_temp_dir
=
""
,
landmark_detect_method
=
"
mtcnn
"
,
exlude_attacks_list
=
None
,
**
kwargs
):
"""
**Parameters:**
...
...
@@ -186,6 +187,12 @@ class BatlPadDatabase(PadDatabase):
landmarks. Possible options:
"
dlib
"
or
"
mtcnn
"
.
Default: ``
"
mtcnn
"
``.
``exlude_attacks_list`` : [str]
A list of strings defining which attacks should be excluded from
the training set. This shoould be handled in ``objects()`` method.
Currently handled attacks:
"
makeup
"
.
Default: ``None``.
``kwargs`` : dict
The arguments of the :py:class:`bob.bio.base.database.BioDatabase`
base class constructor.
...
...
@@ -217,6 +224,7 @@ class BatlPadDatabase(PadDatabase):
self
.
original_extension
=
original_extension
self
.
annotations_temp_dir
=
annotations_temp_dir
self
.
landmark_detect_method
=
landmark_detect_method
self
.
exlude_attacks_list
=
exlude_attacks_list
@property
def
original_directory
(
self
):
...
...
@@ -378,6 +386,11 @@ class BatlPadDatabase(PadDatabase):
The protocol is dependent on your database.
If you do not have protocols defined, just ignore this field.
``groups`` : :py:class:`str`
OR a list of strings.
The groups of which the clients should be returned.
Usually, groups are one or more elements of (
'
train
'
,
'
dev
'
,
'
eval
'
)
``purposes`` : :obj:`str` or [:obj:`str`]
The purposes for which File objects should be retrieved.
Usually it is either
'
real
'
or
'
attack
'
.
...
...
@@ -433,7 +446,14 @@ class BatlPadDatabase(PadDatabase):
groups
=
groups
,
purposes
=
purposes
,
**
kwargs
)
if
groups
==
'
train
'
or
'
train
'
in
groups
and
len
(
groups
)
==
1
:
# exclude "makeup" case
if
self
.
exlude_attacks_list
is
not
None
and
"
makeup
"
in
self
.
exlude_attacks_list
:
files
=
[
f
for
f
in
files
if
os
.
path
.
split
(
f
.
path
)[
-
1
].
split
(
"
_
"
)[
-
2
:
-
1
][
0
]
!=
"
5
"
]
files
=
[
BatlPadFile
(
f
,
stream_type
,
max_frames
)
for
f
in
files
]
return
files
def
annotations
(
self
,
f
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment