๐Ÿš€ YOLO Flutter - Ultralytics Official Plugin

July 4, 2026 ยท View on GitHub

Ultralytics logo

English | ็ฎ€ไฝ“ไธญๆ–‡

๐Ÿš€ YOLO Flutter - Ultralytics Official Plugin

Ultralytics Actions .github/workflows/ci.yml codecov CocoaPods

Ultralytics Discord Ultralytics Forums Ultralytics Reddit

Ultralytics YOLO Flutter is the official plugin for running YOLO models in Flutter apps on iOS and Android. It supports detection, instance segmentation, semantic segmentation, classification, pose, and OBB with two simple entry points:

  • YOLO for single-image inference
  • YOLOView for real-time camera inference

The main goal is simple integration: use an official model ID, or drop in your own exported model and let the plugin resolve task metadata for you.


Ultralytics YOLO iOS App previews

Apple App store ย ย  Get it on Google Play

โœจ Features

  • Official Ultralytics plugin for Flutter
  • One Dart API for Android and iOS
  • Metadata-first model loading with official model download and caching
  • Real-time camera inference and single-image inference
  • Controls for thresholds, accelerator selection, and result streaming
  • YOLO26 and YOLO11 model families supported
FeatureAndroidiOSDetails
Object Detectionโœ…โœ…Bounding boxes, labels, and confidence scores
Instance Segmentationโœ…โœ…Instance masks with boxes and classes
Semantic Segmentationโœ…โœ…Dense class masks for every pixel
Image Classificationโœ…โœ…Top class predictions and scores
Pose Estimationโœ…โœ…Keypoints with boxes and confidence scores
Oriented Bounding Box (OBB) Detectionโœ…โœ…Rotated boxes and polygon corners
Real-Time Camera Inferenceโœ…โœ…YOLOView for live camera workflows
Single-Image Inferenceโœ…โœ…YOLO for image bytes
Official Modelsโœ…โœ…Discovery, download, and caching for packaged model IDs
Custom Modelsโœ…โœ…LiteRT (TFLite) on Android, Core ML on iOS, metadata-first tasks
Qualcomm NPU (QNN)โœ…โ€”Opt-in Hexagon NPU inference for *_qnn.onnx models on Snapdragon

โšก Quick Start

Install the package:

Package: https://pub.dev/packages/ultralytics_yolo

dependencies:
  ultralytics_yolo: ^0.6.8
flutter pub get

Start with the default official 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}');
    }
  },
)

For single-image inference:

final yolo = YOLO(modelPath: 'yolo26n');
await yolo.loadModel();
final results = await yolo.predict(imageBytes);

โ–ถ๏ธ Example App | ๐Ÿ“– Installation Guide | โšก Quick Start Guide

๐Ÿ“ฆ Model Loading

The plugin supports three model flows.

1. Official model IDs

Use the default official model or a specific official ID and let the plugin handle download and caching:

final yolo = YOLO(modelPath: YOLO.defaultOfficialModel() ?? 'yolo26n');

Call YOLO.officialModels() to see which official IDs are available on the current platform. Official assets are downloaded on first use and cached in app storage, so the app package does not carry large model files.

Official assets are maintained as GitHub release assets:

PlatformRuntime assetRelease
AndroidLiteRT w8a32 .tfliteyolo-flutter-app v0.6.6
Android NPU (opt-in)QNN *_v73/_v81_qnn.onnxyolo-flutter-app v0.3.5
iOSCore ML int8 .mlpackage.zipyolo-ios-app v8.3.0

The Flutter resolver uses the TFLite release for Android and the Core ML release for Apple platforms. These release tags are intentionally pinned for reproducible first-use downloads. See the model guide for the official export matrix, URL patterns, and model properties.

2. Your own exported model

Pass your own exported YOLO model as a local path or Flutter asset path:

final yolo = YOLO(modelPath: 'assets/models/my-finetuned-model.tflite');

If the exported model includes embedded metadata, the plugin infers task and class labels automatically โ€” it reads Ultralytics' appended-ZIP metadata, with a standard TFLite (FlatBuffers) metadata fallback โ€” so drag-and-drop custom models auto-detect. If metadata is missing, pass task explicitly.

final yolo = YOLO(
  modelPath: 'assets/models/my-finetuned-model.tflite',
  task: YOLOTask.detect,
);

3. Remote model URL

Pass an http or https URL and the plugin will download it into app storage before loading it.

4. Qualcomm NPU models (Android, opt-in)

Android ships with LiteRT (TFLite) and that remains the default โ€” nothing changes for existing apps, and the QNN support adds zero bytes to your build. Any model path ending in _qnn.onnx (a Qualcomm QNN context binary exported with yolo export format=qnn) is routed to the Hexagon NPU through the ONNX Runtime QNN Execution Provider instead.

Running QNN models requires a Snapdragon device with a Hexagon HTP (Snapdragon 8 Gen 2 or newer for the official _v73 assets; _v81 targets Snapdragon 8 Elite Gen 5) and three additions to your app's android/app/build.gradle:

android {
    packagingOptions {
        jniLibs {
            useLegacyPackaging = true // the Hexagon DSP loader needs real .so files, not APK-mmapped ones
        }
    }
}

dependencies {
    implementation 'com.microsoft.onnxruntime:onnxruntime-android-qnn:1.26.0'
    implementation 'com.qualcomm.qti:qnn-runtime:2.46.0' // newer than the AAR's bundled QAIRT; required for the latest Snapdragons
}
final yolo = YOLO(
  modelPath: 'https://github.com/ultralytics/yolo-flutter-app/releases/download/v0.3.5/yolo26n_v73_qnn.onnx',
  task: YOLOTask.detect,
);

Without the Gradle opt-in, loading a _qnn.onnx model fails with a clear error and TFLite models are unaffected. The bundled example app follows the same opt-in โ€” it ships without the QNN runtime to keep its download small, so build it with ENABLE_QNN=1 (e.g. ENABLE_QNN=1 flutter run --release) to test the NPU path on a device. See the performance guide for measured CPU/GPU/NPU numbers and tuning notes.

๐Ÿงญ Official vs. Custom

Use caseRecommended path
Fastest first integrationOfficial model ID like yolo26n
You trained or exported your own modelCustom asset or local file
You ship different models per customer or environmentRemote URL
You need the plugin to infer task automaticallyAny export with metadata
You have an older or stripped export without metadataCustom model plus explicit task

For official models, start with YOLO.defaultOfficialModel() or YOLO.officialModels(). For custom models, start with the exported file you actually plan to ship.

๐Ÿ“ฅ Using Your Own Model

For custom models, keep the app-side setup minimal.

  • Android native assets: place .tflite files in android/app/src/main/assets
  • Flutter assets on Android: place .tflite files in assets/models/
  • iOS bundle: drag .mlpackage or .mlmodel into ios/Runner.xcworkspace
  • Flutter assets on iOS: place .mlpackage.zip files in assets/models/

Then point modelPath at that file or asset path.

Official asset maintenance

The Android TFLite release assets are generated by scripts/export-tflite-models.py. The script defines the official YOLO26 task/size matrix, w8a32 export settings (int8 weights, FP32 activations โ€” dynamic-range, so no calibration data is needed), optional one-shot TFLite inference verification, and optional GitHub release upload.

Run it on Linux x86 or macOS with Python โ‰ฅ3.10:

uv venv --python 3.12 .venv
uv pip install --index-url https://download.pytorch.org/whl/cpu torch torchvision
uv pip install "ultralytics-opencv-headless[export-litert]>=8.4.83"
uv run python scripts/export-tflite-models.py --verify

Use --upload --repo ultralytics/yolo-flutter-app --tag v0.6.6 to publish generated .tflite assets to the canonical Android release. The matching Core ML assets are generated by ../yolo-ios-app/scripts/export-models.py and hosted on the iOS v8.3.0 release.

Android inference runs on LiteRT 2.x through an automatic GPU -> CPU accelerator ladder. w8a32 assets are the official download artifacts (the smallest GPU-compatible litert format); the GPU delegate compiles the whole graph on supported devices and otherwise falls back to CPU. GPU coverage still depends on the device driver and graph, so confirm delegate placement on your target hardware (the GPU delegate runs the graph in FP16):

from ultralytics import YOLO

YOLO("yolo26n.pt").export(format="litert", nms=False, end2end=False, imgsz=640)

๐ŸŽฏ Choosing an API

Use YOLO when you already have image bytes and want one prediction at a time:

final yolo = YOLO(modelPath: 'yolo26n');
await yolo.loadModel();
final results = await yolo.predict(imageBytes);

Use YOLOView when you want live camera inference:

final controller = YOLOViewController();

YOLOView(
  modelPath: 'yolo26n',
  controller: controller,
  onResult: (results) {},
)

await controller.switchModel('assets/models/custom.tflite', YOLOTask.detect);

Use YOLOShowcase when you want the complete Ultralytics camera UI:

YOLOShowcase(
  initialTask: YOLOTask.detect,
  initialModelSize: 'n',
  onCapture: (bytes) {},
)

๐Ÿ”„ Migrating From 0.3.x UI APIs

Version 0.4.0 removes the old Dart-side overlay/control layer. Camera detections are rendered natively by YOLOView; Flutter now owns only the surrounding app controls.

Removed 0.3.x API0.4.0 replacement
YOLOOverlay, YOLOOverlayThemeRemove these widgets. Use native YOLOView overlays, or consume onResult/YOLO.predict() data.
YOLOControlsUse YOLOShowcase for the full UI, or compose the exported Material widgets directly.
YOLOView.showNativeUIUse YOLOShowcase for built-in controls; use bare YOLOView when building your own UI.
YOLOView.showOverlays, YOLOView.overlayThemeNo constructor replacement. Camera overlay drawing is native and not themed from Dart.
YOLOViewController.setShowUIControls()Show/hide your own Flutter controls around YOLOView.
YOLOViewController.setShowOverlays()Still available: toggles native overlay rendering. capturePhoto(withOverlays: false) only affects captured JPEG output.
App typeModel loading pattern
Live camera appYOLOView(modelPath: 'yolo26n')
Photo picker or gallery workflowYOLO(modelPath: 'yolo26n')
App with your own bundled modelYOLO(modelPath: 'assets/models/custom.tflite')
Cross-platform Core ML + TFLite appUse platform-appropriate exported assets and let metadata drive task
App that changes models at runtimeYOLOViewController.switchModel(...)

๐Ÿ“š Documentation

GuideDescription
Installation GuideRequirements and platform setup
Quick StartMinimal setup for the first working app
Model GuideOfficial models, custom models, export flow
Usage GuideCommon app patterns and examples
API ReferenceFull API surface
Performance GuideTuning controls and on-device benchmark record
TroubleshootingCommon problems and fixes

๐Ÿค Community & Support

Ultralytics Discord Ultralytics Forums Ultralytics Reddit

๐Ÿ’ก Contribute

Ultralytics thrives on community collaboration, and we deeply value your contributions! Whether it's bug fixes, feature enhancements, or documentation improvements, your involvement is crucial. Please review our Contributing Guide for detailed insights on how to participate. We also encourage you to share your feedback through our Survey. A heartfelt thank you ๐Ÿ™ goes out to all our contributors!

Ultralytics open-source contributors

๐Ÿ“„ License

Ultralytics offers two licensing options to accommodate diverse needs:

  • AGPL-3.0 License: Ideal for students, researchers, and enthusiasts passionate about open-source collaboration. This OSI-approved license promotes knowledge sharing and open contribution. See the LICENSE file for details.
  • Enterprise License: Designed for commercial applications, this license permits seamless integration of Ultralytics software and AI models into commercial products and services, bypassing the open-source requirements of AGPL-3.0. For commercial use cases, please inquire about an Enterprise License.

Native iOS Development

If you're interested in using YOLO models directly in iOS applications with Swift (without Flutter), check out our dedicated iOS repository:

๐Ÿ‘‰ Ultralytics YOLO iOS App - A native iOS application for real-time detection, instance segmentation, semantic segmentation, classification, pose estimation, and OBB detection with Ultralytics YOLO models.

This repository provides:

  • Pure Swift implementation for iOS
  • Direct Core ML integration
  • Native iOS UI components
  • Example code for various YOLO tasks
  • Optimized for iOS performance

Note

On iOS this plugin is built on the shared UltralyticsYOLO Swift package (import UltralyticsYOLO) โ€” the same inference core used by the native iOS app โ€” so both stay in sync from a single source of truth. The plugin's iOS sources (ios/ultralytics_yolo/) hold only the Flutter bridge and the camera/view components, and ship for both Swift Package Manager and CocoaPods.

๐Ÿ“ฎ Contact

Encountering issues or have feature requests related to Ultralytics YOLO? Please report them via GitHub Issues. For broader discussions, questions, and community support, join our Discord server!


Ultralytics GitHub space Ultralytics LinkedIn space Ultralytics Twitter space Ultralytics YouTube space Ultralytics TikTok space Ultralytics BiliBili space Ultralytics Discord