1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-22 16:08:41 +08:00

Replace createCaffeImporter to readNetFromCaffe (#1310)

This commit is contained in:
Dmitry Kurtaev
2017-09-18 12:38:28 +03:00
committed by Vadim Pisarevsky
parent 9fd5e99f88
commit c8f2d2bba5

View File

@@ -110,23 +110,7 @@ bool TrackerGOTURNImpl::initImpl(const Mat& image, const Rect2d& boundingBox)
//Load GOTURN architecture from *.prototxt and pretrained weights from *.caffemodel
String modelTxt = "goturn.prototxt";
String modelBin = "goturn.caffemodel";
Ptr<dnn::Importer> importer;
try //Import GOTURN model
{
importer = dnn::createCaffeImporter(modelTxt, modelBin);
}
catch (const cv::Exception &err) //Importer can throw errors, we will catch them
{
std::cerr << err.msg << std::endl;
}
if (!importer)
{
cvError(CV_StsError, "cv::gtr::InitImpl", "GOTURN network loading error...", "gtrTracker.cpp", 117);
}
importer->populateNet(net);
importer.release(); //We don't need importer anymore
net = dnn::readNetFromCaffe(modelTxt, modelBin);
return true;
}