Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.bio.face
Commits
ac1753ba
Commit
ac1753ba
authored
Oct 28, 2020
by
Tiago de Freitas Pereira
Browse files
Merge branch 'fix-naming-tests' into 'dask-pipelines'
Fix transformers naming in tests See merge request
!72
parents
176353c2
73eabc81
Pipeline
#44596
failed with stage
in 46 minutes
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
ac1753ba
...
...
@@ -13,3 +13,4 @@ sphinx
dist
record.txt
build/
bob/bio/face/embeddings/data
bob/bio/face/test/test_baselines.py
View file @
ac1753ba
...
...
@@ -57,12 +57,12 @@ def get_fake_samples_for_training():
]
def
run_baseline
(
baseline
,
samples_for_training
=
[]):
def
run_baseline
(
baseline
,
samples_for_training
=
[]):
biometric_references
=
get_fake_sample_set
(
purpose
=
"bioref"
)
probes
=
get_fake_sample_set
(
purpose
=
"probe"
)
# Regular pipeline
pipeline
=
load_resource
(
baseline
,
"pipeline"
)
pipeline
=
load_resource
(
baseline
,
"pipeline"
)
scores
=
pipeline
(
samples_for_training
,
biometric_references
,
probes
)
assert
len
(
scores
)
==
1
assert
len
(
scores
[
0
])
==
1
...
...
@@ -72,7 +72,7 @@ def run_baseline(baseline, samples_for_training=[]):
checkpoint_pipeline
=
checkpoint_vanilla_biometrics
(
copy
.
deepcopy
(
pipeline
),
base_dir
=
d
)
)
checkpoint_scores
=
checkpoint_pipeline
([],
biometric_references
,
probes
)
assert
len
(
checkpoint_scores
)
==
1
assert
len
(
checkpoint_scores
[
0
])
==
1
...
...
@@ -104,23 +104,23 @@ def run_baseline(baseline, samples_for_training=[]):
def
test_facenet_baseline
():
run_baseline
(
"facenet
_
sanderberg"
)
run_baseline
(
"facenet
-
sanderberg"
)
def
test_inception_resnetv2_msceleb
():
run_baseline
(
"inception
_
resnetv2
_
msceleb"
)
run_baseline
(
"inception
-
resnetv2
-
msceleb"
)
def
test_inception_resnetv2_casiawebface
():
run_baseline
(
"inception
_
resnetv2
_
casiawebface"
)
run_baseline
(
"inception
-
resnetv2
-
casiawebface"
)
def
test_inception_resnetv1_msceleb
():
run_baseline
(
"inception
_
resnetv1
_
msceleb"
)
run_baseline
(
"inception
-
resnetv1
-
msceleb"
)
def
test_inception_resnetv1_casiawebface
():
run_baseline
(
"inception
_
resnetv1
_
casiawebface"
)
run_baseline
(
"inception
-
resnetv1
-
casiawebface"
)
def
test_arcface_insight_tf
():
...
...
@@ -128,7 +128,7 @@ def test_arcface_insight_tf():
tf
.
compat
.
v1
.
reset_default_graph
()
run_baseline
(
"arcface
_
insight
_
tf"
)
run_baseline
(
"arcface
-
insight
-
tf"
)
def
test_gabor_graph
():
...
...
bob/bio/face/test/test_transformers.py
View file @
ac1753ba
...
...
@@ -11,8 +11,8 @@ def get_fake_sample(face_size=(160, 160), eyes={"leye": (46, 107), "reye": (46,
return
Sample
(
data
,
key
=
"1"
,
annotations
=
annotations
)
def
test_facenet
():
transformer
=
load_resource
(
"facenet
_
sanderberg"
,
"transformer"
)
def
test_facenet
():
transformer
=
load_resource
(
"facenet
-
sanderberg"
,
"transformer"
)
fake_sample
=
get_fake_sample
()
...
...
@@ -22,7 +22,7 @@ def test_facenet():
def
test_inception_resnetv2_msceleb
():
transformer
=
load_resource
(
"inception
_
resnetv2
_
msceleb"
,
"transformer"
)
transformer
=
load_resource
(
"inception
-
resnetv2
-
msceleb"
,
"transformer"
)
fake_sample
=
get_fake_sample
()
...
...
@@ -32,7 +32,7 @@ def test_inception_resnetv2_msceleb():
def
test_inception_resnetv2_casiawebface
():
transformer
=
load_resource
(
"inception
_
resnetv2
_
casiawebface"
,
"transformer"
)
transformer
=
load_resource
(
"inception
-
resnetv2
-
casiawebface"
,
"transformer"
)
fake_sample
=
get_fake_sample
()
...
...
@@ -42,7 +42,7 @@ def test_inception_resnetv2_casiawebface():
def
test_inception_resnetv1_msceleb
():
transformer
=
load_resource
(
"inception
_
resnetv1
_
msceleb"
,
"transformer"
)
transformer
=
load_resource
(
"inception
-
resnetv1
-
msceleb"
,
"transformer"
)
fake_sample
=
get_fake_sample
()
...
...
@@ -52,7 +52,7 @@ def test_inception_resnetv1_msceleb():
def
test_inception_resnetv1_casiawebface
():
transformer
=
load_resource
(
"inception
_
resnetv1
_
casiawebface"
,
"transformer"
)
transformer
=
load_resource
(
"inception
-
resnetv1
-
casiawebface"
,
"transformer"
)
fake_sample
=
get_fake_sample
()
...
...
@@ -64,7 +64,7 @@ def test_inception_resnetv1_casiawebface():
def
test_arcface_insight_tf
():
import
tensorflow
as
tf
tf
.
compat
.
v1
.
reset_default_graph
()
transformer
=
load_resource
(
"arcface
_
insight
_
tf"
,
"transformer"
)
transformer
=
load_resource
(
"arcface
-
insight
-
tf"
,
"transformer"
)
fake_sample
=
get_fake_sample
()
...
...
@@ -74,7 +74,7 @@ def test_arcface_insight_tf():
def
test_gabor_graph
():
transformer
=
load_resource
(
"gabor
_
graph"
,
"transformer"
)
transformer
=
load_resource
(
"gabor
-
graph"
,
"transformer"
)
fake_sample
=
get_fake_sample
()
transformed_sample
=
transformer
.
transform
([
fake_sample
])[
0
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment