Skip to content

Commit c8f2d2b

Browse files
dkurtvpisarev
authored andcommitted
Replace createCaffeImporter to readNetFromCaffe (#1310)
1 parent 9fd5e99 commit c8f2d2b

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

modules/tracking/src/gtrTracker.cpp

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,7 @@ bool TrackerGOTURNImpl::initImpl(const Mat& image, const Rect2d& boundingBox)
110110
//Load GOTURN architecture from *.prototxt and pretrained weights from *.caffemodel
111111
String modelTxt = "goturn.prototxt";
112112
String modelBin = "goturn.caffemodel";
113-
Ptr<dnn::Importer> importer;
114-
try //Import GOTURN model
115-
{
116-
importer = dnn::createCaffeImporter(modelTxt, modelBin);
117-
}
118-
catch (const cv::Exception &err) //Importer can throw errors, we will catch them
119-
{
120-
std::cerr << err.msg << std::endl;
121-
}
122-
if (!importer)
123-
{
124-
cvError(CV_StsError, "cv::gtr::InitImpl", "GOTURN network loading error...", "gtrTracker.cpp", 117);
125-
}
126-
127-
importer->populateNet(net);
128-
importer.release(); //We don't need importer anymore
129-
113+
net = dnn::readNetFromCaffe(modelTxt, modelBin);
130114
return true;
131115
}
132116

0 commit comments

Comments
 (0)