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
0dd91782
Commit
0dd91782
authored
Nov 06, 2020
by
Laurent COLBOIS
Browse files
[Preprocessor] Patching tests with new convention
parent
8c1f8613
Pipeline
#44976
failed with stage
in 52 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/face/test/test_preprocessors.py
View file @
0dd91782
...
...
@@ -79,7 +79,7 @@ def test_base():
# read input
image
=
_image
()
preprocessed
=
base
.
transform
(
image
)
preprocessed
=
base
.
transform
(
[
image
])[
0
]
assert
preprocessed
.
ndim
==
2
assert
preprocessed
.
dtype
==
numpy
.
float64
...
...
@@ -87,7 +87,7 @@ def test_base():
# color output
base
=
bob
.
bio
.
face
.
preprocessor
.
Base
(
color_channel
=
"rgb"
,
dtype
=
numpy
.
uint8
)
colored
=
base
.
transform
(
bob
.
ip
.
color
.
rgb_to_gray
(
image
)
)
colored
=
base
.
transform
(
[
bob
.
ip
.
color
.
rgb_to_gray
(
image
)
])[
0
]
assert
colored
.
ndim
==
3
assert
colored
.
dtype
==
numpy
.
uint8
...
...
@@ -95,7 +95,7 @@ def test_base():
numpy
.
allclose
(
colored
[
c
],
bob
.
ip
.
color
.
rgb_to_gray
(
image
))
for
c
in
range
(
3
)
)
colored
=
base
.
transform
(
image
)
colored
=
base
.
transform
(
[
image
])[
0
]
assert
colored
.
ndim
==
3
assert
colored
.
dtype
==
numpy
.
uint8
assert
numpy
.
all
(
colored
==
image
)
...
...
@@ -131,7 +131,7 @@ def test_face_crop():
_compare
(
fixed_cropper
.
transform
([
image
]),
reference
)
# check color cropping
cropper
.
channel
=
"rgb"
cropper
.
color_
channel
=
"rgb"
cropped
=
cropper
.
transform
([
image
],
[
annotation
])[
0
]
assert
cropped
.
ndim
==
3
assert
cropped
.
shape
[
0
]
==
3
...
...
@@ -149,7 +149,7 @@ def test_face_crop():
pass
# reset the configuration, so that later tests don't get screwed.
cropper
.
channel
=
"gray"
cropper
.
color_
channel
=
"gray"
def
test_tan_triggs
():
...
...
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