A Flutter mobile application that uses TensorFlow Lite to recognize and classify fruits from images.
- 📸 Camera Capture: Take photos directly with your device camera
- 🖼️ Gallery Selection: Choose images from your device gallery
- 🤖 AI Recognition: Uses TensorFlow Lite model to identify 232 different fruit types
- 📊 Confidence Score: Shows the confidence level of the prediction
- 📱 Cross-Platform: Works on both Android and iOS
-
Install Dependencies
flutter pub get
-
Run the App
For Android:
flutter run
For iOS:
flutter run -d ios
- Launch the app
- Choose one of two options:
- Camera: Take a new photo of a fruit
- Gallery: Select an existing image from your gallery
- Wait for the ML to analyze the image
- View the result with the fruit name and confidence score
- Tap Reset to analyze another fruit
- Model: TensorFlow Lite model (
fruit_model.tflite) - Labels: 232 fruit varieties (see
labels.txt) - Input: 224x224 RGB images
- Output: Fruit classification with confidence score
- Camera access
- Storage read/write access
- Camera usage
- Photo library access
- Framework: Flutter 3.11+
- ML Library: tflite_flutter ^0.12.1
- Image Handling: image_picker ^1.0.4, image ^4.1.3
lib/
├── main.dart # Main app entry and UI
├── fruit_classifier.dart # TFLite model service
assest/
├── fruit_model.tflite # TensorFlow Lite model
└── labels.txt # Fruit class labels
The model can recognize 232 different types of fruits including:
- Various apple varieties (Golden, Granny Smith, Red Delicious, etc.)
- Bananas, Oranges, Lemons, Limes
- Berries (Strawberry, Blueberry, Blackberry, etc.)
- Tropical fruits (Mango, Pineapple, Papaya, etc.)
- And many more...
See assest/labels.txt for the complete list.