A cross-platform .NET MAUI application that performs real-time object detection using YOLOv11 models. Built with ONNX Runtime for hardware-accelerated inference on Windows, Android, iOS, and macOS.
This project leverages ONNX Runtime for efficient neural network inference and SkiaSharp for high-performance graphics rendering.
- Real-Time Camera Detection: Detect 80+ object classes in real-time using your device's camera
- Gallery Image Analysis: Process and analyze images from your photo gallery
- Multi-Platform Support: Runs on Windows, Android, iOS, and macOS (Catalyst)
- Hardware Acceleration: Automatically uses DirectML (Windows) or NNAPI (Android) when available
- YOLOv11 Models: Includes both float32 and int8 quantized models for optimal performance
- Customizable Detection: Adjust confidence and IoU thresholds in real-time
- Visual Overlays: Color-coded bounding boxes with confidence scores
- Image Capture: Save detection results with annotations to your device
- Light & Dark Themes: Automatically adapts to system theme preferences
- FPS Counter: Monitor real-time detection performance
ObjectDetector/
βββ Pages/
β βββ CameraPage.xaml.cs # Real-time camera detection
β βββ GalleryPage.xaml.cs # Static image processing
β βββ SettingsPage.xaml.cs # App configuration
β βββ HistoryPage.xaml.cs # (Future feature)
βββ Services/
β βββ YoloDetector.cs # ONNX Runtime inference engine
β βββ Detection.cs # Detection result model
β βββ DetectionDrawable.cs # Real-time overlay rendering
β βββ DetectionRenderingConfig.cs # Adaptive UI scaling
βββ Resources/
β βββ Raw/
β βββ yolo11m.onnx # Float32 YOLOv11-medium model
β βββ yolo11m_int8.onnx # INT8 quantized model
βββ Platforms/
β βββ Android/ # Android-specific implementations
β βββ iOS/ # iOS-specific implementations
β βββ MacCatalyst/ # macOS-specific implementations
β βββ Windows/ # Windows-specific implementations
βββ AppShell.xaml # App navigation structure
βββ MauiProgram.cs # App initialization & DI setup
- Visual Studio 2022 (version 17.13 or newer) with .NET MAUI workload installed
- .NET 10 SDK or newer
- Platform-specific SDKs:
- Windows: Windows 10 SDK (19041 or newer)
- Android: Android SDK API 26+ (Android 8.0 Oreo)
- iOS: Xcode 15.0+ (iOS 15.0+)
- macOS: Xcode 15.0+ (macOS 12.0+)
- Display: Minimum 1280x720 resolution recommended
- Camera: Required for real-time detection mode
- Storage: ~200 MB for Android and ~300 MB for Windows
-
Clone the repository:
git clone https://github.com/arvinesmaeily/ObjectDetector.git cd ObjectDetector -
Open
ObjectDetector.slnin Visual Studio 2022 -
Select your target platform (Android, iOS, Windows, or macOS)
-
Build and run the project (F5)
- Navigate to the Releases page
- Download the installer for your platform
- Follow the instruction in each release to install and run the application
Perform real-time object detection using your device's camera.
- Navigate to the Camera tab
- Grant camera permissions when prompted
- Point your camera at objects to detect them in real-time
- Toggle Detections: Use the ποΈ button to show/hide bounding boxes
- Capture: Click the capture button to save the current frame with annotations
- Monitor Performance: View FPS and detection count in the top-right corner
Tips:
- Ensure adequate lighting for better detection accuracy
- Keep objects within the camera's field of view
- Adjust detection thresholds in Settings for optimal results
Analyze static images from your device's photo library.
- Navigate to the Gallery tab
- Click Pick Image to select a photo
- Wait for processing to complete
- View detected objects with bounding boxes and labels
- Click Save to export the annotated image
Customize the app's behavior and detection parameters.
- Confidence Threshold (0.0 - 1.0): Minimum confidence for displaying detections (default: 0.25)
- IoU Threshold (0.0 - 1.0): Overlap threshold for Non-Maximum Suppression (default: 0.45)
- UI Scale Factor (0.1 - 1.0): Adjust overlay text and bounding box sizes
- Theme: Choose between System, Light, or Dark mode
- Keep Screen Alive: Prevent screen timeout during camera use
- Open Folder: Access saved detection images
| Platform | Status | Minimum Version | Hardware Acceleration |
|---|---|---|---|
| Windows | β Supported | Windows 10 (19041) | DirectML (GPU) |
| Android | β Supported | Android 8.0 (API 26) | NNAPI |
| iOS | β Supported | iOS 15.0+ | CPU (CoreML future) |
| macOS | β Supported | macOS 12.0+ (Catalyst) | CPU (CoreML future) |
- .NET 10 Runtime
- Microsoft.Maui (10.0.20)
- Microsoft.ML.OnnxRuntime.Managed (1.23.2)
- SkiaSharp (3.119.1) - Graphics rendering
- CommunityToolkit.Maui (13.0.0) - MAUI extensions
- CommunityToolkit.Maui.Camera (5.0.0) - Camera access
- Microsoft.ML.OnnxRuntime.DirectML (1.23.0) - GPU acceleration via DirectX 12
- NNAPI Support (included in ONNX Runtime)
- Camera2 API support
- External storage permissions for saving images
- AVFoundation (built-in) - Camera access
- Photos Framework (built-in) - Gallery access
| Component | Specification |
|---|---|
| CPU | Dual-core 1.5 GHz or equivalent |
| RAM | 2 GB (4 GB recommended) |
| Storage | 500 MB available space |
| Camera | 5 MP or higher (for Camera mode) |
| OS | See platform-specific versions above |
| Component | Specification |
|---|---|
| CPU | Quad-core 2.0 GHz or better |
| RAM | 4 GB or more |
| GPU | DirectX 12 compatible (Windows) or equivalent |
| Camera | 8 MP or higher with autofocus |
| Display | 1920x1080 or higher |
- Windows: Requires DirectX 12 compatible GPU (most GPUs from 2016+)
- Android: Requires NNAPI-compatible hardware (most devices from 2018+)
- iOS/macOS: CPU inference only (CoreML support planned)
The app includes two variants of the YOLOv11-medium model:
- yolo11m.onnx (Float32): Higher accuracy, larger file size (~50 MB)
- yolo11m_int8.onnx (INT8 Quantized): Faster inference, smaller size (~25 MB)
The app automatically selects the best model based on platform capabilities:
- Windows: Prefers INT8 + DirectML, falls back to Float32
- Android: Prefers INT8 + NNAPI, falls back to Float32 on CPU
- iOS/macOS: Uses Float32 on CPU
The model can detect 80 common objects including:
- People: person
- Vehicles: car, truck, bus, motorcycle, bicycle, airplane, train, boat
- Animals: dog, cat, bird, horse, sheep, cow, elephant, bear, zebra, giraffe
- Indoor Objects: chair, couch, bed, dining table, tv, laptop, cell phone, book
- Kitchen Items: bottle, cup, fork, knife, spoon, bowl, banana, apple, sandwich
- And many more...
- Ensure camera permissions are granted in app settings
- Check that no other app is using the camera
- Restart the application
- The app will automatically use NNAPI if available
- Try adjusting the confidence threshold higher to reduce detections
- Close background apps to free up resources
- Adjust the Confidence Threshold in Settings (lower = more detections)
- Adjust the IoU Threshold for overlapping detections
- Ensure adequate lighting and clear view of objects
- Android: Check Pictures/ObjectDetector folder
- Windows: Check Pictures/ObjectDetector folder
- iOS/macOS: Use Settings > Open Folder to view location
If you encounter a bug or have a suggestion, please open an issue on the repository.
When reporting detection or performance problems, please include:
- Your device/platform (e.g., "Windows 11, RTX 3060")
- App version
- Steps to reproduce the issue
- Screenshots if applicable
- History page to view saved detections
- CoreML execution provider for iOS/macOS
- Batch processing for multiple images
- Model download/update mechanism
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- ONNX Runtime - High-performance inference engine
- Ultralytics YOLOv11 - State-of-the-art object detection models
- SkiaSharp - Cross-platform 2D graphics
- .NET MAUI Community Toolkit - Essential MAUI extensions
- COCO Dataset - Training data for object detection models
This work is under an MIT License. Visit LICENSE for more info.