Net.fromTorch constructor

Net.fromTorch(
  1. String path, {
  2. bool isBinary = true,
  3. bool evaluate = true,
})

Reads a network model stored in Torch7 framework's format. https://docs.opencv.org/4.x/d6/d0f/group__dnn.html#ga73785dd1e95cd3070ef36f3109b053fe

Implementation

factory Net.fromTorch(String path, {bool isBinary = true, bool evaluate = true}) {
  final p = calloc<cvg.Net>();
  final cpath = path.toNativeUtf8().cast<ffi.Char>();
  cvRun(() => cdnn.cv_dnn_Net_readNetFromTorch(cpath, isBinary, evaluate, p, ffi.nullptr));
  calloc.free(cpath);
  final net = Net._(p);
  return net;
}