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
a282657d
Commit
a282657d
authored
7 years ago
by
Olegs NIKISINS
Browse files
Options
Downloads
Patches
Plain Diff
Added V1 annotations method to Batl HLDI
parent
4e0fccb6
No related branches found
No related tags found
1 merge request
!59
Added HLDI for the BATL database, added optional data normalization in FaceCropAlign
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/pad/face/database/batl.py
+40
-0
40 additions, 0 deletions
bob/pad/face/database/batl.py
with
40 additions
and
0 deletions
bob/pad/face/database/batl.py
+
40
−
0
View file @
a282657d
...
...
@@ -10,6 +10,8 @@ from bob.db.batl.batl_config import BATL_CONFIG
import
pkg_resources
from
batl.utils.data
import
load_data_config
from
bob.pad.face.preprocessor.FaceCropAlign
import
detect_face_landmarks_in_image
class
BatlPadFile
(
PadFile
):
"""
A high level implementation of the File class for the BATL
...
...
@@ -84,6 +86,8 @@ class BatlPadDatabase(PadDatabase):
protocol
=
'
grandtest
'
,
original_directory
=
rc
[
'
bob.db.batl.directory
'
],
original_extension
=
'
.h5
'
,
annotations_temp_dir
=
None
,
landmark_detect_method
=
"
mtcnn
"
,
**
kwargs
):
"""
Parameters
...
...
@@ -131,6 +135,12 @@ class BatlPadDatabase(PadDatabase):
original_extension
=
original_extension
,
**
kwargs
)
self
.
protocol
=
protocol
self
.
original_directory
=
original_directory
self
.
original_extension
=
original_extension
self
.
annotations_temp_dir
=
annotations_temp_dir
self
.
landmark_detect_method
=
landmark_detect_method
@property
def
original_directory
(
self
):
return
self
.
db
.
original_directory
...
...
@@ -223,4 +233,34 @@ class BatlPadDatabase(PadDatabase):
def
annotations
(
self
,
f
):
pass
# if annotations_temp_dir is None:
video
=
f
.
load
(
self
,
directory
=
self
.
original_directory
,
extension
=
self
.
original_extension
,
stream_type
=
"
color
"
,
# TODO: this parameter is currently missing in bob.db.batl, add it there
reference_stream_type
=
"
color
"
,
data_format_config
=
load_data_config
(
pkg_resources
.
resource_filename
(
'
batl.utils
'
,
'
config/idiap_hdf5_data_config.json
'
)),
warp_to_reference
=
False
,
convert_to_rgb
=
False
,
crop
=
None
,
max_frames
=
None
)
annotations
=
{}
for
idx
,
image
in
enumerate
(
video
):
frame_annotations
=
detect_face_landmarks_in_image
(
image
,
method
=
self
.
landmark_detect_method
)
if
frame_annotations
:
annotations
[
str
(
idx
)]
=
frame_annotations
return
annotations
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