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
86fa427e
Commit
86fa427e
authored
Sep 10, 2016
by
Davis King
Browse files
Made input_rgb_image_pyramid use multiple cores while building the pyramid.
parent
6168781a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
dlib/dnn/input.h
dlib/dnn/input.h
+12
-11
No files found.
dlib/dnn/input.h
View file @
86fa427e
...
...
@@ -567,15 +567,21 @@ namespace dlib
}
matrix
<
rgb_pixel
>
img
;
create_tiled_pyramid
<
pyramid_type
>
(
*
ibegin
,
img
,
data
.
annotation
().
get
<
std
::
vector
<
rectangle
>>
());
nr
=
img
.
nr
();
nc
=
img
.
nc
();
data
.
set_size
(
std
::
distance
(
ibegin
,
iend
),
3
,
nr
,
nc
);
std
::
vector
<
matrix
<
rgb_pixel
>>
imgs
(
std
::
distance
(
ibegin
,
iend
));
parallel_for
(
0
,
imgs
.
size
(),
[
&
](
long
i
){
std
::
vector
<
rectangle
>
rects
;
if
(
i
==
0
)
create_tiled_pyramid
<
pyramid_type
>
(
ibegin
[
i
],
imgs
[
i
],
data
.
annotation
().
get
<
std
::
vector
<
rectangle
>>
());
else
create_tiled_pyramid
<
pyramid_type
>
(
ibegin
[
i
],
imgs
[
i
],
rects
);
});
nr
=
imgs
[
0
].
nr
();
nc
=
imgs
[
0
].
nc
();
data
.
set_size
(
imgs
.
size
(),
3
,
nr
,
nc
);
const
size_t
offset
=
nr
*
nc
;
auto
ptr
=
data
.
host
();
while
(
true
)
for
(
auto
&&
img
:
imgs
)
{
for
(
long
r
=
0
;
r
<
nr
;
++
r
)
{
...
...
@@ -592,11 +598,6 @@ namespace dlib
}
}
ptr
+=
offset
*
(
data
.
k
()
-
1
);
++
ibegin
;
if
(
ibegin
==
iend
)
break
;
create_tiled_pyramid
<
pyramid_type
>
(
*
ibegin
,
img
,
data
.
annotation
().
get
<
std
::
vector
<
rectangle
>>
());
}
}
...
...
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