搜尋套件、儲存庫與 APP 分類

flutter_vision 封面
套件詳情v3.0.2

flutter_vision

用於管理 Yolov5、Yolov8 和 Yolov11 的外掛程式,透過 LiteRT(TensorFlow Lite)支援。在 Android 上支援物件偵測與分割,iOS 正在進行中。

AndroidiOS
近 30 天下載
348
喜歡數
116
Pub 分數
160

安裝套件

flutter pub add flutter_vision

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

flutter_vision 是一個 Flutter 插件,透過 LiteRT(TensorFlow Lite)支援使用 YOLOv5、YOLOv8 和 YOLOv11 模型進行物件偵測與分割。它支援 Android 與 iOS 平台,為電腦視覺任務提供高效能的裝置端推論。此插件專為希望在行動應用程式中整合即時影像分析的開發者設計,並持續開發以提升功能與效能。對於需要在裝置上快速且準確地辨識與定位物件的應用尤為實用。

適用情境

  • 移動應用中的即時物件偵測
  • 增強現實中的圖像分割
  • 設備端 OCR 和視覺分析
  • 基於移動設備的監控系統
  • AI驅動的照片標籤

主要特色

  • 支援 YOLOv5、YOLOv8 和 YOLOv11 模型
  • 透過 LiteRT 使用 TensorFlow Lite 以實現最佳化效能
  • 跨平台 Android 和 iOS 兼容性
  • 輕量且適合移動部署
  • 內建物件檢測和分割支援

適合對象

  • 移動應用開發者使用人工智慧視覺
  • 團隊正在建構本地設備上的電腦視覺功能
  • 需要低延遲推理的項目
  • 開發人員使用最少的設定即可針對 Android 和 iOS
  • 原型開發人工智慧驅動的相機應用

使用建議

  • 仍在積極開發中
  • 可用文件有限
  • 性能取決於設備硬體
  • 模型大小可能影響應用程式封裝大小
  • iOS 結合可能需要額外設定

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_vision

A Flutter plugin for managing Yolov5, Yolov8, and Yolov11 accessing with LiteRT (TensorFlow Lite). Support object detection and segmentation on Android. iOS not updated, working in progress.

Installation

Add flutter_vision as a dependency in your pubspec.yaml file.

Android

In android/app/build.gradle, add the following setting in android block.

    android{
        aaptOptions {
            noCompress 'tflite'
            noCompress 'lite'
        }
    }

iOS

Coming soon ...

Usage

For YoloV5, YoloV8, and YoloV11 MODEL

  1. Create a assets folder and place your labels file and model file in it. In pubspec.yaml add:
  assets:
   - assets/labels.txt
   - assets/yolovx.tflite
  1. Import the library:
import 'package:flutter_vision/flutter_vision.dart';
  1. Initialized the flutter_vision library:
 FlutterVision vision = FlutterVision();
  1. Load the model and labels: modelVersion: yolov5 or yolov8 or yolov8seg or yolo11 or yolov11
await vision.loadYoloModel(
        labels: 'assets/labelss.txt',
        modelPath: 'assets/yolov5n.tflite',
        modelVersion: "yolov5",
        quantization: false,
        numThreads: 1,
        useGpu: false);
For camera live feed
  1. Make your first detection: confThreshold work with yolov5 other case it is omited.

Make use of camera plugin

final result = await vision.yoloOnFrame(
        bytesList: cameraImage.planes.map((plane) => plane.bytes).toList(),
        imageHeight: cameraImage.height,
        imageWidth: cameraImage.width,
        iouThreshold: 0.4,
        confThreshold: 0.4,
        classThreshold: 0.5);
For static image
  1. Make your first detection or segmentation:
final result = await vision.yoloOnImage(
        bytesList: byte,
        imageHeight: image.height,
        imageWidth: image.width,
        iouThreshold: 0.8,
        confThreshold: 0.4,
        classThreshold: 0.7);
  1. Release resources:
await vision.closeYoloModel();

About results

For Yolo v5, v8, or v11 in detection task

result is a List<Map<String,dynamic>> where Map have the following keys:

   Map<String, dynamic>:{
    "box": [x1:left, y1:top, x2:right, y2:bottom, class_confidence]
    "tag": String: detected class
   }

For YoloV8 in segmentation task

result is a List<Map<String,dynamic>> where Map have the following keys:

   Map<String, dynamic>:{
    "box": [x1:left, y1:top, x2:right, y2:bottom, class_confidence]
    "tag": String: detected class
    "polygons": List<Map<String, double>>: [{x:coordx, y:coordy}]
   }

Example

Screenshot_2022-04-08-23-59-05-652_com vladih dni_scanner_example Home Detection Segmentation

Contact

  • For flutter_vision bug reports and feature requests please visit GitHub Issues
  • For direct contact: yurihuallpavargas@gmail.com

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。