A real-time object detection app for iOS using YOLO (You Only Look Once) and CoreML. This app demonstrates object detection using the camera feed with bounding boxes and confidence scores.
- Real-time object detection using YOLO model
- Camera preview with live detection boxes
- Confidence scores for each detection
- Non-Maximum Suppression (NMS) to eliminate overlapping detections
- Configurable parameters:
- Confidence threshold
- IoU threshold for NMS
- Minimum and maximum box sizes
- Support for 80 COCO classes
- Debug logging for coordinate transformations
- iOS 15.0+
- Xcode 13.0+
- Swift 5.5+
- CoreML
- Vision framework
- Clone the repository
- Open
yolodemo.xcodeprojin Xcode - Build and run on a compatible iOS device
- Launch the app
- Grant camera permissions when prompted
- Point the camera at objects to detect
- Adjust detection parameters using the sliders:
- Confidence threshold (0.1-1.0)
- IoU threshold (0.1-1.0)
- Min box size (0-100)
- Max box size (100-1000)
- Uses YOLO model converted to CoreML format
- Input size: 640x640
- Output: Bounding boxes with confidence scores for 80 COCO classes
- Properly handles aspect ratio preservation
- Scales coordinates from model space (640x640) to screen space
- Accounts for image scaling and centering offsets
- Eliminates overlapping detections
- Uses IoU (Intersection over Union) threshold
- Preserves highest confidence detection when overlaps occur
The app includes detailed debug logging for:
- Model loading and configuration
- Coordinate transformations
- Detection processing
- NMS results
This project is available under the MIT license. See the LICENSE file for more info.