fromFileAsync static method

Future<Net> fromFileAsync(
  1. String path, {
  2. String config = "",
  3. String framework = "",
})

Implementation

static Future<Net> fromFileAsync(String path, {String config = "", String framework = ""}) async {
  final cPath = path.toNativeUtf8().cast<ffi.Char>();
  final cConfig = config.toNativeUtf8().cast<ffi.Char>();
  final cFramework = framework.toNativeUtf8().cast<ffi.Char>();
  final rval = await cvRunAsync<Net>(
      (callback) => cdnn.Net_ReadNet_Async(cPath, cConfig, cFramework, callback), (c, p) {
    return c.complete(Net.fromPointer(p.cast<cdnn.Net>()));
  });
  calloc.free(cPath);
  calloc.free(cConfig);
  calloc.free(cFramework);

  return rval;
}