Skip to content
GitLab
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
420e5992
Commit
420e5992
authored
Aug 19, 2021
by
Tiago de Freitas Pereira
Browse files
Set annotator as a required argument
parent
1b25e455
Pipeline
#53275
passed with stage
in 49 minutes and 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/bio/face/preprocessor/FaceCrop.py
View file @
420e5992
...
...
@@ -519,16 +519,23 @@ class BoundingBoxAnnotatorCrop(Base):
self
,
cropped_image_size
,
cropped_positions
,
annotator
,
mask_sigma
=
None
,
mask_neighbors
=
5
,
mask_seed
=
None
,
annotator
=
None
,
allow_upside_down_normalized_faces
=
False
,
color_channel
=
"rgb"
,
margin
=
0.5
,
**
kwargs
,
):
if
annotator
is
None
:
raise
ValueError
(
f
"A valid annotator needs to be set."
)
if
isinstance
(
annotator
,
str
):
annotator
=
load_resource
(
annotator
,
"annotator"
)
self
.
annotator
=
annotator
# We need to have the four coordinates
assert
"leye"
in
cropped_positions
assert
"reye"
in
cropped_positions
...
...
@@ -541,9 +548,6 @@ class BoundingBoxAnnotatorCrop(Base):
self
.
mask_sigma
=
mask_sigma
self
.
mask_neighbors
=
mask_neighbors
self
.
mask_seed
=
mask_seed
if
isinstance
(
annotator
,
str
):
annotator
=
load_resource
(
annotator
,
"annotator"
)
self
.
annotator
=
annotator
self
.
allow_upside_down_normalized_faces
=
allow_upside_down_normalized_faces
self
.
color_channel
=
color_channel
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment