Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
a7a47dca
Commit
a7a47dca
authored
Jul 21, 2016
by
Anna Petrovicheva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed concat layer
parent
e4650efa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
concat_layer.cpp
modules/dnn/src/layers/concat_layer.cpp
+8
-9
No files found.
modules/dnn/src/layers/concat_layer.cpp
View file @
a7a47dca
...
...
@@ -62,6 +62,7 @@ namespace dnn
CV_Assert
(
axis
<
refShape
.
dims
());
int
axisSum
=
0
;
for
(
size_t
i
=
0
;
i
<
inputs
.
size
();
i
++
)
{
BlobShape
curShape
=
inputs
[
i
]
->
shape
();
...
...
@@ -83,18 +84,16 @@ namespace dnn
void
ConcatLayer
::
forward
(
std
::
vector
<
Blob
*>
&
inputs
,
std
::
vector
<
Blob
>
&
outputs
)
{
const
Mat
&
outMat
=
outputs
[
0
].
matRef
();
std
::
vector
<
Range
>
ranges
(
outputs
[
0
].
dims
(),
Range
::
all
());
int
sizeStart
=
0
;
// In case when Blob shape used in allocation and inner matrix shape do not match, this layer did not work in previous implementation. This implementation is just a fix and needs to be rewritten.
size_t
usedSize
=
0
;
for
(
size_t
i
=
0
;
i
<
inputs
.
size
();
i
++
)
{
int
sizeEnd
=
sizeStart
+
inputs
[
i
]
->
size
(
axis
);
ranges
[
axis
]
=
Range
(
sizeStart
,
sizeEnd
);
Mat
outSubMat
=
outMat
(
&
ranges
[
0
]);
inputs
[
i
]
->
matRef
().
copyTo
(
outSubMat
);
Mat
inMat
(
1
,
inputs
[
i
]
->
total
(),
CV_32F
,
inputs
[
i
]
->
ptrf
());
Mat
outMat
(
1
,
inputs
[
i
]
->
total
(),
CV_32F
,
outputs
[
0
].
ptrf
()
+
usedSize
);
sizeStart
=
sizeEnd
;
inMat
.
copyTo
(
outMat
);
usedSize
+=
inputs
[
i
]
->
total
();
}
}
}
...
...
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