mnn 0.0.2 copy "mnn: ^0.0.2" to clipboard
mnn: ^0.0.2 copied to clipboard

A package for running MNN models on Dart and Flutter.

MNN.dart #

A Dart wapper for MNN.

Features #

  • Inference MNN models in Dart.
  • Native-Assets support.

Getting started #

dart --enable-experiment=native-assets run example/main.dart

Usage #

import 'package:mnn/mnn.dart' as mnn;

void main() {
  final net = mnn.Interpreter.fromFile("example.mnn");
  final session = net.createSession();
  final input = session.getInput();
  final output = session.getOutput();
  // fill input
  session.run();
  // process output
  final outputUser = mnn.Tensor.fromTensor(output, dimType: dimType);
  output.copyToHost(outputUser);
  outputUser.printShape();
}

TODO #

  • ❌ async
  • ❌ support custom build configuration in pubspec.yaml
  • ❌ support more backends

Authors #

License #

Apache-2.0

1
likes
140
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

A package for running MNN models on Dart and Flutter.

Repository (GitHub)

Topics

#mnn #machine-learning #deep-learning #native-assets

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

ffi, logging, meta, native_assets_cli, native_toolchain_cmake

More

Packages that depend on mnn