Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
851d70a5
Commit
851d70a5
authored
May 07, 2018
by
Davis King
Browse files
A bit of cleanup
parent
a37284fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
tools/python/src/shape_predictor.cpp
tools/python/src/shape_predictor.cpp
+5
-11
No files found.
tools/python/src/shape_predictor.cpp
View file @
851d70a5
...
@@ -18,10 +18,9 @@ namespace py = pybind11;
...
@@ -18,10 +18,9 @@ namespace py = pybind11;
full_object_detection
run_predictor
(
full_object_detection
run_predictor
(
shape_predictor
&
predictor
,
shape_predictor
&
predictor
,
py
::
array
img
,
py
::
array
img
,
py
::
object
rect
const
rectangle
&
box
)
)
{
{
rectangle
box
=
rect
.
cast
<
rectangle
>
();
if
(
is_image
<
unsigned
char
>
(
img
))
if
(
is_image
<
unsigned
char
>
(
img
))
{
{
return
predictor
(
numpy_image
<
unsigned
char
>
(
img
),
box
);
return
predictor
(
numpy_image
<
unsigned
char
>
(
img
),
box
);
...
@@ -69,17 +68,12 @@ std::vector<point> full_obj_det_parts (const full_object_detection& detection)
...
@@ -69,17 +68,12 @@ std::vector<point> full_obj_det_parts (const full_object_detection& detection)
return
parts
;
return
parts
;
}
}
std
::
shared_ptr
<
full_object_detection
>
full_obj_det_init
(
py
::
object
&
py
rect
,
py
::
objec
t
&
pyparts
)
std
::
shared_ptr
<
full_object_detection
>
full_obj_det_init
(
const
rectangle
&
rect
,
py
::
lis
t
&
pyparts
)
{
{
const
unsigned
long
num_parts
=
py
::
len
(
pyparts
);
const
unsigned
long
num_parts
=
py
::
len
(
pyparts
);
std
::
vector
<
point
>
parts
(
num_parts
);
std
::
vector
<
point
>
parts
;
rectangle
rect
=
pyrect
.
cast
<
rectangle
>
();
for
(
auto
&
item
:
pyparts
)
py
::
iterator
parts_it
=
pyparts
.
begin
();
parts
.
push_back
(
item
.
cast
<
point
>
());
for
(
unsigned
long
j
=
0
;
parts_it
!=
pyparts
.
end
();
++
j
,
++
parts_it
)
parts
[
j
]
=
parts_it
->
cast
<
point
>
();
return
std
::
make_shared
<
full_object_detection
>
(
rect
,
parts
);
return
std
::
make_shared
<
full_object_detection
>
(
rect
,
parts
);
}
}
...
...
Write
Preview
Markdown
is supported
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