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
5384d2f0
Commit
5384d2f0
authored
Oct 27, 2017
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9880 from dkurt:caffe_ceil_mode
parents
60cbc46d
b903ff89
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
0 deletions
+54
-0
caffe.pb.cc
modules/dnn/misc/caffe/caffe.pb.cc
+0
-0
caffe.pb.h
modules/dnn/misc/caffe/caffe.pb.h
+34
-0
caffe.proto
modules/dnn/src/caffe/caffe.proto
+3
-0
test_caffe_importer.cpp
modules/dnn/test/test_caffe_importer.cpp
+17
-0
No files found.
modules/dnn/misc/caffe/caffe.pb.cc
View file @
5384d2f0
This diff is collapsed.
Click to expand it.
modules/dnn/misc/caffe/caffe.pb.h
View file @
5384d2f0
...
...
@@ -9035,6 +9035,13 @@ class PoolingParameter : public ::google::protobuf::Message /* @@protoc_insertio
bool
global_pooling
()
const
;
void
set_global_pooling
(
bool
value
);
// optional bool ceil_mode = 13 [default = true];
bool
has_ceil_mode
()
const
;
void
clear_ceil_mode
();
static
const
int
kCeilModeFieldNumber
=
13
;
bool
ceil_mode
()
const
;
void
set_ceil_mode
(
bool
value
);
// @@protoc_insertion_point(class_scope:caffe.PoolingParameter)
private
:
inline
void
set_has_pool
();
...
...
@@ -9061,6 +9068,8 @@ class PoolingParameter : public ::google::protobuf::Message /* @@protoc_insertio
inline
void
clear_has_engine
();
inline
void
set_has_global_pooling
();
inline
void
clear_has_global_pooling
();
inline
void
set_has_ceil_mode
();
inline
void
clear_has_ceil_mode
();
::
google
::
protobuf
::
internal
::
InternalMetadataWithArena
_internal_metadata_
;
::
google
::
protobuf
::
internal
::
HasBits
<
1
>
_has_bits_
;
...
...
@@ -9077,6 +9086,7 @@ class PoolingParameter : public ::google::protobuf::Message /* @@protoc_insertio
int
engine_
;
bool
global_pooling_
;
::
google
::
protobuf
::
uint32
stride_
;
bool
ceil_mode_
;
friend
void
protobuf_InitDefaults_caffe_2eproto_impl
();
friend
void
protobuf_AddDesc_caffe_2eproto_impl
();
friend
void
protobuf_AssignDesc_caffe_2eproto
();
...
...
@@ -23544,6 +23554,30 @@ inline void PoolingParameter::set_global_pooling(bool value) {
// @@protoc_insertion_point(field_set:caffe.PoolingParameter.global_pooling)
}
// optional bool ceil_mode = 13 [default = true];
inline
bool
PoolingParameter
::
has_ceil_mode
()
const
{
return
(
_has_bits_
[
0
]
&
0x00001000u
)
!=
0
;
}
inline
void
PoolingParameter
::
set_has_ceil_mode
()
{
_has_bits_
[
0
]
|=
0x00001000u
;
}
inline
void
PoolingParameter
::
clear_has_ceil_mode
()
{
_has_bits_
[
0
]
&=
~
0x00001000u
;
}
inline
void
PoolingParameter
::
clear_ceil_mode
()
{
ceil_mode_
=
true
;
clear_has_ceil_mode
();
}
inline
bool
PoolingParameter
::
ceil_mode
()
const
{
// @@protoc_insertion_point(field_get:caffe.PoolingParameter.ceil_mode)
return
ceil_mode_
;
}
inline
void
PoolingParameter
::
set_ceil_mode
(
bool
value
)
{
set_has_ceil_mode
();
ceil_mode_
=
value
;
// @@protoc_insertion_point(field_set:caffe.PoolingParameter.ceil_mode)
}
inline
const
PoolingParameter
*
PoolingParameter
::
internal_default_instance
()
{
return
&
PoolingParameter_default_instance_
.
get
();
}
modules/dnn/src/caffe/caffe.proto
View file @
5384d2f0
...
...
@@ -1093,6 +1093,9 @@ message PoolingParameter {
// If global_pooling then it will pool over the size of the bottom by doing
// kernel_h = bottom->height and kernel_w = bottom->width
optional
bool
global_pooling
=
12
[
default
=
false
];
// Specify floor/ceil mode
// source: https://github.com/BVLC/caffe/pull/3057
optional
bool
ceil_mode
=
13
[
default
=
true
];
}
message
PowerParameter
{
...
...
modules/dnn/test/test_caffe_importer.cpp
View file @
5384d2f0
...
...
@@ -234,4 +234,21 @@ TEST(Reproducibility_Colorization, Accuracy)
normAssert
(
out
,
ref
,
""
,
l1
,
lInf
);
}
TEST
(
Reproducibility_DenseNet_121
,
Accuracy
)
{
const
string
proto
=
findDataFile
(
"dnn/DenseNet_121.prototxt"
,
false
);
const
string
model
=
findDataFile
(
"dnn/DenseNet_121.caffemodel"
,
false
);
Mat
inp
=
imread
(
_tf
(
"dog416.png"
));
inp
=
blobFromImage
(
inp
,
1.0
/
255
,
Size
(
224
,
224
));
Mat
ref
=
blobFromNPY
(
_tf
(
"densenet_121_output.npy"
));
Net
net
=
readNetFromCaffe
(
proto
,
model
);
net
.
setInput
(
inp
);
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