A Flutter application that uses Google ML Kit to detect and classify objects in photos captured with the device camera. Built for iOS 15.5+ and Android, this app demonstrates powerful on-device machine learning capabilities.
- Camera Integration: Tap the camera button to capture photos using the device camera
- Real-time Object Detection: Leverages Google ML Kit for accurate object detection and classification
- Visual Bounding Boxes: Displays color-coded boxes around detected objects in the image
- Interactive Selection: Tap any detected object card to highlight its corresponding bounding box
- Detailed Results: Displays detected objects with:
- Primary object label with highest confidence
- Multiple classification possibilities per object
- Confidence scores (percentage)
- Visual confidence indicators (HIGH/MEDIUM/LOW)
- Color-coded badges
- Bounding box coordinates
- Adjustable Settings: Configure detection parameters:
- Confidence threshold slider (adjust sensitivity)
- Image quality control
- Split-Screen Layout: Fixed image display at top with scrollable object list below
- Clean UI: Modern Material Design 3 interface
- On-device Processing: All detection happens locally using Google's ML Kit
- Multi-label Classification: Shows alternative classifications for each detected object
- iOS: 15.5 or later (compatible with iOS 26)
- Android: API Level 21 or later
- Xcode: 13.0 or later (for iOS development)
- Flutter: 3.9.2 or later
- CocoaPods: Latest version (for iOS)
- Flutter: Cross-platform framework
- Google ML Kit: On-device machine learning for object detection and image labeling
- Packages:
google_mlkit_object_detection^0.15.0 - Google ML Kit object detectiongoogle_mlkit_image_labeling^0.14.1 - Google ML Kit image labelingimage_picker^1.1.2 - Camera and photo library access
cd ml_vision
flutter pub getcd ios
pod install
cd ..Connect your iOS device or start the iOS simulator:
flutter runOr open in Xcode:
open ios/Runner.xcworkspaceThe project includes all necessary iOS configurations:
- Set to iOS 15.5 in both
Podfileand Xcode project settings
The following permissions are configured in Info.plist:
NSCameraUsageDescription: Camera access for taking photosNSPhotoLibraryUsageDescription: Photo library access for image selection
com.example.mlVision
- Launch the app on your iOS device
- Tap the camera button (floating action button) to open the camera
- Take a picture of objects you want to detect
- View results showing:
- Captured image
- List of detected objects
- Confidence scores for each detection
lib/
└── main.dart # Main app with object detection logic
ios/
├── Podfile # CocoaPods dependencies (iOS 15.5)
├── Runner.xcodeproj/ # Xcode project
└── Runner/
└── Info.plist # iOS permissions and configuration
Run:
flutter clean
flutter pub get
cd ios
pod install
cd ..Ensure the deployment target is set to iOS 15.5:
- Check
ios/Podfile:platform :ios, '15.5' - Check Xcode project settings: Target → Deployment Info → iOS 15.5
ML Kit works best with:
- Clear, well-lit images
- Distinct objects with defined shapes
- Common everyday objects (furniture, food, animals, vehicles, etc.)
- Objects that aren't too small in the frame
Verify camera permissions are granted in device Settings → Your App → Camera
- Requires physical device with camera for best results
- Object detection accuracy depends on Google ML Kit models
- Detection works best with common objects in well-lit conditions
- May not detect very small objects or unusual items
This project is a demonstration application for educational purposes.
- Built with Flutter
- Uses Google ML Kit
- Object detection via google_mlkit_object_detection package