tflite_native 0.3.0

Build Status

A Dart interface to TensorFlow Lite (tflite) through Dart's foreign function interface (FFI). This library wraps the experimental tflite C API.

This package supports desktop use cases (Linux, OSX, Windows, etc) and Flutter developers should consider flutter_tflite. For example, this package locates a tflite dynamic library through Isolate.resolvePackageUri which doesn't translate perfectly in the Flutter context (see https://github.com/flutter/flutter/issues/14815).

0.3.0 #

  • Update to new tflite C API

0.2.3 #

  • Specify >=2.5.0 in pubspec.yaml

0.2.2 #

  • Use Pointer.asExternalTypedData for reading output tensor

0.2.1 #

0.2.0 #

  • Load shared object as sibling when running from snapshot

0.1.0 #

  • Apply fixes from dartfmt
  • Update package description

0.0.3 #

  • Bundle binaries for 64-bit linux, mac, and windows systems
  • Bindings for 24 / 29 functions exposed by libtensorflow_c.so

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  tflite_native: ^0.3.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:tflite_native/tflite.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
63
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

We analyzed this package on Sep 19, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Platform components identified in package: io, isolate.

Health suggestions

Format lib/src/bindings/interpreter.dart.

Run dartfmt to format lib/src/bindings/interpreter.dart.

Format lib/src/bindings/interpreter_options.dart.

Run dartfmt to format lib/src/bindings/interpreter_options.dart.

Format lib/src/bindings/model.dart.

Run dartfmt to format lib/src/bindings/model.dart.

Format lib/src/bindings/tensor.dart.

Run dartfmt to format lib/src/bindings/tensor.dart.

Format lib/src/interpreter.dart.

Run dartfmt to format lib/src/interpreter.dart.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and tflite_native.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
path ^1.6.2 1.6.4
quiver ^2.0.3 2.0.5
Transitive dependencies
matcher 0.12.5
meta 1.1.7
stack_trace 1.9.3
Dev dependencies
test ^1.6.4