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
d86f1654
Commit
d86f1654
authored
4 years ago
by
Tiago de Freitas Pereira
Committed by
Amir MOHAMMADI
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[nose] Fixed gabor-graph recipe for the CI
parent
f44427da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!82
Cleanup
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/face/config/baseline/gabor_graph.py
+18
-10
18 additions, 10 deletions
bob/bio/face/config/baseline/gabor_graph.py
with
18 additions
and
10 deletions
bob/bio/face/config/baseline/gabor_graph.py
+
18
−
10
View file @
d86f1654
from
bob.bio.base.pipelines.vanilla_biometrics
import
(
Distance
,
VanillaBiometricsPipeline
,
BioAlgorithmLegacy
,
BioAlgorithmLegacy
,
)
from
bob.bio.face.config.baseline.helpers
import
crop_80x64
import
math
...
...
@@ -24,6 +24,7 @@ else:
annotation_type
=
None
fixed_positions
=
None
def
get_cropper
(
annotation_type
,
fixed_positions
=
None
):
# Cropping
face_cropper
,
transform_extra_arguments
=
crop_80x64
(
...
...
@@ -31,12 +32,12 @@ def get_cropper(annotation_type, fixed_positions=None):
)
return
face_cropper
,
transform_extra_arguments
def
get_pipeline
(
face_cropper
,
transform_extra_arguments
):
preprocessor
=
bob
.
bio
.
face
.
preprocessor
.
INormLBP
(
face_cropper
=
face_cropper
,
dtype
=
np
.
float64
)
#### FEATURE EXTRACTOR ######
# legacy objects needs to be wrapped with legacy transformers
...
...
@@ -55,12 +56,13 @@ def get_pipeline(face_cropper, transform_extra_arguments):
transformer
=
make_pipeline
(
wrap
(
[
"
sample
"
],
preprocessor
,
transform_extra_arguments
=
transform_extra_arguments
,
[
"
sample
"
],
preprocessor
,
transform_extra_arguments
=
transform_extra_arguments
,
),
wrap
([
"
sample
"
],
gabor_graph
),
)
gabor_jet
=
bob
.
bio
.
face
.
algorithm
.
GaborJet
(
gabor_jet_similarity_type
=
"
PhaseDiffPlusCanberra
"
,
multiple_feature_scoring
=
"
max_jet
"
,
...
...
@@ -68,11 +70,13 @@ def get_pipeline(face_cropper, transform_extra_arguments):
)
# Set default temporary directory
user_env_var
=
os
.
getenv
(
"
USER
"
,
None
)
if
user_env_var
:
default_temp
=
os
.
path
.
join
(
"
/idiap
"
,
"
temp
"
,
user_env_var
)
if
user_env_var
and
os
.
path
.
exists
(
default_temp
):
tempdir
=
os
.
path
.
join
(
default_temp
,
"
bob_bio_base_tmp
"
,
"
gabor_graph
"
)
default_temp
=
(
os
.
path
.
join
(
"
/idiap
"
,
"
temp
"
,
os
.
environ
[
"
USER
"
])
if
"
USER
"
in
os
.
environ
else
"
~/temp
"
)
if
os
.
path
.
exists
(
default_temp
):
tempdir
=
os
.
path
.
join
(
default_temp
,
"
bob_bio_base_tmp
"
)
else
:
# if /idiap/temp/<USER> does not exist, use /tmp/tmpxxxxxxxx
tempdir
=
tempfile
.
TemporaryDirectory
().
name
...
...
@@ -80,11 +84,15 @@ def get_pipeline(face_cropper, transform_extra_arguments):
algorithm
=
BioAlgorithmLegacy
(
gabor_jet
,
base_dir
=
tempdir
)
return
VanillaBiometricsPipeline
(
transformer
,
algorithm
)
def
load
(
annotation_type
,
fixed_positions
=
None
):
####### SOLVING THE FACE CROPPER TO BE USED ##########
face_cropper
,
transform_extra_arguments
=
get_cropper
(
annotation_type
,
fixed_positions
)
face_cropper
,
transform_extra_arguments
=
get_cropper
(
annotation_type
,
fixed_positions
)
return
get_pipeline
(
face_cropper
,
transform_extra_arguments
)
pipeline
=
load
(
annotation_type
,
fixed_positions
)
transformer
=
pipeline
.
transformer
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