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
68888c05
Commit
68888c05
authored
Sep 25, 2015
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed more variables
parent
f9ba2e38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
28 deletions
+28
-28
input.h
dlib/dnn/input.h
+16
-16
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
(
ibegin
,
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
=
ibegin
;
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
(
ibegin
,
i
end
),
nr
,
nc
,
pixel_traits
<
T
>::
num
);
auto
ptr
=
data
.
host
();
for
(
auto
i
=
begin
;
i
!=
end
;
++
i
)
for
(
auto
i
=
ibegin
;
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
(
ibegin
,
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
=
ibegin
;
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
(
ibegin
,
i
end
),
nr
,
nc
,
pixel_traits
<
T
>::
num
);
auto
ptr
=
data
.
host
();
for
(
auto
i
=
begin
;
i
!=
end
;
++
i
)
for
(
auto
i
=
ibegin
;
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
- [
ibegin, i
end) is an iterator range over input_type objects.
- std::distance(
ibegin,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(
ibegin,i
end)*sample_expansion_factor.
- Normally you would have #data.num_samples() == distance(
ibegin,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
- [
ibegin, i
end) is an iterator range over input_type objects.
- std::distance(
ibegin,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(
ibegin,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