TH
ThatLinuxGuyYouKnow/Flutter-Image-Classification
Image Classification with On-Device Inference, built with Flutter, AI model runs on mobile cpu
Image Classification with on-device AI model
First, Sample Results!
Overview
Image Classification with On-Device Inference is a Flutter app that performs image classification using a pre-trained machine learning model running directly on the device. This ensures fast inference and data privacy, with no cloud dependencies for model processing.
๐ Features
- On-device inference: The pre-trained ONNX model runs entirely on your device
- Customizable file picker: Upload images in supported formats: .jpg, .jpeg, .png, .bmp
- Real-time predictions: Displays the predicted class along with the probabilities
- Error handling: Validates file type, size (max 10MB), and ensures seamless user experience
- Cross-platform: Works on both Android and iOS devices
๐ ๏ธ Tech Stack
- Framework: Flutter
- Model Framework: ONNX Runtime
- Packages:
file_picker: For selecting image filesonnxruntime: For running the model locally
๐ How It Works
- Select an Image: Tap the "Upload Image for Inference" button to choose an image file
- Run Inference: The app preprocesses the image and runs it through the ONNX model
- View Results: The app displays the predicted class and confidence probabilities
- Error Handling: If any issues occur (invalid file, processing error), a helpful error message will be shown
๐ฅ๏ธ Setup Instructions
Prerequisites
- Flutter SDK installed
- ONNX Runtime for Flutter added to your pubspec.yaml
Clone the Repository
git clone https://github.com/ThatLinuxGuyYouKnow/Flutter-Image-Classification
cd Flutter-Image-ClassificationInstall Dependencies
flutter pub getRun the App
flutter runLimitations
- File size limit: Max image size is 10MB
- Supported formats: Only .jpg, .jpeg, .png, and .bmp files are accepted
- Device compatibility: Requires devices with ONNX Runtime compatibility
[!] Labels Txt is currently minimized during a production build
License
This project is licensed under the MIT License. See the LICENSE file for details.
On this page
Languages
Dart85.7%Swift8.3%HTML5.4%Kotlin0.6%
Contributors
Created January 27, 2025
Updated February 15, 2025

