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 cpath = path.toNativeUtf8().cast<ffi.Char>();
  final rval = await cvRunAsync<Net>(
      (callback) => cffi.Net_ReadNetFromTorch_Async(cpath, isBinary, evaluate, callback), (c, p) {
    return c.complete(Net.fromPointer(p.cast<cvg.Net>()));
  });
  calloc.free(cpath);
  return rval;
}