Commit 9ace6338 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #1182 from sovrasov:dnn_build_wo_torch

parents 503b00f1 50a52424
......@@ -374,15 +374,7 @@ Ptr<Importer> cv::dnn::createCaffeImporter(const String&, const String&)
Net cv::dnn::readNetFromCaffe(const String &prototxt, const String &caffeModel /*= String()*/)
{
Ptr<Importer> caffeImporter;
try
{
caffeImporter = createCaffeImporter(prototxt, caffeModel);
}
catch(...)
{
}
Ptr<Importer> caffeImporter = createCaffeImporter(prototxt, caffeModel);
Net net;
if (caffeImporter)
caffeImporter->populateNet(net);
......
......@@ -736,23 +736,6 @@ void TFImporter::populateNet(Net dstNet)
} // namespace
Net cv::dnn::readNetFromTensorflow(const String &model)
{
Ptr<Importer> importer;
try
{
importer = createTensorflowImporter(model);
}
catch(...)
{
}
Net net;
if (importer)
importer->populateNet(net);
return net;
}
Ptr<Importer> cv::dnn::createTensorflowImporter(const String &model)
{
return Ptr<Importer>(new TFImporter(model.c_str()));
......@@ -767,3 +750,12 @@ Ptr<Importer> cv::dnn::createTensorflowImporter(const String&)
}
#endif //HAVE_PROTOBUF
Net cv::dnn::readNetFromTensorflow(const String &model)
{
Ptr<Importer> importer = createTensorflowImporter(model);
Net net;
if (importer)
importer->populateNet(net);
return net;
}
......@@ -971,23 +971,6 @@ Mat readTorchBlob(const String &filename, bool isBinary)
return importer->tensors.begin()->second;
}
Net readNetFromTorch(const String &model, bool isBinary)
{
Ptr<Importer> importer;
try
{
importer = createTorchImporter(model, isBinary);
}
catch(...)
{
}
Net net;
if (importer)
importer->populateNet(net);
return net;
}
#else
Ptr<Importer> createTorchImporter(const String&, bool)
......@@ -1003,5 +986,15 @@ Mat readTorchBlob(const String&, bool)
}
#endif //defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
Net readNetFromTorch(const String &model, bool isBinary)
{
Ptr<Importer> importer = createTorchImporter(model, isBinary);
Net net;
if (importer)
importer->populateNet(net);
return net;
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment