File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -1198,6 +1198,16 @@ Mat readTorchBlob(const String &filename, bool isBinary)
1198
1198
return importer->tensors .begin ()->second ;
1199
1199
}
1200
1200
1201
+ Net readNetFromTorch (const String &model, bool isBinary)
1202
+ {
1203
+ CV_TRACE_FUNCTION ();
1204
+
1205
+ TorchImporter importer (model, isBinary);
1206
+ Net net;
1207
+ importer.populateNet (net);
1208
+ return net;
1209
+ }
1210
+
1201
1211
#else
1202
1212
1203
1213
Ptr<Importer> createTorchImporter (const String&, bool )
@@ -1212,17 +1222,13 @@ Mat readTorchBlob(const String&, bool)
1212
1222
return Mat ();
1213
1223
}
1214
1224
1215
- #endif // defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
1216
-
1217
1225
Net readNetFromTorch (const String &model, bool isBinary)
1218
1226
{
1219
- CV_TRACE_FUNCTION ();
1220
-
1221
- TorchImporter importer (model, isBinary);
1222
- Net net;
1223
- importer.populateNet (net);
1224
- return net;
1227
+ CV_Error (Error::StsNotImplemented, " Torch importer is disabled in current build" );
1228
+ return Net ();
1225
1229
}
1226
1230
1231
+ #endif // defined(ENABLE_TORCH_IMPORTER) && ENABLE_TORCH_IMPORTER
1232
+
1227
1233
CV__DNN_EXPERIMENTAL_NS_END
1228
1234
}} // namespace
You can’t perform that action at this time.
0 commit comments