https://github.com/ultralytics/yolo-ios-app
Ultralytics YOLO iOS App source code for running YOLO in your own iOS apps ๐
https://github.com/ultralytics/yolo-ios-app
ai app app-store coreml instance-segmentation ios ml object-detection real-time swift ultralytics xcode yolo yolo11 yolov8
Last synced: 2 days ago
JSON representation
Ultralytics YOLO iOS App source code for running YOLO in your own iOS apps ๐
- Host: GitHub
- URL: https://github.com/ultralytics/yolo-ios-app
- Owner: ultralytics
- License: agpl-3.0
- Created: 2024-02-11T16:02:29.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-10T23:18:21.000Z (4 days ago)
- Last Synced: 2025-04-11T00:20:01.202Z (4 days ago)
- Topics: ai, app, app-store, coreml, instance-segmentation, ios, ml, object-detection, real-time, swift, ultralytics, xcode, yolo, yolo11, yolov8
- Language: Swift
- Homepage: https://ultralytics.com/yolo
- Size: 279 KB
- Stars: 242
- Watchers: 4
- Forks: 45
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-yolo-object-detection - ultralytics/yolo-ios-app - ios-app?style=social"/> : Ultralytics YOLO iOS App source code for running YOLOv8 in your own iOS apps ๐. [ultralytics.com/yolo](https://ultralytics.com/yolo) (Object Detection Applications)
- awesome-yolo-object-detection - ultralytics/yolo-ios-app - ios-app?style=social"/> : Ultralytics YOLO iOS App source code for running YOLOv8 in your own iOS apps ๐. [ultralytics.com/yolo](https://ultralytics.com/yolo) (Applications)
README
# ๐ Ultralytics YOLO for iOS: App and Swift Package
[](https://github.com/ultralytics/yolo-ios-app/actions/workflows/format.yml)
[](https://discord.com/invite/ultralytics)
[](https://community.ultralytics.com/)
[](https://reddit.com/r/ultralytics)Welcome to the [Ultralytics YOLO](https://github.com/ultralytics/ultralytics) iOS App GitHub repository! ๐ This project leverages Ultralytics' state-of-the-art [YOLO11 models](https://docs.ultralytics.com/models/yolo11/) to transform your iOS device into a powerful [real-time inference](https://www.ultralytics.com/glossary/real-time-inference) tool for [object detection](https://www.ultralytics.com/glossary/object-detection). Download the app directly from the [App Store](https://apps.apple.com/us/app/idetection/id1452689527) or explore our guide to integrate YOLO capabilities into your own Swift applications.
## ๐ Repository Content
This repository provides a comprehensive solution for running YOLO models on Apple platforms, enabling powerful [Edge AI](https://www.ultralytics.com/glossary/edge-ai) capabilities:
### [**Ultralytics YOLO iOS App (Main App)**](https://github.com/ultralytics/yolo-ios-app/tree/main/YOLOiOSApp)
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](https://developer.apple.com/documentation/coreml) models by simply dragging and dropping them into the app.
### [**Swift Package (YOLO Library)**](https://github.com/ultralytics/yolo-ios-app/tree/main/Sources/YOLO)
A lightweight [Swift](https://developer.apple.com/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](https://developer.apple.com/xcode/swiftui/):
```swift
// Perform inference on a UIImage
let result = model(uiImage)
``````swift
// 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()
}
```## ๐ ๏ธ Quickstart Guide
New to YOLO on mobile or want to quickly test your custom model? Start with the main YOLOiOSApp.
- [**Ultralytics YOLO iOS App (Main App)**](https://github.com/ultralytics/yolo-ios-app/tree/main/YOLOiOSApp): 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)**](https://github.com/ultralytics/yolo-ios-app/tree/main/Sources/YOLO): Integrate YOLO capabilities into your Swift app.
- [**Example Apps**](https://github.com/ultralytics/yolo-ios-app/tree/main/ExampleApps): See practical implementations using the YOLO Swift Package.## โจ Key Highlights
- **Real-Time Inference**: Achieve high-speed, high-accuracy object detection on iPhones and iPads using optimized [CoreML models](https://docs.ultralytics.com/integrations/coreml/), potentially enhanced through techniques like [model quantization](https://www.ultralytics.com/glossary/model-quantization).
- **Multi-OS Support**: The Swift Package is compatible with iOS, iPadOS, and macOS, enabling broad application deployment.
- **Flexible Tasks**: Supports [object detection](https://docs.ultralytics.com/tasks/detect/), with [segmentation](https://docs.ultralytics.com/tasks/segment/), [classification](https://docs.ultralytics.com/tasks/classify/), [pose estimation](https://docs.ultralytics.com/tasks/pose/), and [oriented bounding box (OBB)](https://docs.ultralytics.com/tasks/obb/) detection planned for future updates.## ๐งช Testing Procedures
This repository includes comprehensive [unit tests](https://en.wikipedia.org/wiki/Unit_testing) for both the YOLO Swift Package and the example applications, ensuring code reliability and stability.
### Running Tests
Tests require CoreML model files (`.mlpackage`), which are not included in the repository due to their size. To run the tests with model validation:
1. Set `SKIP_MODEL_TESTS = false` in the relevant test files (e.g., `YOLOv11Tests.swift`).
2. Download the required models from the [Ultralytics releases](https://github.com/ultralytics/ultralytics/releases) or train your own using tools like [Ultralytics HUB](https://www.ultralytics.com/hub).
3. Convert the models to CoreML format using the [Ultralytics Python library's export function](https://docs.ultralytics.com/modes/export/).
4. Add the exported `.mlpackage` files to your [Xcode](https://developer.apple.com/xcode/) project, ensuring they are included in the test targets.
5. 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.
### Test Coverage
- **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.### Test Documentation
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.## ๐ก Contribute
We warmly welcome contributions to our open-source projects! Your support helps us push the boundaries of [Artificial Intelligence (AI)](https://www.ultralytics.com/glossary/artificial-intelligence-ai). Get involved by reviewing our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) and sharing your feedback through our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). Thank you ๐ to all our contributors!
[](https://github.com/ultralytics/ultralytics/graphs/contributors)
## ๐ License
Ultralytics provides two licensing options to accommodate diverse use cases:
- **AGPL-3.0 License**: An [OSI-approved](https://opensource.org/license/agpl-v3) open-source license ideal for academic research, personal projects, and experimentation. It promotes open collaboration and knowledge sharing. See the [LICENSE](https://github.com/ultralytics/yolo-ios-app/blob/main/LICENSE) file and the full [AGPL-3.0 license text](https://www.gnu.org/licenses/agpl-3.0.en.html) 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](https://www.ultralytics.com/license).## ๐ค Contact
- For bug reports and feature requests related to this iOS project, please use [GitHub Issues](https://github.com/ultralytics/yolo-ios-app/issues).
- For questions, discussions, and support regarding Ultralytics technologies, join our active [Discord](https://discord.com/invite/ultralytics) community!