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
68888c05
"tests/vscode:/vscode.git/clone" did not exist on "0015eff7875541eee40e67e87687a8772aa5b7fd"
Commit
68888c05
authored
Sep 25, 2015
by
Davis King
Browse files
Renamed more variables
parent
f9ba2e38
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
28 deletions
+28
-28
dlib/dnn/input.h
dlib/dnn/input.h
+16
-16
dlib/dnn/input_abstract.h
dlib/dnn/input_abstract.h
+12
-12
No files found.
dlib/dnn/input.h
View file @
68888c05
...
...
@@ -33,16 +33,16 @@ namespace dlib
template
<
typename
input_iterator
>
void
to_tensor
(
input_iterator
begin
,
input_iterator
end
,
input_iterator
i
begin
,
input_iterator
i
end
,
resizable_tensor
&
data
)
const
{
DLIB_CASSERT
(
std
::
distance
(
begin
,
end
)
>
0
,
""
);
const
auto
nr
=
begin
->
nr
();
const
auto
nc
=
begin
->
nc
();
DLIB_CASSERT
(
std
::
distance
(
i
begin
,
i
end
)
>
0
,
""
);
const
auto
nr
=
i
begin
->
nr
();
const
auto
nc
=
i
begin
->
nc
();
// make sure all the input matrices have the same dimensions
for
(
auto
i
=
begin
;
i
!=
end
;
++
i
)
for
(
auto
i
=
i
begin
;
i
!=
i
end
;
++
i
)
{
DLIB_CASSERT
(
i
->
nr
()
==
nr
&&
i
->
nc
()
==
nc
,
"
\t
input::to_tensor()"
...
...
@@ -56,10 +56,10 @@ namespace dlib
// initialize data to the right size to contain the stuff in the iterator range.
data
.
set_size
(
std
::
distance
(
begin
,
end
),
nr
,
nc
,
pixel_traits
<
T
>::
num
);
data
.
set_size
(
std
::
distance
(
i
begin
,
i
end
),
nr
,
nc
,
pixel_traits
<
T
>::
num
);
auto
ptr
=
data
.
host
();
for
(
auto
i
=
begin
;
i
!=
end
;
++
i
)
for
(
auto
i
=
i
begin
;
i
!=
i
end
;
++
i
)
{
for
(
long
r
=
0
;
r
<
nr
;
++
r
)
{
...
...
@@ -86,16 +86,16 @@ namespace dlib
template
<
typename
input_iterator
>
void
to_tensor
(
input_iterator
begin
,
input_iterator
end
,
input_iterator
i
begin
,
input_iterator
i
end
,
resizable_tensor
&
data
)
const
{
DLIB_CASSERT
(
std
::
distance
(
begin
,
end
)
>
0
,
""
);
const
auto
nr
=
begin
->
nr
();
const
auto
nc
=
begin
->
nc
();
DLIB_CASSERT
(
std
::
distance
(
i
begin
,
i
end
)
>
0
,
""
);
const
auto
nr
=
i
begin
->
nr
();
const
auto
nc
=
i
begin
->
nc
();
// make sure all the input matrices have the same dimensions
for
(
auto
i
=
begin
;
i
!=
end
;
++
i
)
for
(
auto
i
=
i
begin
;
i
!=
i
end
;
++
i
)
{
DLIB_CASSERT
(
i
->
nr
()
==
nr
&&
i
->
nc
()
==
nc
,
"
\t
input::to_tensor()"
...
...
@@ -109,10 +109,10 @@ namespace dlib
// initialize data to the right size to contain the stuff in the iterator range.
data
.
set_size
(
std
::
distance
(
begin
,
end
),
nr
,
nc
,
pixel_traits
<
T
>::
num
);
data
.
set_size
(
std
::
distance
(
i
begin
,
i
end
),
nr
,
nc
,
pixel_traits
<
T
>::
num
);
auto
ptr
=
data
.
host
();
for
(
auto
i
=
begin
;
i
!=
end
;
++
i
)
for
(
auto
i
=
i
begin
;
i
!=
i
end
;
++
i
)
{
for
(
long
r
=
0
;
r
<
nr
;
++
r
)
{
...
...
dlib/dnn/input_abstract.h
View file @
68888c05
...
...
@@ -59,22 +59,22 @@ namespace dlib
template
<
typename
input_iterator
>
void
to_tensor
(
input_iterator
begin
,
input_iterator
end
,
input_iterator
i
begin
,
input_iterator
i
end
,
resizable_tensor
&
data
)
const
/*!
requires
- [begin, end) is an iterator range over input_type objects.
- std::distance(begin,end) > 0
- [
i
begin,
i
end) is an iterator range over input_type objects.
- std::distance(
i
begin,
i
end) > 0
ensures
- Converts the iterator range into a tensor and stores it into #data.
- #data.num_samples() == distance(begin,end)*sample_expansion_factor.
- Normally you would have #data.num_samples() == distance(begin,end) but
- #data.num_samples() == distance(
i
begin,
i
end)*sample_expansion_factor.
- Normally you would have #data.num_samples() == distance(
i
begin,
i
end) but
you can also expand the output by some integer factor so long as the loss
you use can deal with it correctly.
- The data in the ith sample in #data corresponds to
*(begin+i/sample_expansion_factor).
*(
i
begin+i/sample_expansion_factor).
!*/
};
...
...
@@ -100,21 +100,21 @@ namespace dlib
template
<
typename
input_iterator
>
void
to_tensor
(
input_iterator
begin
,
input_iterator
end
,
input_iterator
i
begin
,
input_iterator
i
end
,
resizable_tensor
&
data
)
const
;
/*!
requires
- [begin, end) is an iterator range over input_type objects.
- std::distance(begin,end) > 0
- [
i
begin,
i
end) is an iterator range over input_type objects.
- std::distance(
i
begin,
i
end) > 0
- The input range should contain image objects that all have the same
dimensions.
ensures
- Converts the iterator range into a tensor and stores it into #data. In
particular, if the input images have R rows, C columns, and K channels
(where K is given by pixel_traits::num) then we will have:
- #data.num_samples() == std::distance(begin,end)
- #data.num_samples() == std::distance(
i
begin,
i
end)
- #data.nr() == R
- #data.nc() == C
- #data.k() == K
...
...
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