ultralytics/yolo-flutter-app

Official Ultralytics YOLO Flutter plugin for real-time inference on Android and iOS across major vision tasks.

📦 What is YOLO Flutter?

YOLO Flutter is an official Ultralytics plugin that lets you run the popular YOLO family of computer‑vision models directly inside a Flutter mobile app. It abstracts away the platform‑specific details (Core ML on iOS, LiteRT/TFLite on Android, optional Qualcomm NPU support) and gives you a single Dart API for:

  • Single‑image inference – YOLO
  • Live‑camera inference – YOLOView

Both entry points support the full range of YOLO tasks (object detection, instance/semantic segmentation, depth, classification, pose, oriented‑bounding‑box) on iOS and Android.


✨ Key Features (as described in the README)

Feature Details
Cross‑platform API One Dart API works on iOS and Android.
Metadata‑first model loading Provide an official model ID or a custom exported model; the plugin reads embedded metadata to infer the task and class labels.
Real‑time camera inference YOLOView streams results from the device camera.
Single‑image inference YOLO predicts on a byte array of an image.
Supported tasks Detection, instance segmentation, semantic segmentation, depth estimation, classification, pose, OBB.
Model families YOLOv8 26 and YOLOv11 families.
Official model handling Automatic download & caching of Ultralytics‑hosted assets (LiteRT .tflite for Android, Core ML .mlpackage for iOS).
Custom models Load any exported TFLite, Core ML, or ONNX (QNN) model; metadata is used when present.
Qualcomm NPU (QNN) support Optional Hexagon NPU inference on Snapdragon devices via ONNX Runtime QNN provider.
Accelerator selection Choose CPU, GPU (LiteRT delegate) or NPU at runtime.
Result streaming Inference results are delivered via callbacks (onResult).
Versioned releases Model assets are pinned to GitHub release tags for reproducible downloads.

🚀 Quick‑Start Overview (from the README)

  1. Add the package
    dependencies:
      ultralytics_yolo: ^0.6.16
    
    Then run flutter pub get.
  2. Run a default model
    import 'package:ultralytics_yolo/ultralytics_yolo.dart';
    
    final modelId = YOLO.defaultOfficialModel() ?? 'yolo26n';
    
    YOLOView(
      modelPath: modelId,
      onResult: (results) {
        for (final r in results) {
          debugPrint('${r.className}: ${r.confidence}');
        }
      },
    );
    
  3. Single‑image inference
    final yolo = YOLO(modelPath: 'yolo26n');
    await yolo.loadModel();
    final results = await yolo.predict(imageBytes);
    
  4. Custom or remote models – supply a local asset path, a bundled .tflite/.mlpackage, or an HTTP URL. The plugin will download and cache remote models automatically.

📂 How Model Loading Works

Flow What you provide What the plugin does
Official model ID YOLO.defaultOfficialModel() or a specific ID like yolo26n Downloads the matching LiteRT (Android) or Core ML (iOS) asset from the Ultralytics GitHub releases, caches it, and loads it.
Custom exported model Path to a .tflite (Android) or .mlpackage/.mlmodel (iOS) file Reads embedded metadata (if present) to infer the task and class list; otherwise you must pass task.
Remote URL https://…/mymodel.tflite Downloads the file into app storage, then loads it.
Qualcomm NPU model Path ending with _qnn.onnx Routes the model to the ONNX Runtime QNN execution provider (requires extra Gradle dependencies and a Snapdragon device).

🛠️ Platform‑Specific Details

  • Android – Uses LiteRT (Google’s edge runtime) with a GPU‑delegate fallback. Models are w8a32 .tflite files (int8 weights, FP32 activations). Optional QNN support adds the onnxruntime-android-qnn and qnn-runtime libraries.
  • iOS – Uses Core ML (.mlpackage) by default. An optional Core AI (.aimodel) format is available on iOS 27+ devices.
  • Accelerator ladder – The runtime automatically picks GPU when available; otherwise it runs on CPU. NPU is only used when a _qnn.onnx model is supplied and the device meets the hardware requirements.

📚 Documentation & Guides (links from README)

  • Installation Guide – doc/install.md
  • Quick Start – doc/quickstart.md
  • Model Guide – doc/models.md (official IDs, export matrix, metadata)
  • Usage Guide – doc/usage.md
  • API Reference – doc/api.md
  • Performance Guide – doc/performance.md
  • Troubleshooting – doc/troubleshooting.md

🤝 Community & Support

  • Discord, Forums, Reddit – official Ultralytics channels.
  • GitHub Issues – for bug reports and feature requests.
  • Contributing – follow the Ultralytics contributing guide; the project welcomes code, docs, and feedback.

📄 License

The repository is dual‑licensed: AGPL‑3.0 for open‑source use and a commercial license option for proprietary projects (details in the README).


TL;DR

YOLO Flutter is a production‑ready bridge that brings Ultralytics’ YOLO models to any Flutter app, handling model download, platform‑specific runtimes, and real‑time camera inference with a clean Dart API. It’s ideal for developers who want on‑device computer‑vision (detection, segmentation, depth, pose, etc.) without writing native iOS/Android code.

Related

  • Project
  • Project
  • Project
  • Project
  • Project