Added testdata images. Fixed Dict copy constructor.

pull/265/head
Vitaliy Lyudvichenko 10 years ago
parent ff45c2252b
commit 6548839454
  1. 9
      modules/dnn/include/opencv2/dnn/dict.hpp
  2. 6
      modules/dnn/src/dnn.cpp
  3. 6
      modules/dnn/test/test_googlenet.cpp
  4. BIN
      modules/dnn/testdata/dnn/googlenet_0.jpg
  5. BIN
      modules/dnn/testdata/dnn/googlenet_1.jpg
  6. BIN
      modules/dnn/testdata/dnn/googlenet_prob.npy
  7. 4
      modules/dnn/testdata/dnn/sign_50.ppm

@ -256,7 +256,14 @@ inline DictValue & DictValue::operator=(const DictValue &r)
inline DictValue::DictValue(const DictValue &r) inline DictValue::DictValue(const DictValue &r)
{ {
*this = r; type = r.type;
if (r.type == Param::INT)
pi = new AutoBuffer<int64, 1>(*r.pi);
else if (r.type == Param::STRING)
ps = new AutoBuffer<String, 1>(*r.ps);
else if (r.type == Param::REAL)
pd = new AutoBuffer<double, 1>(*r.pd);
} }
inline bool DictValue::isString() const inline bool DictValue::isString() const

@ -525,5 +525,11 @@ Ptr<Layer> LayerRegister::createLayerInstance(const String &_type, LayerParams&
} }
} }
int Net::getLayerId(LayerId)
{
CV_Error(Error::StsNotImplemented, "");
return -1;
}
} }
} }

@ -25,8 +25,8 @@ TEST(Reproducibility_GoogLeNet, Accuracy)
} }
std::vector<Mat> inpMats; std::vector<Mat> inpMats;
inpMats.push_back( imread(getTestFile("googlenet_0.png")) ); inpMats.push_back( imread(getTestFile("googlenet_0.jpg")) );
inpMats.push_back( imread(getTestFile("googlenet_1.png")) ); inpMats.push_back( imread(getTestFile("googlenet_1.jpg")) );
ASSERT_TRUE(!inpMats[0].empty() && !inpMats[1].empty()); ASSERT_TRUE(!inpMats[0].empty() && !inpMats[1].empty());
Blob inp(inpMats); Blob inp(inpMats);
@ -34,7 +34,7 @@ TEST(Reproducibility_GoogLeNet, Accuracy)
net.forward(); net.forward();
Blob out = net.getBlob("prob"); Blob out = net.getBlob("prob");
Blob ref = blobFromNPY(getTestFile("googlenet.npy")); Blob ref = blobFromNPY(getTestFile("googlenet_prob.npy"));
normAssert(out, ref); normAssert(out, ref);
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save