Net.fromCaffe constructor

Net.fromCaffe(
  1. String prototxt,
  2. String caffeModel
)

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

Implementation

factory Net.fromCaffe(String prototxt, String caffeModel) {
  final cProto = prototxt.toNativeUtf8().cast<ffi.Char>();
  final cCaffe = caffeModel.toNativeUtf8().cast<ffi.Char>();
  final p = calloc<cvg.Net>();
  cvRun(() => cdnn.cv_dnn_Net_readNetFromCaffe(cProto, cCaffe, p, ffi.nullptr));
  calloc.free(cProto);
  calloc.free(cCaffe);
  final net = Net._(p);
  return net;
}