Ultralytics YOLO27: Join the waitlist.

CoreML Export for YOLO26 Models

Apple ships dedicated AI silicon — the Neural Engine — in every modern iPhone, iPad, and Mac, and CoreML is Ultralytics' supported path for deploying models to it today. Exporting Ultralytics YOLO26 models to CoreML turns a trained .pt checkpoint into a native .mlpackage that runs all seven YOLO tasks on-device at low latency, with no network connection and no data leaving the device.

Run YOLO on the Apple Neural Engine today with the official mobile apps

The official Ultralytics YOLO iOS SDK and Flutter plugin run CoreML exports on the Apple Neural Engine out of the box — real-time camera inference, single-image prediction, and automatic model download for all seven YOLO26 tasks, including Depth. For Android NPU deployment, see the Qualcomm QNN integration.

Official mobile input sizes

Export classification models at imgsz=224. Export detect, segment, semantic, depth, pose, and OBB models at imgsz=640. This 224/640 standard is shared by the official CoreML, LiteRT, and QNN mobile assets.

Apple's new Core AI format

Apple has introduced the new Core AI framework and .aimodel format for the iOS 27 and macOS 27 generation, and Ultralytics exports it with format="coreai". CoreML remains the default format for the Ultralytics iOS and Flutter SDKs, which load Core AI as an opt-in on iOS 27 devices, and the format for broader Apple device compatibility.



Watch: How to Export Ultralytics YOLO26 to CoreML with INT8 Quantization | Apple Deployment | iOS/MacOS 🍎

What is CoreML?#

Apple CoreML deployment pipeline

CoreML (styled "Core ML" by Apple) is Apple's on-device machine learning framework. It loads models in the modern ML Program format — the .mlpackage bundle the Ultralytics exporter produces — and schedules them across the device's CPU, GPU, and Apple Neural Engine (ANE), the dedicated NPU in every Apple-silicon chip. Because everything runs locally, inference works offline, adds no network latency, and keeps user data on the device.

CoreML integrates directly with Apple's Vision framework, which handles image scaling and orientation on the way into the model — this is how the Ultralytics iOS SDK feeds camera frames to YOLO with effectively zero preprocessing cost.

Why Export YOLO26 to CoreML?#

  • Neural Engine speed: CoreML schedules supported operations on Apple's Neural Engine for low-latency on-device inference. See the physical-device table below, and benchmark your exact export on your target hardware.
  • Choose the output: Default exports leave NMS to your app. Use nms=True to embed NMS, or nms=False for YOLO26's NMS-free head.
  • Private and offline: All computation stays on the device — no cloud round-trips, no API keys, full data privacy.
  • One export, the whole ecosystem: The same .mlpackage runs on iOS, iPadOS, macOS, watchOS, tvOS, and visionOS, and powers the official Ultralytics iOS SDK and Flutter plugin.

Measured Performance#

End-to-end single-image inference for the standardized v8.3.0 YOLO26n INT8 CoreML assets on an iPhone 17 Pro with 12 GB memory and iOS 27.0.1. Its A19 Pro has a 6-core CPU (2 Performance and 4 Efficiency cores), 6-core GPU with Neural Accelerators, and 16-core Neural Engine. Each cell shows the total time (preprocessing + inference + postprocessing, excluding annotation) with the per-stage split beneath it. On iOS, Vision performs input scaling inside the inference request, so preprocessing is reported as 0 and its cost is included in inference.

ModelTasksize
(pixels)
CPU
Core ML .cpuOnly
(ms)
CPU + ANE preferred
Core ML .cpuAndNeuralEngine
(ms)
YOLO26nDetect6408.8
0.0 / 8.8 / 0.0
3.7
0.0 / 3.7 / 0.0
YOLO26n-segSegment64012.3
0.0 / 11.7 / 0.6
4.9
0.0 / 4.3 / 0.6
YOLO26n-semSemantic6409.3
0.0 / 9.0 / 0.3
4.4
0.0 / 4.1 / 0.3
YOLO26n-depthDepth64026.0
0.0 / 25.1 / 1.0
5.5
0.0 / 4.7 / 0.9
YOLO26n-clsClassify2244.1
0.0 / 4.1 / 0.0
2.0
0.0 / 1.9 / 0.0
YOLO26n-posePose64012.0
0.0 / 12.0 / 0.0
4.0
0.0 / 4.0 / 0.0
YOLO26n-obbOBB64010.7
0.0 / 10.7 / 0.0
3.9
0.0 / 3.9 / 0.0
  • The exact v8.3.0 release assets declare 224×224 inputs for classification and 640×640 for every other task.
  • On iOS 27.0.1, .cpuOnly inference of the l and x depth, pose, and OBB models crashes inside Core ML's CPU kernels (EXC_BAD_ACCESS in libBNNS); the same models run with .cpuAndNeuralEngine, and every other task and size runs on the CPU.
  • Speed values are single-image burst latencies — the mean of 15 runs after 3 warmup runs on bus.jpg, measured through the iOS SDK's per-stage timing via the Flutter plugin's benchmark harness in profile mode (optimized native code). CPU/accelerator order alternated between tasks in one sequential sweep. CPU rows request Core ML .cpuOnly; CPU + ANE preferred rows request .cpuAndNeuralEngine, with final operation placement controlled by Core ML. Sustained real-time camera operation runs higher because it includes the capture and scaling pipeline plus thermal settling. A historical pre-standard camera sweep measured 11.3 ms/frame for YOLO26n detect and 16.5 ms/frame for YOLO26n Depth on the same device — see the iOS SDK performance doc for steady-state profiling.
  • Compare the Android CPU/GPU results in the LiteRT integration and Snapdragon NPU results in the Qualcomm QNN integration.

Supported Tasks#

CoreML export supports all seven Ultralytics tasks. Semantic segmentation and depth estimation are available only with YOLO26, the only family that ships those heads.

TaskYOLOv8YOLO11YOLO26
Detect✅✅✅
Segment✅✅✅
Semantic❌❌✅
Depth❌❌✅
Classify✅✅✅
Pose✅✅✅
OBB✅✅✅

Exporting YOLO26 Models to CoreML#

Installation#

To install the required package, run:

Installation
# Install the required package for YOLO26
pip install ultralytics

The coremltools converter is installed automatically on first export. Export runs on macOS or x86 Linux; for detailed instructions and best practices, check our installation guide and the Common Issues guide.

Usage#

The CoreML format supports the Export, Predict, and Validate modes. Inference and validation with CoreML run on macOS only. Export your model, then load the exported model to run inference or validate its accuracy.

Export
from ultralytics import YOLO

# Load a YOLO26 model
model = YOLO("yolo26n.pt")

# Export to CoreML with INT8 weight quantization, matching the official app models
model.export(format="coreml", quantize=8, imgsz=640)  # use imgsz=224 for classification
Predict
from ultralytics import YOLO

# Load the exported CoreML model (macOS)
model = YOLO("yolo26n.mlpackage")

# Run inference
results = model("https://ultralytics.com/images/bus.jpg")
Validate
from ultralytics import YOLO

# Load the exported CoreML model (macOS)
model = YOLO("yolo26n.mlpackage")

# Validate accuracy on the COCO8 dataset
metrics = model.val(data="coco8.yaml")

Export Arguments#

ArgumentTypeDefaultDescription
formatstr'coreml'Target format for the exported model, defining compatibility with various deployment environments.
imgszint or tuple640Desired image size for the model input. Can be an integer for square images or a tuple (height, width) for specific dimensions.
quantizeint or strNoneQuantization precision: 16 (FP16), 8 or "w8a16" (identical: 8-bit k-means palettized weights with FP16 compute), or 32 or unset (FP32). NMS ML Programs use FP16 (for Xcode preview, and required by segment and pose); pass 32 to override on detect. Replaces the deprecated half/int8 flags.
nmsbool, optionalNoneSelect raw output (None, default), embedded NMS (True), or the NMS-free head (False). Embedded NMS supports detect, segment and pose with dynamic=False.
dynamicboolFalseAllows dynamic input sizes. Not supported for classification or RT-DETR models, and cannot be combined with nms=True.
batchint1Specifies export model batch inference size or the max number of images the exported model will process concurrently in predict mode. Values above 1 require dynamic=True.
devicestrNoneSpecifies the device for exporting: GPU (device=0), CPU (device=cpu), MPS for Apple silicon (device=mps).

For more details about the export process, visit the Ultralytics documentation page on exporting.

Targeting the Neural Engine#

CoreML chooses hardware via MLModelConfiguration.computeUnits. The Ultralytics iOS SDK defaults to .cpuAndNeuralEngine on iOS 16+ rather than .all: in a real-time camera app the GPU is already busy compositing the preview and overlays, so excluding it avoids contention and frame-time jitter while the ANE does the heavy lifting. Pin .cpuOnly only for compatibility testing — the table above shows what it costs.

Running a CoreML model from Python on a Mac host (via Ultralytics or coremltools) follows the same rule: Ultralytics loads with ComputeUnit.CPU_AND_NE (macOS 13+, falling back to CPU_ONLY on older macOS), keeping inference on the Neural Engine (~3× faster than CPU). This also avoids a current macOS host limitation where the default ComputeUnit.ALL / CPU_AND_GPU — which add the GPU/MPSGraph compile path — abort the process with an Error: MLIR pass manager failed assertion on coremltools 9.x. RT-DETR models are the exception: they load with ComputeUnit.ALL, because their FP16 accuracy drops on the Neural Engine alone.

Deploying Exported YOLO26 CoreML Models#

The fastest path is the official Ultralytics YOLO iOS SDK, the same Swift package that powers the Ultralytics iOS app and the Flutter plugin. It resolves official model names automatically, downloads and caches the .mlpackage, and returns fully decoded results:

import UltralyticsYOLO

// Loads the official INT8 model (downloaded and cached on first use), then runs inference
let yolo = YOLO("yolo26n", task: .detect) { result in
    if case .success(let model) = result {
        let results = model(uiImage)  // boxes, labels, confidences, timing
    }
}

For camera apps, drop in the SDK's YOLOView for real-time inference with native overlays, or use the Flutter plugin for cross-platform apps that share one codebase with Android.

Integrating a raw .mlpackage yourself is also straightforward with Apple's stack — load it with MLModel, wrap it in a VNCoreMLRequest, and feed images through VNImageRequestHandler. These resources cover the details:

Ship the model either embedded in the app bundle (instant availability, ideal for nano/small models) or downloaded on first run and cached (smaller binary, easy model updates). The official apps combine both approaches: default nano models are bundled for immediate use, while larger variants download on demand and are cached locally.

  1. Train your model with Ultralytics Train mode, or start from the official YOLO26 weights
  2. Export with model.export(format="coreml", quantize=8, imgsz=640) on macOS or x86 Linux (imgsz=224 for classification)
  3. Verify accuracy with model.val() on a Mac, and profile with an Xcode Core ML Performance Report on your target device
  4. Deploy with the iOS SDK, the Flutter plugin, or your own Vision integration, targeting .cpuAndNeuralEngine

Summary#

In this guide, you learned how to export Ultralytics YOLO26 models to CoreML's .mlpackage format, quantize them for the Apple Neural Engine, and deploy them at single-digit-millisecond latencies — either through the official iOS SDK and Flutter plugin or your own Vision integration.

FAQ#

  • Run model.export(format="coreml", imgsz=640) in Python or yolo export model=yolo26n.pt format=coreml imgsz=640 from the CLI on macOS or x86 Linux. Use imgsz=224 for classification and add quantize=8 to match the official app models. The export produces a yolo26n.mlpackage ML Program ready for Xcode, the iOS SDK, or the Flutter plugin.

  • Use nms=True if your app needs detections with NMS included. The default nms=None exports raw one-to-many outputs for your app to process; nms=False selects YOLO26's NMS-free head. Embedded NMS supports detect, segment and pose with static shapes; other tasks keep their native outputs.

  • The official Ultralytics app models ship as INT8, which minimizes download size and runs at the speeds in the table above. quantize=16 (FP16) is a conservative alternative with essentially no accuracy loss. Validate your exact export with model.val() on a Mac before shipping.

  • Set MLModelConfiguration.computeUnits = .cpuAndNeuralEngine (the iOS SDK default on iOS 16+). Avoid .all in camera apps — the GPU is busy compositing the preview, and scheduling inference there causes frame-time jitter. Confirm placement with an Xcode Core ML Performance Report.

  • Yes, on macOS: yolo predict model=yolo26n.mlpackage source=image.jpg and yolo val model=yolo26n.mlpackage data=coco8.yaml work like any other format. CoreML execution requires Apple hardware, so these modes are unavailable on Linux and Windows.

  • Use the official Ultralytics YOLO iOS SDK (Swift Package) or the Flutter plugin. Both load official models by name with automatic download and caching, run them on the Neural Engine, and include complete real-time camera UIs — the measured performance table above was produced with exactly this stack.

Comments13

Ask a question, share your results, or help someone else.

  1. Afool4UAfool4UGitHub

    Hello! I have trouble when I tried to export yolo11n.pt to coreml model with tracking. for example, the exist tracking method is like this:

    # use YOLO tracking
    results = yolo_model.track(frame, persist=True, verbose=False)

    And I've export pt format and reloaded the new coreml format model like this:

    model.export(format='coreml', nms=True, half=False)
    model = ct.models.MLModel('yolo11n.mlpackage')

    But when I tried to make a tracking on my camera stream, it seems that object 'model' have no attribute named 'track'. So how could I use tracking by a coreml format model? It's very important to me because the coreml model works well on my macbook.

  2. SebastianxhjSebastianxhjGitHub

    I used the example python code you guys gave. Why does output output confidence and coordination after converting my target detection model to mlpackage format. is it normal to not return processed images? Or is there something wrong with my export process.

    1. Glenn JocherGlenn JocherUltralytics

      @taeja7 the CoreML export returns raw detection outputs (confidence, coordinates) rather than processed images by design. This is normal behavior, as post-processing like bounding box rendering is typically handled within the application layer after inference. For implementation guidance, see the CoreML deployment documentation on handling model outputs in Apple apps.

  3. smadsenjcsmadsenjcGitHub

    I have a trained model that is doing very well in Python, but once I convert it to CoreML .mlpackage format and run inference in Swift, the results are garbage on the same images.

    If I export with nms=True, I get multiple overlapping bounding boxes back, similar-ish to when no NMS is done. The number of clusters matches the objects I expect, and they're kind of relatively positioned correctly, although the boxes themselves are too large and clustered in the wrong location. The predicted labels are right.

    If I export with nms=False, I get a different result back from VNCoreMLRequest: a single VNCoreMLFeatureValueObservation instead of an array of VNRecognizedObjectObservation.

    I've used both coremltools 8.0 and 8.2. If I run inference in Python using the CoreML model, it's fine (with nms=False; True fails).

    This was working back in November, but I got side-tracked with other work. I haven't touched the model.

    1. Glenn JocherGlenn JocherUltralytics

      @smadsenjc for CoreML inference discrepancies between Python and Swift, ensure you're handling NMS parameters correctly in your Swift implementation. The CoreML export with nms=True requires explicit IOU and confidence threshold inputs during inference - these must match your Python training parameters. We recommend verifying your Swift preprocessing matches Ultralytics' RGB channel ordering and normalization (scale=1/255, bias=[0,0,0]). For direct assistance with Apple's Vision framework implementation, refer to Apple's CoreML integration guide linked in our documentation.

  4. CharanPrasadKCharanPrasadKGitHub

    When I am Converting the Yolo .pt model to coreml model , mlpackage is creating and when I am checking it in the xcode the class labels are missing. For the core ml models in ultralytics github page class labels are there. If its solved i can test my custom yolo models. Thank you.

    1. Glenn JocherGlenn JocherUltralytics(edited)

      @CharanPrasadK it seems the class labels are not being included in your CoreML export. Ensure that your model is correctly labeled during training and export by checking the names attribute in the model. If the issue persists, please verify that you're using the latest ultralytics package. For further details, refer to the CoreML export documentation. Let us know if you need additional assistance!

  5. ChristalZhuChristalZhuGitHub

    Still the same problem, this is the result of running in the terminal: PyTorch: starting from '/Users/doublepeng/Desktop/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) ((1, 37, 8400), (1, 32, 160, 160)) (6.5 MB)

    CoreML: starting export with coremltools 7.2... CoreML: WARNING ⚠️ 'nms=True' is only available for Detect models like 'yolov8n.pt'. Tuple detected at graph output. This will be flattened in the converted model. Converting PyTorch Frontend ==> MIL Ops: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌| 679/681 [00:00<00:00, 8273.25 ops/s] Running MIL frontend_pytorch pipeline: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 157.94 passes/s] Running MIL default pipeline: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 78/78 [00:00<00:00, 82.56 passes/s] Running MIL backend_mlprogram pipeline: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:00<00:00, 160.71 passes/s] CoreML: export success ✅ 7.7s, saved as '/Users/doublepeng/Desktop/best.mlpackage' (6.4 MB)

    Export complete (8.1s) Results saved to /Users/doublepeng/Desktop Predict: yolo predict task=segment model=/Users/doublepeng/Desktop/best.mlpackage imgsz=640 Validate: yolo val task=segment model=/Users/doublepeng/Desktop/best.mlpackage imgsz=640 data=/home/yujialin/Documents/xiaotong/corn/data/corn.yaml Visualize: https://netron.app In the run mlpackage file, the class label is still missing in General, and there is no preview. Since I am only doing corn segmentation, if possible, can I send you my .pt file?

    1. Glenn JocherGlenn JocherUltralytics

      @ChristalZhu hello,

      Thank you for providing the detailed output from your terminal. It looks like the CoreML export process completed successfully, but you're experiencing issues with missing class labels and preview in the .mlpackage file.

      To assist you better, could you please confirm the following:

      1. Are you using the latest versions of torch and ultralytics? If not, please upgrade and try the export process again.
      2. Could you provide a minimum reproducible example of your code? This will help us understand the context and reproduce the issue on our end. You can refer to our minimum reproducible example guide for more details.

      Regarding your .pt file, we cannot accept direct file submissions. However, you can share the relevant code snippets and configurations you used for training and exporting the model.

      Here's a quick example of how to export a YOLOv8 model to CoreML and run inference:

      from ultralytics import YOLO
      
      # Load the YOLOv8 model
      model = YOLO("yolov8n.pt")
      
      # Export the model to CoreML format
      model.export(format="coreml")  # creates 'yolov8n.mlpackage'
      
      # Load the exported CoreML model
      coreml_model = YOLO("yolov8n.mlpackage")
      
      # Run inference
      results = coreml_model("https://ultralytics.com/images/bus.jpg")

      For more detailed instructions, you can visit our CoreML integration guide.

      Looking forward to your response so we can help resolve this issue.

  6. ChristalZhuChristalZhuGitHub

    我按照https://harshavardhanyellanki.github.io/YOLOV8_GUI/tasks/segmentation/的方法,将我自己训练的分割模型进行导出成mlpackage,但是出现了问题就是打开这个mlpackage之后,缺少class label文件和缺少了preview,请问这个有什么办法解决,如果可以的话,麻烦发送到我的email账号:wenpeng.zhu@foxmail.com万分感谢。 I followed the method at https://harshavardhanyellanki.github.io/YOLOV8_GUI/tasks/segmentation/ to export the segmentation model I trained myself into mlpackage, but the problem is that after opening this mlpackage, the class label file and the preview are missing. Is there any way to solve this problem? If possible, please send it to my email account: wenpeng.zhu@foxmail.com. Thank you very much.

    1. Paula DerrengerPaula DerrengerUltralytics

      Hello @ChristalZhu,

      Thank you for reaching out and providing details about the issue you're facing with exporting your YOLOv8 segmentation model to CoreML. Let's work together to resolve this.

      Firstly, please ensure that you are using the latest versions of torch and ultralytics. You can update them using the following commands:

      pip install --upgrade torch ultralytics

      If the issue persists, could you please provide a minimum reproducible code example? This will help us better understand the problem and investigate a solution. You can refer to our guide on creating a minimum reproducible example here: Minimum Reproducible Example.

      Regarding the missing class label file and preview in the .mlpackage, this can sometimes occur if the export process does not include all necessary metadata. Here is a Python example to ensure the export includes all required components:

      from ultralytics import YOLO
      
      # Load your trained YOLOv8 model
      model = YOLO("path/to/your/custom_model.pt")
      
      # Export the model to CoreML format
      model.export(format="coreml", nms=True)  # Ensure NMS is included for proper detection

      After exporting, you can manually check the .mlpackage to ensure it contains the necessary class labels and preview files. If they are still missing, please let us know, and we can further investigate.

      For more detailed instructions on exporting to CoreML, you can visit our documentation here: CoreML Export Guide.

      Feel free to share any additional details or errors you encounter. We're here to help!

    2. ChristalZhuChristalZhuGitHub

      Still the same problem, this is the result of running in the terminal: PyTorch: starting from '/Users/doublepeng/Desktop/best.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) ((1, 37, 8400), (1, 32, 160, 160)) (6.5 MB)

      CoreML: starting export with coremltools 7.2... CoreML: WARNING ⚠️ 'nms=True' is only available for Detect models like 'yolov8n.pt'. Tuple detected at graph output. This will be flattened in the converted model. Converting PyTorch Frontend ==> MIL Ops: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌| 679/681 [00:00<00:00, 8273.25 ops/s] Running MIL frontend_pytorch pipeline: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 157.94 passes/s] Running MIL default pipeline: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 78/78 [00:00<00:00, 82.56 passes/s] Running MIL backend_mlprogram pipeline: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 12/12 [00:00<00:00, 160.71 passes/s] CoreML: export success ✅ 7.7s, saved as '/Users/doublepeng/Desktop/best.mlpackage' (6.4 MB)

      Export complete (8.1s) Results saved to /Users/doublepeng/Desktop Predict: yolo predict task=segment model=/Users/doublepeng/Desktop/best.mlpackage imgsz=640
      Validate: yolo val task=segment model=/Users/doublepeng/Desktop/best.mlpackage imgsz=640 data=/home/yujialin/Documents/xiaotong/corn/data/corn.yaml
      Visualize: https://netron.app In the run mlpackage file, the class label is still missing in General, and there is no preview. Since I am only doing corn segmentation, if possible, can I send you my .pt file?

    3. Paula DerrengerPaula DerrengerUltralytics

      Hello @ChristalZhu,

      Thank you for providing the detailed output from your terminal. It looks like the CoreML export process completed successfully, but you're encountering issues with missing class labels and preview in the .mlpackage.

      To address this, please ensure you are using the latest versions of torch and ultralytics. You can update them using the following commands:

      pip install --upgrade torch ultralytics

      If the issue persists, could you please provide a minimum reproducible code example? This will help us better understand the problem and investigate a solution. You can refer to our guide on creating a minimum reproducible example here: Minimum Reproducible Example.

      Regarding the missing class label file and preview in the .mlpackage, this can sometimes occur if the export process does not include all necessary metadata. Here is a Python example to ensure the export includes all required components:

      from ultralytics import YOLO
      
      # Load your trained YOLOv8 model
      model = YOLO("path/to/your/custom_model.pt")
      
      # Export the model to CoreML format
      model.export(format="coreml", nms=True)  # Ensure NMS is included for proper detection

      After exporting, you can manually check the .mlpackage to ensure it contains the necessary class labels and preview files. If they are still missing, please let us know, and we can further investigate.

      For more detailed instructions on exporting to CoreML, you can visit our documentation here: CoreML Export Guide.

      Feel free to share any additional details or errors you encounter. We're here to help! 😊