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
0a7c4293
Commit
0a7c4293
authored
6 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Plain Diff
Merge branch 'chalearn_pad' into 'master'
Chalearn pad See merge request
!87
parents
ec03294b
781e0098
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!87
Chalearn pad
Pipeline
#27140
passed
6 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/pad/face/database/casiasurf.py
+3
-3
3 additions, 3 deletions
bob/pad/face/database/casiasurf.py
bob/pad/face/preprocessor/FaceCropAlign.py
+14
-3
14 additions, 3 deletions
bob/pad/face/preprocessor/FaceCropAlign.py
with
17 additions
and
6 deletions
bob/pad/face/database/casiasurf.py
+
3
−
3
View file @
0a7c4293
...
...
@@ -144,7 +144,7 @@ class CasiaSurfPadDatabase(PadDatabase):
The protocol for which the samples should be retrieved.
purposes : :py:class:`str`
The purposes for which Sample objects should be retrieved.
Usually it is either
'
real
'
or
'
attack
'
, but could be
'
unknown
'
as well
Usually it is either
'
real
'
or
'
attack
'
model_ids
This parameter is not supported in PAD databases yet.
...
...
@@ -160,9 +160,9 @@ class CasiaSurfPadDatabase(PadDatabase):
# for training
lowlevel_purposes
=
[]
if
'
train
'
in
groups
and
purposes
==
'
real
'
:
if
'
train
'
in
groups
and
'
real
'
in
purposes
:
lowlevel_purposes
.
append
(
'
real
'
)
if
'
train
'
in
groups
and
purposes
==
'
attack
'
:
if
'
train
'
in
groups
and
'
attack
'
in
purposes
:
lowlevel_purposes
.
append
(
'
attack
'
)
# for dev and eval
...
...
This diff is collapsed.
Click to expand it.
bob/pad/face/preprocessor/FaceCropAlign.py
+
14
−
3
View file @
0a7c4293
...
...
@@ -19,8 +19,10 @@ import bob.ip.base
import
importlib
import
bob.bio.face
import
bob.bio.face
import
logging
logger
=
logging
.
getLogger
(
"
bob.pad.face
"
)
# ==============================================================================
...
...
@@ -551,6 +553,7 @@ class FaceCropAlign(Preprocessor):
self
.
normalization_function
=
normalization_function
self
.
normalization_function_kwargs
=
normalization_function_kwargs
self
.
supported_face_detection_method
=
[
"
dlib
"
,
"
mtcnn
"
]
...
...
@@ -619,6 +622,15 @@ class FaceCropAlign(Preprocessor):
(self.face_size, self.face_size), RGB 3D or gray-scale 2D.
"""
# sanity check:
if
not
self
.
rgb_output_flag
and
len
(
image
.
shape
)
!=
2
:
logger
.
warning
(
"
This image has 3 channels
"
)
if
self
.
normalization_function
is
not
None
:
import
bob.ip.color
image
=
bob
.
ip
.
color
.
rgb_to_gray
(
image
)
logger
.
warning
(
"
Image has been converted to grayscale
"
)
if
self
.
face_detection_method
is
not
None
:
if
self
.
max_image_size
is
not
None
:
# max_image_size = 1920, for example
...
...
@@ -633,7 +645,7 @@ class FaceCropAlign(Preprocessor):
method
=
self
.
face_detection_method
)
except
:
logger
.
warning
(
"
Face not detected
"
)
return
None
if
not
annotations
:
# if empty dictionary is returned
...
...
@@ -656,7 +668,6 @@ class FaceCropAlign(Preprocessor):
return
None
if
self
.
normalization_function
is
not
None
:
image
=
self
.
normalization_function
(
image
,
annotations
,
**
self
.
normalization_function_kwargs
)
norm_face_image
=
normalize_image_size
(
image
=
image
,
...
...
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