Net.fromFile constructor
Read deep learning network represented in one of the supported formats.
https://docs.opencv.org/4.x/d6/d0f/group__dnn.html#ga4823489a689bf4edfae7447eb807b067
Implementation
factory Net.fromFile(String path, {String config = "", String framework = ""}) {
final cPath = path.toNativeUtf8().cast<ffi.Char>();
final cConfig = config.toNativeUtf8().cast<ffi.Char>();
final cFramework = framework.toNativeUtf8().cast<ffi.Char>();
final p = calloc<cvg.Net>();
cvRun(() => cdnn.cv_dnn_Net_readNet(cPath, cConfig, cFramework, p, ffi.nullptr));
calloc.free(cPath);
calloc.free(cConfig);
calloc.free(cFramework);
final net = Net._(p);
return net;
}