Net.fromOnnx constructor

Net.fromOnnx(
  1. String path
)

Implementation

factory Net.fromOnnx(String path) {
  return using<Net>((arena) {
    final p = calloc<cdnn.Net>();
    final cpath = path.toNativeUtf8(allocator: arena).cast<ffi.Char>();
    cvRun(() => cdnn.Net_ReadNetFromONNX(cpath, p));
    final net = Net._(p);
    return net;
  });
}