diff --git a/modules/dnn/include/opencv2/dnn/dnn.hpp b/modules/dnn/include/opencv2/dnn/dnn.hpp index 11d99ca5f..fd23164b6 100644 --- a/modules/dnn/include/opencv2/dnn/dnn.hpp +++ b/modules/dnn/include/opencv2/dnn/dnn.hpp @@ -41,7 +41,6 @@ namespace dnn //containers for String and int typedef DictValue LayerId; - typedef DictValue BlobId; class CV_EXPORTS Net { diff --git a/modules/dnn/scripts/test_models.json b/modules/dnn/scripts/test_models.json index f2ed34595..47b131531 100644 --- a/modules/dnn/scripts/test_models.json +++ b/modules/dnn/scripts/test_models.json @@ -2,6 +2,6 @@ "googlenet": { "file": "dnn/bvlc_googlenet.caffemodel", "url": "http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel", - "sha1": "d41971236422c20b1d7d92769670f3642ef4611a" + "sha1": "405fc5acd08a3bb12de8ee5e23a96bec22f08204" } } \ No newline at end of file diff --git a/modules/dnn/src/caffe_importer.cpp b/modules/dnn/src/caffe_importer.cpp index 31dd41e2e..5542b7e03 100644 --- a/modules/dnn/src/caffe_importer.cpp +++ b/modules/dnn/src/caffe_importer.cpp @@ -47,34 +47,34 @@ namespace #define SET_UP_FILED(getter, arrayConstr, gtype) \ if (isRepeated) { \ const RepeatedField &v = refl->GetRepeatedField(msg, field); \ - params.set(name, ##arrayConstr(v.begin(), (int)v.size())); \ + params.set(name, DictValue::arrayConstr(v.begin(), (int)v.size())); \ } \ else { \ - params.set(name, refl->##getter(msg, field)); \ + params.set(name, refl->getter(msg, field)); \ } switch (type) { case FieldDescriptor::CPPTYPE_INT32: - SET_UP_FILED(GetInt32, DictValue::arrayInt, ::google::protobuf::int32); + SET_UP_FILED(GetInt32, arrayInt, ::google::protobuf::int32); break; case FieldDescriptor::CPPTYPE_UINT32: - SET_UP_FILED(GetUInt32, DictValue::arrayInt, ::google::protobuf::uint32); + SET_UP_FILED(GetUInt32, arrayInt, ::google::protobuf::uint32); break; case FieldDescriptor::CPPTYPE_INT64: - SET_UP_FILED(GetInt32, DictValue::arrayInt, ::google::protobuf::int64); + SET_UP_FILED(GetInt32, arrayInt, ::google::protobuf::int64); break; case FieldDescriptor::CPPTYPE_UINT64: - SET_UP_FILED(GetUInt32, DictValue::arrayInt, ::google::protobuf::uint64); + SET_UP_FILED(GetUInt32, arrayInt, ::google::protobuf::uint64); break; case FieldDescriptor::CPPTYPE_BOOL: - SET_UP_FILED(GetBool, DictValue::arrayInt, bool); + SET_UP_FILED(GetBool, arrayInt, bool); break; case FieldDescriptor::CPPTYPE_DOUBLE: - SET_UP_FILED(GetDouble, DictValue::arrayReal, double); + SET_UP_FILED(GetDouble, arrayReal, double); break; case FieldDescriptor::CPPTYPE_FLOAT: - SET_UP_FILED(GetFloat, DictValue::arrayReal, float); + SET_UP_FILED(GetFloat, arrayReal, float); break; case FieldDescriptor::CPPTYPE_STRING: if (isRepeated) { @@ -203,13 +203,10 @@ namespace struct BlobNote { BlobNote(const std::string &_name, int _layerId, int _outNum) : - name(_name), layerId(_layerId), outNum(_outNum) {} + name(_name.c_str()), layerId(_layerId), outNum(_outNum) {} - const std::string &name; + const char *name; int layerId, outNum; - - private: - void operator=(const BlobNote&) {} //supress warning }; void populateNet(Net dstNet) @@ -284,7 +281,7 @@ namespace if (idx < 0) { - CV_Error(Error::StsError, "Can't found output blob \"" + name + "\""); + CV_Error(Error::StsObjectNotFound, "Can't found output blob \"" + name + "\""); return; } diff --git a/modules/dnn/src/dnn.cpp b/modules/dnn/src/dnn.cpp index eff88e49d..670cbf687 100644 --- a/modules/dnn/src/dnn.cpp +++ b/modules/dnn/src/dnn.cpp @@ -467,12 +467,12 @@ Importer::~Importer() } -int Layer::inputNameToIndex(String inputName) +int Layer::inputNameToIndex(String) { return -1; } -int Layer::outputNameToIndex(String outputName) +int Layer::outputNameToIndex(String) { return -1; }