# 🌴 Palm Oil Ripeness AI - Mobile App (YOLO26 Edition) A professional, high-performance Flutter application powered by the **YOLO26 (January 2026)** architecture. Designed for palm oil plantation managers, this app utilizes **NMS-Free End-to-End** detection for maximum efficiency in the field. --- ## 📱 Executive Summary The **Palm Oil Ripeness AI** mobile app is a field-ready tool that automates Fresh Fruit Bunch (FFB) assessment. By leveraging **YOLO26-Nano**, the app achieves a **43% speed increase** on mobile CPUs compared to previous generations, eliminating latency bottlenecks and providing instant, high-accuracy grading without internet connectivity. --- ## 🛠 Features ### 1. **Live Inference (NMS-Free Point-and-Scan)** - **Real-time Detection:** Powered by YOLO26's native one-to-one label assignment, removing the need for post-inference NMS processing. - **Momentum Lock:** A robust hysteresis system that "locks" onto fruit bunches to prevent camera stutter and ensure reliable capture. - **Ultra-Low Latency:** Optimized for **38.9ms inference** on standard mobile hardware. ### 2. **Snap & Analyze (Manager's Manual Mode)** - **High-Res Accuracy:** Manual shutter mode using `ResolutionPreset.high` for maximum detail. - **Direct JPEG Decoding:** Skips YUV conversion for the most accurate industrial-grade inference. - **Auto-Reset Workflow:** Seamlessly clears previous results after acknowledgment to allow rapid sequential captures. ### 3. **Analyze Gallery** - Allows managers to analyze previously captured photos from the device's storage. - Includes a scanning animation and detailed bounding box overlays. ### 4. **History Vault & Result Persistence** - **SQLite Storage:** Every analysis is stored locally with metadata (ripeness class, confidence, coordinates). - **Image Archiving:** Automatically copies and persists captured images to the `ApplicationDocumentsDirectory`. ### 5. **Industrial Alerts & Summaries** - **Health Alert:** 🔴 Red warnings for "Abnormal" or "Empty_Bunch" detections. - **Yield Warning:** 🟠 Orange alerts for "Unripe" or "Underripe" fruit, highlighting "Potential Yield Loss" to optimize Oil Extraction Rates (OER). --- ## 🚀 Setup & Installation ### Prerequisites - [Flutter SDK](https://docs.flutter.dev/get-started/install) (latest stable). - **Ultralytics 8.4.24+** (for model conversion to TFLite/CoreML). - A physical Android/iOS device (Camera required; Emulators NOT recommended). ### 1. Initialize Project ```bash # Navigate to the mobile project directory cd palm_oil_mobile # Fetch dependencies flutter pub get ``` ### 2. Run the App To take advantage of the **YOLO26 performance gains**, run in **Release Mode**: ```bash flutter run --release ``` --- ## 🏗 Project Architecture ### 📁 `lib/services/` (Logic Layer) - **`tflite_service.dart`**: An Isolate-based service handling **YOLO26 NMS-Free** inference. By removing the NMS step, the service reduces UI thread jank by up to 50% compared to legacy v8 models. --- ## 📦 Assets - `assets/best.tflite`: The **YOLO26-Nano** model (Natively NMS-Free). - `assets/labels.txt`: Class definitions (Ripe, Unripe, Underripe, Overripe, Abnormal, Empty_Bunch). --- ## ⚠️ Requirements & Permissions - **Camera:** Required for Live and Static analysis. - **Storage:** Required to save/load photos and database records.