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
d8507fef
Commit
d8507fef
authored
Jul 26, 2016
by
Vitaliy Lyudvichenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Swapping of stride and pad params inside layers initializers
parent
0af7f9ea
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
22 deletions
+10
-22
all_layers.hpp
modules/dnn/include/opencv2/dnn/all_layers.hpp
+3
-5
convolution_layer.cpp
modules/dnn/src/layers/convolution_layer.cpp
+2
-12
pooling_layer.cpp
modules/dnn/src/layers/pooling_layer.cpp
+4
-4
pooling_layer.hpp
modules/dnn/src/layers/pooling_layer.hpp
+1
-1
No files found.
modules/dnn/include/opencv2/dnn/all_layers.hpp
View file @
d8507fef
...
...
@@ -216,16 +216,14 @@ namespace dnn
{
public
:
static
Ptr
<
BaseConvolutionLayer
>
create
();
static
Ptr
<
BaseConvolutionLayer
>
create
(
Size
kernel
=
Size
(
3
,
3
),
Size
pad
=
Size
(
0
,
0
),
Size
stride
=
Size
(
1
,
1
));
static
Ptr
<
BaseConvolutionLayer
>
create
(
Size
kernel
=
Size
(
3
,
3
),
Size
stride
=
Size
(
1
,
1
),
Size
pad
=
Size
(
0
,
0
));
};
class
CV_EXPORTS_W
DeconvolutionLayer
:
public
BaseConvolutionLayer
{
public
:
static
Ptr
<
BaseConvolutionLayer
>
create
();
static
Ptr
<
BaseConvolutionLayer
>
create
(
Size
kernel
=
Size
(
3
,
3
),
Size
pad
=
Size
(
0
,
0
),
Size
stride
=
Size
(
1
,
1
));
static
Ptr
<
BaseConvolutionLayer
>
create
(
Size
kernel
=
Size
(
3
,
3
),
Size
stride
=
Size
(
1
,
1
),
Size
pad
=
Size
(
0
,
0
));
};
class
CV_EXPORTS_W
LRNLayer
:
public
Layer
...
...
@@ -259,7 +257,7 @@ namespace dnn
int
type
;
Size
kernel
,
stride
,
pad
;
static
Ptr
<
PoolingLayer
>
create
(
int
type
=
MAX
,
Size
kernel
=
Size
(
2
,
2
),
Size
pad
=
Size
(
0
,
0
),
Size
stride
=
Size
(
1
,
1
));
static
Ptr
<
PoolingLayer
>
create
(
int
type
=
MAX
,
Size
kernel
=
Size
(
2
,
2
),
Size
stride
=
Size
(
1
,
1
),
Size
pad
=
Size
(
0
,
0
));
};
//! @}
...
...
modules/dnn/src/layers/convolution_layer.cpp
View file @
d8507fef
...
...
@@ -315,12 +315,7 @@ void DeConvolutionLayerImpl::col2im(const UMat &colMat, UMat &dstImg)
//Initializers
Ptr
<
BaseConvolutionLayer
>
ConvolutionLayer
::
create
()
{
return
Ptr
<
BaseConvolutionLayer
>
(
new
ConvolutionLayerImpl
());
}
Ptr
<
BaseConvolutionLayer
>
ConvolutionLayer
::
create
(
Size
kernel
,
Size
pad
,
Size
stride
)
Ptr
<
BaseConvolutionLayer
>
ConvolutionLayer
::
create
(
Size
kernel
,
Size
stride
,
Size
pad
)
{
ConvolutionLayerImpl
*
l
=
new
ConvolutionLayerImpl
();
l
->
kernel
=
kernel
;
...
...
@@ -329,12 +324,7 @@ Ptr<BaseConvolutionLayer> ConvolutionLayer::create(Size kernel, Size pad, Size s
return
Ptr
<
BaseConvolutionLayer
>
(
l
);
}
Ptr
<
BaseConvolutionLayer
>
DeconvolutionLayer
::
create
()
{
return
Ptr
<
BaseConvolutionLayer
>
(
new
DeConvolutionLayerImpl
());
}
Ptr
<
BaseConvolutionLayer
>
DeconvolutionLayer
::
create
(
Size
kernel
,
Size
pad
,
Size
stride
)
Ptr
<
BaseConvolutionLayer
>
DeconvolutionLayer
::
create
(
Size
kernel
,
Size
stride
,
Size
pad
)
{
DeConvolutionLayerImpl
*
l
=
new
DeConvolutionLayerImpl
();
l
->
kernel
=
kernel
;
...
...
modules/dnn/src/layers/pooling_layer.cpp
View file @
d8507fef
...
...
@@ -60,7 +60,7 @@ PoolingLayerImpl::PoolingLayerImpl()
}
PoolingLayerImpl
::
PoolingLayerImpl
(
int
type_
,
Size
kernel_
,
Size
pad_
,
Size
stride
_
)
PoolingLayerImpl
::
PoolingLayerImpl
(
int
type_
,
Size
kernel_
,
Size
stride_
,
Size
pad
_
)
{
type
=
type_
;
kernel
=
kernel_
;
...
...
@@ -261,9 +261,9 @@ void PoolingLayerImpl::computeOutputShape(Size inpSz)
}
}
Ptr
<
PoolingLayer
>
PoolingLayer
::
create
(
int
type
,
Size
kernel
,
Size
pad
,
Size
stride
)
Ptr
<
PoolingLayer
>
PoolingLayer
::
create
(
int
type
,
Size
kernel
,
Size
stride
,
Size
pad
)
{
return
Ptr
<
PoolingLayer
>
(
new
PoolingLayerImpl
(
type
,
kernel
,
pad
,
stride
));
return
Ptr
<
PoolingLayer
>
(
new
PoolingLayerImpl
(
type
,
kernel
,
stride
,
pad
));
}
Ptr
<
Layer
>
createPoolingLayerFromCaffe
(
LayerParams
&
params
)
...
...
@@ -290,7 +290,7 @@ Ptr<Layer> createPoolingLayerFromCaffe(LayerParams ¶ms)
getCaffeConvParams
(
params
,
kernel
,
pad
,
stride
);
return
Ptr
<
Layer
>
(
new
PoolingLayerImpl
(
type
,
kernel
,
pad
,
stride
));
return
Ptr
<
Layer
>
(
new
PoolingLayerImpl
(
type
,
kernel
,
stride
,
pad
));
}
}
...
...
modules/dnn/src/layers/pooling_layer.hpp
View file @
d8507fef
...
...
@@ -68,7 +68,7 @@ namespace dnn
public
:
PoolingLayerImpl
();
PoolingLayerImpl
(
int
type
,
Size
kernel
,
Size
pad
,
Size
stride
);
PoolingLayerImpl
(
int
type
,
Size
kernel
,
Size
stride
,
Size
pad
);
void
allocate
(
const
std
::
vector
<
Blob
*>
&
inputs
,
std
::
vector
<
Blob
>
&
outputs
);
void
forward
(
std
::
vector
<
Blob
*>
&
inputs
,
std
::
vector
<
Blob
>
&
outputs
);
...
...
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