Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

TensorFlow Lite Flutter Plugin

Announcement

Update: 26 April, 2023

This repo is a TensorFlow managed fork of the tflite_flutter_plugin project by the amazing Amish Garg. The goal of this project is to support our Flutter community in creating machine-learning backed apps with the TensorFlow Lite framework.

This project is currently a work-in-progress as we update it to create a working plugin that meets the latest and greatest Flutter and TensorFlow Lite standards. That said, pull requests and contributions are more than welcome and will be reviewed by TensorFlow or Flutter team members. We thank you for your understanding as we make progress on this update.

Feel free to reach out to me with questions until then.

Thanks!

Overview

TensorFlow Lite Flutter plugin provides a flexible and fast solution for accessing TensorFlow Lite interpreter and performing inference. The API is similar to the TFLite Java and Swift APIs. It directly binds to TFLite C API making it efficient (low-latency). Offers acceleration support using NNAPI, GPU delegates on Android, Metal and CoreML delegates on iOS, and XNNPack delegate on Desktop platforms.

Key Features

(Important) Initial setup : Add dynamic libraries to your app

Android

Copy the folders from https://github.com/tensorflow/flutter-tflite/tree/main/releases/download/android into your project’s /android/app/src/main/jniLibs directory.

iOS

TODO: Sample now works, info soon

TFLite Flutter Helper Library

The helper library has been deprecated. New development underway for a replacement at https://github.com/google/flutter-mediapipe

Import

import 'package:tflite_flutter/tflite_flutter.dart';

Usage instructions

Creating the Interpreter

Refer to the documentation for info on creating interpreter from buffer or file.

Performing inference

Closing the interpreter

interpreter.close();

Refer Tests to see more example code for each method.

Download and/or contribute this TensorFlow plugin on GitHub

Exit mobile version