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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.pad.face
Commits
93b33fe3
There was a problem fetching the pipeline summary.
Commit
93b33fe3
authored
7 years ago
by
Olegs NIKISINS
Browse files
Options
Downloads
Patches
Plain Diff
Some bug fixes in BATL HLDI, objects(), etc.
parent
2578a83d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!59
Added HLDI for the BATL database, added optional data normalization in FaceCropAlign
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/pad/face/database/batl.py
+16
-9
16 additions, 9 deletions
bob/pad/face/database/batl.py
with
16 additions
and
9 deletions
bob/pad/face/database/batl.py
+
16
−
9
View file @
93b33fe3
...
@@ -14,6 +14,8 @@ from bob.pad.face.preprocessor.FaceCropAlign import detect_face_landmarks_in_ima
...
@@ -14,6 +14,8 @@ from bob.pad.face.preprocessor.FaceCropAlign import detect_face_landmarks_in_ima
import
json
import
json
import
os
class
BatlPadFile
(
PadFile
):
class
BatlPadFile
(
PadFile
):
"""
"""
A high level implementation of the File class for the BATL
A high level implementation of the File class for the BATL
...
@@ -38,7 +40,7 @@ class BatlPadFile(PadFile):
...
@@ -38,7 +40,7 @@ class BatlPadFile(PadFile):
self
.
f
=
f
self
.
f
=
f
if
f
.
is_attack
():
if
f
.
is_attack
():
attack
=
batl_config
[
f
.
type_id
]
attack
=
BATL_CONFIG
[
f
.
type_id
]
attack_type
=
'
{} : {}
'
.
format
(
attack
[
'
name
'
],
attack
[
'
pai
'
][
f
.
pai_id
])
attack_type
=
'
{} : {}
'
.
format
(
attack
[
'
name
'
],
attack
[
'
pai
'
][
f
.
pai_id
])
else
:
else
:
attack_type
=
None
attack_type
=
None
...
@@ -60,7 +62,7 @@ class BatlPadFile(PadFile):
...
@@ -60,7 +62,7 @@ class BatlPadFile(PadFile):
def
load
(
self
,
directory
=
None
,
extension
=
'
.hdf5
'
,
frame_selector
=
FrameSelector
(
selection_style
=
'
all
'
)):
def
load
(
self
,
directory
=
None
,
extension
=
'
.hdf5
'
,
frame_selector
=
FrameSelector
(
selection_style
=
'
all
'
)):
data
=
f
.
load
(
self
,
directory
=
directory
,
data
=
self
.
f
.
load
(
self
,
directory
=
directory
,
extension
=
extension
,
extension
=
extension
,
modality
=
self
.
stream_type
,
# TODO: this parameter is currently missing in bob.db.batl, add it there
modality
=
self
.
stream_type
,
# TODO: this parameter is currently missing in bob.db.batl, add it there
reference_stream_type
=
self
.
reference_stream_type
,
reference_stream_type
=
self
.
reference_stream_type
,
...
@@ -169,7 +171,7 @@ class BatlPadDatabase(PadDatabase):
...
@@ -169,7 +171,7 @@ class BatlPadDatabase(PadDatabase):
``protocol`` : str
``protocol`` : str
The name of the protocol as defined in the low level db interface.
The name of the protocol as defined in the low level db interface.
``stream_type
s
`` : str
``stream_type`` : str
The name of the channel/stream_type to be loaded.
The name of the channel/stream_type to be loaded.
``max_frames`` : int
``max_frames`` : int
...
@@ -182,19 +184,19 @@ class BatlPadDatabase(PadDatabase):
...
@@ -182,19 +184,19 @@ class BatlPadDatabase(PadDatabase):
components
=
components
[
0
:
3
]
components
=
components
[
0
:
3
]
protocol
,
stream_type
s
,
max_frames
=
components
protocol
,
stream_type
,
max_frames
=
components
if
max_frames
is
not
None
:
if
max_frames
is
not
None
:
max_frames
=
int
(
max_frames
)
max_frames
=
int
(
max_frames
)
return
protocol
,
stream_type
s
,
max_frames
return
protocol
,
stream_type
,
max_frames
def
objects
(
self
,
def
objects
(
self
,
protocol
=
None
,
protocol
=
None
,
groups
=
None
,
groups
=
None
,
purposes
=
None
,
purposes
=
None
,
session
s
=
None
,
model_id
s
=
None
,
**
kwargs
):
**
kwargs
):
"""
"""
This function returns lists of BATLPadFile objects, which fulfill the
This function returns lists of BATLPadFile objects, which fulfill the
...
@@ -221,17 +223,17 @@ class BatlPadDatabase(PadDatabase):
...
@@ -221,17 +223,17 @@ class BatlPadDatabase(PadDatabase):
A list of BATLPadFile objects.
A list of BATLPadFile objects.
"""
"""
protocol
,
stream_type
s
,
max_frames
=
self
.
parse_protocol
(
protocol
)
protocol
,
stream_type
,
max_frames
=
self
.
parse_protocol
(
protocol
)
# Convert group names to low-level group names here.
# Convert group names to low-level group names here.
groups
=
self
.
convert_names_to_lowlevel
(
groups
=
self
.
convert_names_to_lowlevel
(
groups
,
self
.
low_level_group_names
,
self
.
high_level_group_names
)
groups
,
self
.
low_level_group_names
,
self
.
high_level_group_names
)
# Since this database was designed for PAD experiments, nothing special
# Since this database was designed for PAD experiments, nothing special
# needs to be done here.
# needs to be done here.
files
=
self
.
db
.
objects
(
protocol
=
protocol
,
groups
=
groups
,
purposes
=
purposes
**
kwargs
)
#
files = self.db.objects(protocol=protocol, groups=groups, purposes=purposes **kwargs)
files
=
self
.
db
.
objects
(
protocol
=
protocol
,
purposes
=
groups
,
**
kwargs
)
# files = self.db.objects(protocol=protocol, purposes=groups, **kwargs)
#
#
# if purposes == ["real", "attack"]:
# if purposes == ["real", "attack"]:
#
#
...
@@ -294,3 +296,8 @@ class BatlPadDatabase(PadDatabase):
...
@@ -294,3 +296,8 @@ class BatlPadDatabase(PadDatabase):
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