Commit d8507fef authored by Vitaliy Lyudvichenko's avatar Vitaliy Lyudvichenko

Swapping of stride and pad params inside layers initializers

parent 0af7f9ea
...@@ -216,16 +216,14 @@ namespace dnn ...@@ -216,16 +216,14 @@ namespace dnn
{ {
public: public:
static Ptr<BaseConvolutionLayer> create(); static Ptr<BaseConvolutionLayer> create(Size kernel = Size(3, 3), Size stride = Size(1, 1), Size pad = Size(0, 0));
static Ptr<BaseConvolutionLayer> create(Size kernel = Size(3, 3), Size pad = Size(0, 0), Size stride = Size(1, 1));
}; };
class CV_EXPORTS_W DeconvolutionLayer : public BaseConvolutionLayer class CV_EXPORTS_W DeconvolutionLayer : public BaseConvolutionLayer
{ {
public: public:
static Ptr<BaseConvolutionLayer> create(); static Ptr<BaseConvolutionLayer> create(Size kernel = Size(3, 3), Size stride = Size(1, 1), Size pad = Size(0, 0));
static Ptr<BaseConvolutionLayer> create(Size kernel = Size(3, 3), Size pad = Size(0, 0), Size stride = Size(1, 1));
}; };
class CV_EXPORTS_W LRNLayer : public Layer class CV_EXPORTS_W LRNLayer : public Layer
...@@ -259,7 +257,7 @@ namespace dnn ...@@ -259,7 +257,7 @@ namespace dnn
int type; int type;
Size kernel, stride, pad; 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));
}; };
//! @} //! @}
......
...@@ -315,12 +315,7 @@ void DeConvolutionLayerImpl::col2im(const UMat &colMat, UMat &dstImg) ...@@ -315,12 +315,7 @@ void DeConvolutionLayerImpl::col2im(const UMat &colMat, UMat &dstImg)
//Initializers //Initializers
Ptr<BaseConvolutionLayer> ConvolutionLayer::create() Ptr<BaseConvolutionLayer> ConvolutionLayer::create(Size kernel, Size stride, Size pad)
{
return Ptr<BaseConvolutionLayer>(new ConvolutionLayerImpl());
}
Ptr<BaseConvolutionLayer> ConvolutionLayer::create(Size kernel, Size pad, Size stride)
{ {
ConvolutionLayerImpl *l = new ConvolutionLayerImpl(); ConvolutionLayerImpl *l = new ConvolutionLayerImpl();
l->kernel = kernel; l->kernel = kernel;
...@@ -329,12 +324,7 @@ Ptr<BaseConvolutionLayer> ConvolutionLayer::create(Size kernel, Size pad, Size s ...@@ -329,12 +324,7 @@ Ptr<BaseConvolutionLayer> ConvolutionLayer::create(Size kernel, Size pad, Size s
return Ptr<BaseConvolutionLayer>(l); return Ptr<BaseConvolutionLayer>(l);
} }
Ptr<BaseConvolutionLayer> DeconvolutionLayer::create() Ptr<BaseConvolutionLayer> DeconvolutionLayer::create(Size kernel, Size stride, Size pad)
{
return Ptr<BaseConvolutionLayer>(new DeConvolutionLayerImpl());
}
Ptr<BaseConvolutionLayer> DeconvolutionLayer::create(Size kernel, Size pad, Size stride)
{ {
DeConvolutionLayerImpl *l = new DeConvolutionLayerImpl(); DeConvolutionLayerImpl *l = new DeConvolutionLayerImpl();
l->kernel = kernel; l->kernel = kernel;
......
...@@ -60,7 +60,7 @@ PoolingLayerImpl::PoolingLayerImpl() ...@@ -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_; type = type_;
kernel = kernel_; kernel = kernel_;
...@@ -261,9 +261,9 @@ void PoolingLayerImpl::computeOutputShape(Size inpSz) ...@@ -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) Ptr<Layer> createPoolingLayerFromCaffe(LayerParams &params)
...@@ -290,7 +290,7 @@ Ptr<Layer> createPoolingLayerFromCaffe(LayerParams &params) ...@@ -290,7 +290,7 @@ Ptr<Layer> createPoolingLayerFromCaffe(LayerParams &params)
getCaffeConvParams(params, kernel, pad, stride); getCaffeConvParams(params, kernel, pad, stride);
return Ptr<Layer>(new PoolingLayerImpl(type, kernel, pad, stride)); return Ptr<Layer>(new PoolingLayerImpl(type, kernel, stride, pad));
} }
} }
......
...@@ -68,7 +68,7 @@ namespace dnn ...@@ -68,7 +68,7 @@ namespace dnn
public: public:
PoolingLayerImpl(); 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 allocate(const std::vector<Blob*> &inputs, std::vector<Blob> &outputs);
void forward(std::vector<Blob*> &inputs, std::vector<Blob> &outputs); void forward(std::vector<Blob*> &inputs, std::vector<Blob> &outputs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment