Get started with real-time segmentation on your iPhone using YOLOv11
YOLOv11 has been released, and with the official Ultralytics Swift package “YOLO,” it’s incredibly easy to incorporate it into your iPhone app.
Three attractive features of the YOLO package
Incredible simplicity
With just a few lines of code, you can use any YOLO model, so even beginners to machine learning can use it without any hesitation.
Segmentation can be done in real time
It can detect the boundaries of objects in real time, pixel by pixel, and display them as masks. This makes it easy to achieve real-time segmentation, which was previously difficult on the iPhone.
Both official and homemade models are OK
In addition to the official Ultralytics model, you can easily integrate your own original YOLOv11 model.
The fastest way to move
① Add Swift package
In Xcode, add the following URL from “File > Add Packages”.
“https://github.com/ultralytics/yolo-ios-app.git”
② Prepare a YOLOv11 model
Simply prepare an official model or a custom model and drag and drop it into your project in CoreML format (.mlpackage).
Official model
Custom Model Export
③ Inference with just a few lines of code!
③ Inference with just a few lines of code!
import YOLO
let model = try YOLO("yolo11n-seg",task: .segment) // Load model
let results = model(image) // # SwifUIImage, UIImage, CIImage, CGImage, bundle name, local path, remote URL
Real-time inference is also very easy.
YOLOCamera(
modelPathOrName: "yolo11n-seg",
task: .segment,
cameraPosition: .back
)
.ignoresSafeArea()
This allows object segmentation to be performed in real time on the camera footage.
Perfect for these applications
Real-time mask display for people and objects,
Motion analysis in sports and fitness apps
Please give this simple yet powerful library a try!
🐣
I am a freelance engineer.
For business inquiries, please contact me at
rockyshikoku@gmail.com
I provide information related to AI.
[Twitter](https://twitter.com/JackdeS11)
[Medium](https://medium.com/@rockyshikoku)
[GitHub](https://github.com/john-rocky)