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
e2b5d112
Commit
e2b5d112
authored
Jul 09, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnn: allow to use external protobuf
"custom layers" feature will not work properly in these builds.
parent
e41f19d2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
CMakeLists.txt
modules/dnn/CMakeLists.txt
+4
-0
caffe_io.cpp
modules/dnn/src/caffe/caffe_io.cpp
+4
-0
test_layers.cpp
modules/dnn/test/test_layers.cpp
+4
-0
No files found.
modules/dnn/CMakeLists.txt
View file @
e2b5d112
...
...
@@ -48,6 +48,10 @@ if(ANDROID)
add_definitions
(
-DDISABLE_POSIX_MEMALIGN -DTH_DISABLE_HEAP_TRACKING
)
endif
()
if
(
NOT BUILD_PROTOBUF
)
add_definitions
(
-DOPENCV_DNN_EXTERNAL_PROTOBUF=1
)
endif
()
add_definitions
(
-DHAVE_PROTOBUF=1
)
#suppress warnings in autogenerated caffe.pb.* files
...
...
modules/dnn/src/caffe/caffe_io.cpp
View file @
e2b5d112
...
...
@@ -1120,7 +1120,11 @@ bool ReadProtoFromTextFile(const char* filename, Message* proto) {
std
::
ifstream
fs
(
filename
,
std
::
ifstream
::
in
);
CHECK
(
fs
.
is_open
())
<<
"Can't open
\"
"
<<
filename
<<
"
\"
"
;
IstreamInputStream
input
(
&
fs
);
#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF
return
google
::
protobuf
::
TextFormat
::
Parser
(
true
).
Parse
(
&
input
,
proto
);
#else
return
google
::
protobuf
::
TextFormat
::
Parser
().
Parse
(
&
input
,
proto
);
#endif
}
bool
ReadProtoFromBinaryFile
(
const
char
*
filename
,
Message
*
proto
)
{
...
...
modules/dnn/test/test_layers.cpp
View file @
e2b5d112
...
...
@@ -1149,7 +1149,11 @@ private:
int
outWidth
,
outHeight
,
zoomFactor
;
};
#ifndef OPENCV_DNN_EXTERNAL_PROTOBUF
TEST_P
(
Test_Caffe_layers
,
Interp
)
#else
TEST_P
(
Test_Caffe_layers
,
DISABLED_Interp
)
// requires patched protobuf (available in OpenCV source tree only)
#endif
{
if
(
backend
==
DNN_BACKEND_INFERENCE_ENGINE
&&
target
==
DNN_TARGET_MYRIAD
)
throw
SkipTestException
(
""
);
...
...
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