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
009e21a8
There was a problem fetching the pipeline summary.
Commit
009e21a8
authored
7 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
Test min_face_size_validator
parent
1e8e19f2
No related branches found
No related tags found
1 merge request
!41
Add annotators
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/bio/face/annotator/__init__.py
+3
-1
3 additions, 1 deletion
bob/bio/face/annotator/__init__.py
bob/bio/face/test/test_annotators.py
+19
-1
19 additions, 1 deletion
bob/bio/face/test/test_annotators.py
with
22 additions
and
2 deletions
bob/bio/face/annotator/__init__.py
+
3
−
1
View file @
009e21a8
...
@@ -36,7 +36,9 @@ def min_face_size_validator(annotations, min_face_size=(32, 32)):
...
@@ -36,7 +36,9 @@ def min_face_size_validator(annotations, min_face_size=(32, 32)):
bool
bool
True, if the face is large enough.
True, if the face is large enough.
"""
"""
bbx
=
bob
.
ip
.
facedetect
.
bounding_box_from_annotations
(
if
not
annotations
:
return
False
bbx
=
bob
.
ip
.
facedetect
.
bounding_box_from_annotation
(
source
=
'
direct
'
,
**
annotations
)
source
=
'
direct
'
,
**
annotations
)
if
bbx
.
size
<
min_face_size
:
if
bbx
.
size
<
min_face_size
:
return
False
return
False
...
...
This diff is collapsed.
Click to expand it.
bob/bio/face/test/test_annotators.py
+
19
−
1
View file @
009e21a8
...
@@ -2,7 +2,8 @@ import bob.io.base
...
@@ -2,7 +2,8 @@ import bob.io.base
import
bob.io.base.test_utils
import
bob.io.base.test_utils
import
bob.io.image
import
bob.io.image
from
bob.bio.face.annotator
import
(
from
bob.bio.face.annotator
import
(
BobIpFacedetect
,
BoundingBoxToEyes
,
BobIpFlandmark
)
BobIpFacedetect
,
BoundingBoxToEyes
,
BobIpFlandmark
,
min_face_size_validator
)
from
bob.bio.base.annotator
import
FailSafe
from
bob.bio.base.annotator
import
FailSafe
import
numpy
import
numpy
...
@@ -46,3 +47,20 @@ def test_bob_ip_flandmark():
...
@@ -46,3 +47,20 @@ def test_bob_ip_flandmark():
_assert_bob_ip_facedetect
(
annot
)
_assert_bob_ip_facedetect
(
annot
)
assert
[
int
(
x
)
for
x
in
annot
[
'
reye
'
]]
==
[
183
,
127
],
annot
assert
[
int
(
x
)
for
x
in
annot
[
'
reye
'
]]
==
[
183
,
127
],
annot
assert
[
int
(
x
)
for
x
in
annot
[
'
leye
'
]]
==
[
174
,
223
],
annot
assert
[
int
(
x
)
for
x
in
annot
[
'
leye
'
]]
==
[
174
,
223
],
annot
def
test_min_face_size_validator
():
valid
=
{
'
topleft
'
:
(
0
,
0
),
'
bottomright
'
:
(
32
,
32
),
}
assert
min_face_size_validator
(
valid
)
not_valid
=
{
'
topleft
'
:
(
0
,
0
),
'
bottomright
'
:
(
28
,
32
),
}
assert
not
min_face_size_validator
(
not_valid
)
assert
not
min_face_size_validator
(
None
)
assert
not
min_face_size_validator
({})
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