Welcome to the Ultralytics YOLO iOS App GitHub repository! π This project leverages Ultralytics' state-of-the-art YOLO11 models to transform your iOS device into a powerful real-time inference tool for object detection. Download the app directly from the App Store or explore our guide to integrate YOLO capabilities into your own Swift applications.
This repository provides a comprehensive solution for running YOLO models on Apple platforms, enabling powerful Edge AI capabilities:
The primary iOS application allows easy real-time object detection using your device's camera or image library. You can easily test your custom CoreML models by simply dragging and dropping them into the app.
A lightweight Swift package designed for iOS, iPadOS, and macOS. It simplifies the integration and usage of YOLO-based models like YOLO11 within your own applications. Integrate YOLO models effortlessly with minimal code using SwiftUI:
// Perform inference on a UIImage
let result = model(uiImage)
// Use the built-in camera view for real-time detection
var body: some View {
YOLOCamera(
modelPathOrName: "yolo11n-seg", // Specify model name or path
task: .segment, // Define the task (detect, segment, classify, pose)
cameraPosition: .back // Choose camera (back or front)
)
.ignoresSafeArea()
}
New to YOLO on mobile or want to quickly test your custom model? Start with the main YOLOiOSApp.
- Ultralytics YOLO iOS App (Main App): The easiest way to experience YOLO detection on iOS.
Ready to integrate YOLO into your own project? Explore the Swift Package and example applications.
- Swift Package (YOLO Library): Integrate YOLO capabilities into your Swift app.
- Example Apps: See practical implementations using the YOLO Swift Package.
- Real-Time Inference: Achieve high-speed, high-accuracy object detection on iPhones and iPads using optimized CoreML models, potentially enhanced through techniques like model quantization.
- Multi-OS Support: The Swift Package is compatible with iOS, iPadOS, and macOS, enabling broad application deployment.
- Flexible Tasks: Supports object detection, with segmentation, classification, pose estimation, and oriented bounding box (OBB) detection planned for future updates.
This repository includes comprehensive unit tests for both the YOLO Swift Package and the example applications, ensuring code reliability and stability.
Tests require CoreML model files (.mlpackage
), which are not included in the repository due to their size. To run the tests with model validation:
- Set
SKIP_MODEL_TESTS = false
in the relevant test files (e.g.,YOLOv11Tests.swift
). - Download the required models from the Ultralytics releases or train your own using tools like Ultralytics HUB.
- Convert the models to CoreML format using the Ultralytics Python library's export function.
- Add the exported
.mlpackage
files to your Xcode project, ensuring they are included in the test targets. - Run the tests using Xcode's Test Navigator (Cmd+U).
If you don't have the model files, you can still run tests by keeping SKIP_MODEL_TESTS = true
. This will skip tests that require loading and running a model.
- YOLO Swift Package: Includes tests for core functionalities like model loading, preprocessing, inference, and postprocessing across different tasks.
- Example Apps: Contains tests verifying UI components, model integration, and real-time inference performance within the sample applications.
Each test directory (e.g., Tests/YOLOTests
) may include a README.md
with specific instructions for testing that component, covering:
- Required model files and where to obtain them.
- Steps for model conversion and setup.
- Overview of the testing strategy.
- Explanation of key test cases.
We warmly welcome contributions to our open-source projects! Your support helps us push the boundaries of Artificial Intelligence (AI). Get involved by reviewing our Contributing Guide and sharing your feedback through our Survey. Thank you π to all our contributors!
Ultralytics provides two licensing options to accommodate diverse use cases:
- AGPL-3.0 License: An OSI-approved open-source license ideal for academic research, personal projects, and experimentation. It promotes open collaboration and knowledge sharing. See the LICENSE file and the full AGPL-3.0 license text for details.
- Enterprise License: Tailored for commercial applications, this license allows the integration of Ultralytics software and AI models into commercial products and services without the open-source requirements of AGPL-3.0. If your scenario involves commercial use, please contact us via Ultralytics Licensing.
- For bug reports and feature requests related to this iOS project, please use GitHub Issues.
- For questions, discussions, and support regarding Ultralytics technologies, join our active Discord community!