Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.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.bio.face
Commits
c2a907cc
Commit
c2a907cc
authored
3 years ago
by
Laurent COLBOIS
Browse files
Options
Downloads
Patches
Plain Diff
Regrouping config helper modules
parent
6f5e3a4f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!119
Refactor baseline config helpers
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/bio/face/config/baseline/helpers.py
+37
-1
37 additions, 1 deletion
bob/bio/face/config/baseline/helpers.py
bob/bio/face/helpers.py
+0
-37
0 additions, 37 deletions
bob/bio/face/helpers.py
with
37 additions
and
38 deletions
bob/bio/face/config/baseline/helpers.py
+
37
−
1
View file @
c2a907cc
import
bob.bio.face
import
bob.bio.face
from
bob.bio.face.preprocessor
import
FaceCrop
,
MultiFaceCrop
,
Scale
from
sklearn.pipeline
import
make_pipeline
from
sklearn.pipeline
import
make_pipeline
from
bob.bio.base.wrappers
import
wrap_sample_preprocessor
from
bob.bio.base.wrappers
import
wrap_sample_preprocessor
from
bob.pipelines
import
wrap
from
bob.pipelines
import
wrap
from
bob.bio.face.helpers
import
face_crop_solver
import
numpy
as
np
import
numpy
as
np
import
logging
import
logging
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
def
face_crop_solver
(
cropped_image_size
,
cropped_positions
=
None
,
color_channel
=
"
rgb
"
,
fixed_positions
=
None
,
annotator
=
None
,
dtype
=
"
uint8
"
,
):
"""
Decide which face cropper to use.
"""
# If there's not cropped positions, just resize
if
cropped_positions
is
None
:
return
Scale
(
cropped_image_size
)
else
:
# Detects the face and crops it without eye detection
if
isinstance
(
cropped_positions
,
list
):
return
MultiFaceCrop
(
cropped_image_size
=
cropped_image_size
,
cropped_positions_list
=
cropped_positions
,
fixed_positions_list
=
fixed_positions
,
color_channel
=
color_channel
,
dtype
=
dtype
,
annotation
=
annotator
,
)
else
:
return
FaceCrop
(
cropped_image_size
=
cropped_image_size
,
cropped_positions
=
cropped_positions
,
color_channel
=
color_channel
,
fixed_positions
=
fixed_positions
,
dtype
=
dtype
,
annotator
=
annotator
,
)
def
embedding_transformer_default_cropping
(
cropped_image_size
,
annotation_type
):
def
embedding_transformer_default_cropping
(
cropped_image_size
,
annotation_type
):
"""
"""
Computes the default cropped positions for the FaceCropper used with Facenet-like
Computes the default cropped positions for the FaceCropper used with Facenet-like
...
...
This diff is collapsed.
Click to expand it.
bob/bio/face/helpers.py
deleted
100644 → 0
+
0
−
37
View file @
6f5e3a4f
from
bob.bio.face.preprocessor
import
FaceCrop
,
MultiFaceCrop
,
Scale
def
face_crop_solver
(
cropped_image_size
,
cropped_positions
=
None
,
color_channel
=
"
rgb
"
,
fixed_positions
=
None
,
annotator
=
None
,
dtype
=
"
uint8
"
,
):
"""
Decide which face cropper to use.
"""
# If there's not cropped positions, just resize
if
cropped_positions
is
None
:
return
Scale
(
cropped_image_size
)
else
:
# Detects the face and crops it without eye detection
if
isinstance
(
cropped_positions
,
list
):
return
MultiFaceCrop
(
cropped_image_size
=
cropped_image_size
,
cropped_positions_list
=
cropped_positions
,
fixed_positions_list
=
fixed_positions
,
color_channel
=
color_channel
,
dtype
=
dtype
,
annotation
=
annotator
,
)
else
:
return
FaceCrop
(
cropped_image_size
=
cropped_image_size
,
cropped_positions
=
cropped_positions
,
color_channel
=
color_channel
,
fixed_positions
=
fixed_positions
,
dtype
=
dtype
,
annotator
=
annotator
,
)
This diff is collapsed.
Click to expand it.
Laurent COLBOIS
@lcolbois
mentioned in commit
a3abe09d
·
3 years ago
mentioned in commit
a3abe09d
mentioned in commit a3abe09d0bcc81c9f543869e80556250e909667f
Toggle commit list
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