fromTorchAsync static method

Future<Net> fromTorchAsync(
  1. String path, {
  2. bool isBinary = true,
  3. bool evaluate = true,
})

Implementation

static Future<Net> fromTorchAsync(String path, {bool isBinary = true, bool evaluate = true}) async {
  final p = calloc<cvg.Net>();
  final cpath = path.toNativeUtf8().cast<ffi.Char>();
  return cvRunAsync0((callback) => cdnn.cv_dnn_Net_readNetFromTorch(cpath, isBinary, evaluate, p, callback),
      (c) {
    calloc.free(cpath);
    final net = Net.fromPointer(p);
    return c.complete(net);
  });
}