← all repositories
shaqian/flutter_tflite

Flutter meets TensorFlow Lite, minus the JNI headaches

A Flutter plugin that wraps TFLite for iOS and Android so you don't have to write your own platform channels for image classification, object detection, or pose estimation.

640 stars Objective-C++ Inference · ServingML Frameworks
flutter_tflite
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

What it does

This plugin exposes TensorFlow Lite inference to Dart through a thin platform-channel wrapper. You load a .tflite model and labels from Flutter assets, then call typed methods for image classification, SSD/YOLO object detection, Pix2Pix image translation, Deeplab segmentation, or PoseNet pose estimation. Results come back as Dart maps or byte arrays; no manual JNI or Objective-C++ required for the happy path.

The interesting bit

The API surface is deliberately narrow and model-specific. Instead of a generic tensor runner, you get purpose-built methods like runModelOnImage or detectObjectOnFrame with pre-baked preprocessing parameters (imageMean, imageStd, threshold). That trades flexibility for velocity—fine if you’re dropping in standard MobileNet or YOLO weights, less so if your model expects exotic input shapes.

Key highlights

  • Supports both static images and camera-frame streams (via the camera plugin 4.0.0)
  • GPU delegate toggle via useGpuDelegate: true in loadModel
  • iOS upgraded to TensorFlowLiteObjC 2.x as of v1.1.0; Android uses standard TFLite
  • Handles the tedious aaptOptions { noCompress 'tflite' } Android setup and iOS Compile Sources As gotchas in the docs
  • PoseNet, Deeplab, and Pix2Pix support go beyond the usual “just image classification” Flutter plugins

Caveats

  • iOS build can still break on header paths; you may need to uncomment #define CONTRIB_PATH for older TensorFlow versions
  • README is thorough on usage but sparse on performance numbers, test coverage, or maintenance status
  • 640 stars suggests modest adoption; check recent commit activity before betting a product on it

Verdict

Worth a look if you need to ship a Flutter prototype with off-the-shelf TFLite models and want to avoid platform-channel boilerplate. Skip it if you need custom tensor shapes, heavy preprocessing pipelines, or enterprise-grade support.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.