Model.fromFile constructor

Model.fromFile(
  1. String modelPath
)

Implementation

factory Model.fromFile(String modelPath) {
  final Pointer<Utf8> cpath = modelPath.toNativeUtf8();
  final Pointer<TfLiteModel> model = TfLiteModelCreateFromFile(cpath);
  malloc.free(cpath);
  checkArgument(model.address != nullptr.address, message: 'Unable to create model from file');
  return Model._(model);
}