Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
17dcf0e8
Commit
17dcf0e8
authored
Dec 04, 2017
by
Dmitry Kurtaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ROIPooling layer
parent
fc9e0314
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
35 additions
and
1 deletion
+35
-1
all_layers.hpp
modules/dnn/include/opencv2/dnn/all_layers.hpp
+5
-1
opencv-caffe.pb.cc
modules/dnn/misc/caffe/opencv-caffe.pb.cc
+0
-0
opencv-caffe.pb.h
modules/dnn/misc/caffe/opencv-caffe.pb.h
+0
-0
opencv-caffe.proto
modules/dnn/src/caffe/opencv-caffe.proto
+13
-0
init.cpp
modules/dnn/src/init.cpp
+1
-0
pooling_layer.cpp
modules/dnn/src/layers/pooling_layer.cpp
+0
-0
test_layers.cpp
modules/dnn/test/test_layers.cpp
+16
-0
No files found.
modules/dnn/include/opencv2/dnn/all_layers.hpp
View file @
17dcf0e8
...
...
@@ -242,7 +242,8 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
{
MAX
,
AVE
,
STOCHASTIC
STOCHASTIC
,
ROI
};
int
type
;
...
...
@@ -251,6 +252,9 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
bool
computeMaxIdx
;
String
padMode
;
bool
ceilMode
;
// ROIPooling parameters.
Size
pooledSize
;
float
spatialScale
;
static
Ptr
<
PoolingLayer
>
create
(
const
LayerParams
&
params
);
};
...
...
modules/dnn/misc/caffe/opencv-caffe.pb.cc
View file @
17dcf0e8
This diff is collapsed.
Click to expand it.
modules/dnn/misc/caffe/opencv-caffe.pb.h
View file @
17dcf0e8
This diff is collapsed.
Click to expand it.
modules/dnn/src/caffe/opencv-caffe.proto
View file @
17dcf0e8
...
...
@@ -552,6 +552,7 @@ message LayerParameter {
optional
ReductionParameter
reduction_param
=
136
;
optional
ReLUParameter
relu_param
=
123
;
optional
ReshapeParameter
reshape_param
=
133
;
optional
ROIPoolingParameter
roi_pooling_param
=
8266711
;
// https://github.com/rbgirshick/caffe-fast-rcnn/tree/fast-rcnn
optional
ScaleParameter
scale_param
=
142
;
optional
SigmoidParameter
sigmoid_param
=
124
;
optional
SoftmaxParameter
softmax_param
=
125
;
...
...
@@ -1605,3 +1606,15 @@ message NormalizedBBox {
optional
float
score
=
7
;
optional
float
size
=
8
;
}
// origin: https://github.com/rbgirshick/caffe-fast-rcnn/tree/fast-rcnn
// Message that stores parameters used by ROIPoolingLayer
message
ROIPoolingParameter
{
// Pad, kernel size, and stride are all given as a single value for equal
// dimensions in height and width or as Y, X pairs.
optional
uint32
pooled_h
=
1
[
default
=
0
];
// The pooled output height
optional
uint32
pooled_w
=
2
[
default
=
0
];
// The pooled output width
// Multiplicative spatial scale factor to translate ROI coords from their
// input scale to the scale used when pooling
optional
float
spatial_scale
=
3
[
default
=
1
];
}
modules/dnn/src/init.cpp
View file @
17dcf0e8
...
...
@@ -88,6 +88,7 @@ void initializeLayerFactory()
CV_DNN_REGISTER_LAYER_CLASS
(
Convolution
,
ConvolutionLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
Deconvolution
,
DeconvolutionLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
Pooling
,
PoolingLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
ROIPooling
,
PoolingLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
LRN
,
LRNLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
InnerProduct
,
InnerProductLayer
);
CV_DNN_REGISTER_LAYER_CLASS
(
Softmax
,
SoftmaxLayer
);
...
...
modules/dnn/src/layers/pooling_layer.cpp
View file @
17dcf0e8
This diff is collapsed.
Click to expand it.
modules/dnn/test/test_layers.cpp
View file @
17dcf0e8
...
...
@@ -560,4 +560,20 @@ TEST(Layer_Test_Reorg, Accuracy)
testLayerUsingDarknetModels
(
"reorg"
,
false
,
false
);
}
TEST
(
Layer_Test_ROIPooling
,
Accuracy
)
{
Net
net
=
readNetFromCaffe
(
_tf
(
"net_roi_pooling.prototxt"
));
Mat
inp
=
blobFromNPY
(
_tf
(
"net_roi_pooling.input.npy"
));
Mat
rois
=
blobFromNPY
(
_tf
(
"net_roi_pooling.rois.npy"
));
Mat
ref
=
blobFromNPY
(
_tf
(
"net_roi_pooling.npy"
));
net
.
setInput
(
inp
,
"input"
);
net
.
setInput
(
rois
,
"rois"
);
Mat
out
=
net
.
forward
();
normAssert
(
out
,
ref
);
}
}
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