Dr-Swopt 25926af9ea less strict with locking 1 tuần trước cách đây
..
android a5a8da405d working ver 1 tuần trước cách đây
assets a5a8da405d working ver 1 tuần trước cách đây
ios 8484533104 feat: Initialize new multi-platform Flutter project for the palm_oil_mobile application and remove old export scripts. 1 tuần trước cách đây
lib 25926af9ea less strict with locking 1 tuần trước cách đây
linux 9caef843c9 working ver 1 tuần trước cách đây
macos 8484533104 feat: Initialize new multi-platform Flutter project for the palm_oil_mobile application and remove old export scripts. 1 tuần trước cách đây
web 8484533104 feat: Initialize new multi-platform Flutter project for the palm_oil_mobile application and remove old export scripts. 1 tuần trước cách đây
windows e5fa9b926e live analysis screen 1 tuần trước cách đây
.gitignore 8484533104 feat: Initialize new multi-platform Flutter project for the palm_oil_mobile application and remove old export scripts. 1 tuần trước cách đây
.metadata 8484533104 feat: Initialize new multi-platform Flutter project for the palm_oil_mobile application and remove old export scripts. 1 tuần trước cách đây
README.md f50b1ed0a1 remove logs 1 tuần trước cách đây
analysis_options.yaml 8484533104 feat: Initialize new multi-platform Flutter project for the palm_oil_mobile application and remove old export scripts. 1 tuần trước cách đây
pubspec.lock e5fa9b926e live analysis screen 1 tuần trước cách đây
pubspec.yaml e5fa9b926e live analysis screen 1 tuần trước cách đây

README.md

Palm Oil Ripeness AI - Mobile App

This Flutter application ports the AI-driven palm oil ripeness detection system to mobile devices. It allows for gallery-based analysis with local history storage and health alerts.

🛠 Features

  • AI Inference: On-device TFLite processing for ripeness classification.
  • Gallery Analysis: Pick photos directly from the device gallery.
  • History Vault: Local storage of detection results using SQFlite.
  • Health Alerts: Immediate UI feedback for abnormal bunches.

🚀 Setup & Installation

Prerequisites

  • Flutter SDK installed and added to your PATH.
  • Android Studio or VS Code with Flutter extension.
  • A physical Android device connected via USB with "Developer Options" and "USB Debugging" enabled.

1. Initialize Project

Navigate to the mobile project directory and fetch dependencies:

cd palm_oil_mobile
flutter pub get

2. Run the App

To test the app with full AI performance, run it in Release Mode:

flutter run --release

🧪 Testing Instructions

  1. Launch the App: Open the app on your device.
  2. Select Gallery Analysis: Tap on the Analyze Gallery card.
  3. Pick a Photo: Grant gallery permissions and select a photo of a palm oil bunch.
  4. Observe Results:
    • The app will display "Initializing AI..." while processing.
    • The detected grade and confidence score will appear.
    • 🔴 Health Alert: If "Empty_Bunch" or "Abnormal" is detected, a red warning box will show.
  5. Check History: Navigate back to the Home screen and select History Vault to see your past detections.
  6. Re-examine: Tap on any history card to view the detailed summary.

🏗 Project Structure (Flutter Beginner's Guide)

As you're new to Flutter, here’s a map of where the important logic lives. All your custom code is inside the lib/ folder:

1. lib/main.dart

The entry point of the application. This is where the app theme is defined and the first screen (HomeScreen) is launched.

2. lib/models/

  • palm_record.dart: Defines the "blueprint" for a detection result. If you want to store more data (like GPS coordinates or weather), you'd add fields here.

3. lib/services/

This folder contains "behind-the-scenes" logic:

  • yolo_service.dart: Wraps the AI model. This is where the TFLite model is initialized and where image inference happens.
  • database_helper.dart: Manages the local SQLite database (palm_oil_history.db). Change this if you need to update the database schema.

4. lib/screens/

This is where the UI lives:

  • home_screen.dart: The main dashboard.
  • analysis_screen.dart: The UI for image selection, showing the loading spinner, and displaying the AI results.
  • history_screen.dart: The list view for previous records and the detail modal.

5. assets/

Located at the root of the project. This contains your non-code files:

  • models/best.tflite: The trained brain of the app.
  • labels/labels.txt: The names of the classes the model can recognize.

⚙️ Configuration

  • pubspec.yaml: The project's manifest. This is where you add new dependencies (like camera or GPS plugins) and register new assets.