Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
851d70a5
Commit
851d70a5
authored
May 07, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bit of cleanup
parent
a37284fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
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;
full_object_detection
run_predictor
(
shape_predictor
&
predictor
,
py
::
array
img
,
py
::
object
rect
const
rectangle
&
box
)
{
rectangle
box
=
rect
.
cast
<
rectangle
>
();
if
(
is_image
<
unsigned
char
>
(
img
))
{
return
predictor
(
numpy_image
<
unsigned
char
>
(
img
),
box
);
...
...
@@ -69,17 +68,12 @@ std::vector<point> full_obj_det_parts (const full_object_detection& detection)
return
parts
;
}
std
::
shared_ptr
<
full_object_detection
>
full_obj_det_init
(
py
::
object
&
pyrect
,
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
);
std
::
vector
<
point
>
parts
(
num_parts
);
rectangle
rect
=
pyrect
.
cast
<
rectangle
>
();
py
::
iterator
parts_it
=
pyparts
.
begin
();
for
(
unsigned
long
j
=
0
;
parts_it
!=
pyparts
.
end
();
++
j
,
++
parts_it
)
parts
[
j
]
=
parts_it
->
cast
<
point
>
();
std
::
vector
<
point
>
parts
;
for
(
auto
&
item
:
pyparts
)
parts
.
push_back
(
item
.
cast
<
point
>
());
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