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
Merge requests
!123
Working out embeddings
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Working out embeddings
small-refactoring
into
feature-extractors
Overview
1
Commits
6
Pipelines
5
Changes
25
Merged
Tiago de Freitas Pereira
requested to merge
small-refactoring
into
feature-extractors
3 years ago
Overview
1
Commits
6
Pipelines
5
Changes
25
Expand
0
0
Merge request reports
Compare
feature-extractors
version 4
79ac821c
3 years ago
version 3
b4e147d1
3 years ago
version 2
f977d22c
3 years ago
version 1
70604018
3 years ago
feature-extractors (base)
and
latest version
latest version
05cabb1a
6 commits,
3 years ago
version 4
79ac821c
5 commits,
3 years ago
version 3
b4e147d1
3 commits,
3 years ago
version 2
f977d22c
2 commits,
3 years ago
version 1
70604018
1 commit,
3 years ago
25 files
+
993
−
988
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
25
Search (e.g. *.vue) (Ctrl+P)
bob/bio/face/config/baseline/
opencv_pip
e.py
→
bob/bio/face/config/baseline/
afff
e.py
+
24
−
14
Options
@@ -2,7 +2,7 @@ import bob.bio.base
from
bob.bio.base.pipelines.vanilla_biometrics
import
Distance
from
bob.bio.base.pipelines.vanilla_biometrics
import
VanillaBiometricsPipeline
from
bob.bio.face.preprocessor
import
FaceCrop
from
bob.bio.face.embeddings.
GenericOpenCV
import
OpenCVModel
from
bob.bio.face.embeddings.
pytorch
import
AFFFE_2021
from
bob.pipelines
import
wrap
import
scipy.spatial
from
sklearn.pipeline
import
make_pipeline
@@ -20,26 +20,36 @@ else:
annotation_type
=
None
fixed_positions
=
None
cropped_positions
=
{
'
leye
'
:(
100
,
140
),
'
reye
'
:(
100
,
95
)}
preprocessor_transformer
=
FaceCrop
(
cropped_image_size
=
(
224
,
224
),
cropped_positions
=
cropped_positions
,
color_channel
=
'
rgb
'
,
fixed_positions
=
fixed_positions
,
allow_upside_down_normalized_faces
=
True
)
cropped_positions
=
{
"
leye
"
:
(
110
,
144
),
"
reye
"
:
(
110
,
96
)}
transform_extra_arguments
=
(
None
if
(
cropped_positions
is
None
or
fixed_positions
is
not
None
)
else
((
"
annotations
"
,
"
annotations
"
),))
#Extractor
weights
=
None
# PATH/TO/WEIGHTS
config
=
None
# PATH/TO/CONFIG
extractor_transformer
=
OpenCVModel
(
weights
=
weights
,
config
=
config
)
preprocessor_transformer
=
FaceCrop
(
cropped_image_size
=
(
224
,
224
),
cropped_positions
=
cropped_positions
,
color_channel
=
"
rgb
"
,
fixed_positions
=
fixed_positions
,
allow_upside_down_normalized_faces
=
True
,
)
transform_extra_arguments
=
(
None
if
(
cropped_positions
is
None
or
fixed_positions
is
not
None
)
else
((
"
annotations
"
,
"
annotations
"
),)
)
extractor_transformer
=
AFFFE_2021
()
#Algorithm
algorithm
=
Distance
(
distance_function
=
scipy
.
spatial
.
distance
.
cosine
,
is_distance_function
=
True
)
# Algorithm
algorithm
=
Distance
(
distance_function
=
scipy
.
spatial
.
distance
.
cosine
,
is_distance_function
=
True
)
# Chain the Transformers together
transformer
=
make_pipeline
(
wrap
([
"
sample
"
],
preprocessor_transformer
,
transform_extra_arguments
=
transform_extra_arguments
),
wrap
(
[
"
sample
"
],
preprocessor_transformer
,
transform_extra_arguments
=
transform_extra_arguments
,
),
wrap
([
"
sample
"
],
extractor_transformer
)
# Add more transformers here if needed
)
Loading