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 = ""}) {
return using<Net>((arena) {
final cPath = path.toNativeUtf8(allocator: arena).cast<ffi.Char>();
final cConfig = config.toNativeUtf8(allocator: arena).cast<ffi.Char>();
final cFramework = framework.toNativeUtf8(allocator: arena).cast<ffi.Char>();
final p = calloc<cvg.Net>();
cvRun(() => cffi.Net_ReadNet(cPath, cConfig, cFramework, p));
final net = Net._(p);
return net;
});
}