1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

dnn: allow to use external protobuf

"custom layers" feature will not work properly in these builds.
This commit is contained in:
Alexander Alekhin
2018-07-09 17:19:35 +03:00
parent e41f19d2f3
commit e2b5d11290
3 changed files with 12 additions and 0 deletions
+4
View File
@@ -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) {