Fixed gcc build errors.

pull/265/head
Vitaliy Lyudvichenko 10 years ago
parent 9b1e28ec17
commit ff45c2252b
  1. 1
      modules/dnn/include/opencv2/dnn/dnn.hpp
  2. 2
      modules/dnn/scripts/test_models.json
  3. 27
      modules/dnn/src/caffe_importer.cpp
  4. 4
      modules/dnn/src/dnn.cpp

@ -41,7 +41,6 @@ namespace dnn
//containers for String and int
typedef DictValue LayerId;
typedef DictValue BlobId;
class CV_EXPORTS Net
{

@ -2,6 +2,6 @@
"googlenet": {
"file": "dnn/bvlc_googlenet.caffemodel",
"url": "http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel",
"sha1": "d41971236422c20b1d7d92769670f3642ef4611a"
"sha1": "405fc5acd08a3bb12de8ee5e23a96bec22f08204"
}
}

@ -47,34 +47,34 @@ namespace
#define SET_UP_FILED(getter, arrayConstr, gtype) \
if (isRepeated) { \
const RepeatedField<gtype> &v = refl->GetRepeatedField<gtype>(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;
}

@ -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;
}

Loading…
Cancel
Save