YOLOv8 Instance Segmentation โ€” Core ML

Ready-to-use Core ML conversions of Ultralytics YOLOv8 Seg for instance segmentation on Apple Silicon. The n, s, and m variants are provided as .mlpackage models for use with the CPU, GPU, and Apple Neural Engine.

These models power local computer-vision apps in Hugging Mac, an open-source platform for building AI apps, services, games, plugins, and agents on macOS.

Models

Variant Package size Best for
yolov8n-seg 7.0 MB Lowest latency and resource usage
yolov8s-seg 23.8 MB Balanced speed and accuracy
yolov8m-seg 54.8 MB Higher accuracy

Provenance and conversion

  • Source: Ultralytics assets v8.2.0
  • Task: COCO 80-class object detection and instance segmentation
  • Input size: fixed 640 ร— 640, batch size 1
  • Precision: FP16 conversion
  • NMS: not embedded; apply confidence filtering and NMS after inference

Input and output

Name Type Shape Description
image RGB image 640 ร— 640 Letterboxed model input
predictions FP32 multi-array 1 ร— 116 ร— 8400 Boxes, class scores, and mask coefficients
prototypes FP32 multi-array 1 ร— 32 ร— 160 ร— 160 Prototype masks used to reconstruct instance masks

Core ML example

from pathlib import Path

import coremltools as ct
from huggingface_hub import snapshot_download
from PIL import Image, ImageOps

root = Path(snapshot_download(
    repo_id="hugging-mac/yolov8-seg-coreml",
    allow_patterns=["yolov8n-seg.mlpackage/**"],
))
model = ct.models.MLModel(
    root / "yolov8n-seg.mlpackage",
    compute_units=ct.ComputeUnit.ALL,
)
image = ImageOps.pad(
    Image.open("image.jpg").convert("RGB"),
    (640, 640),
    color=(114, 114, 114),
)
outputs = model.predict({"image": image})
print(outputs["predictions"].shape)  # (1, 116, 8400)
print(outputs["prototypes"].shape)   # (1, 32, 160, 160)

The outputs are raw. See the Hugging Mac YOLOv8 Seg SDK for complete preprocessing, NMS, mask reconstruction, and coordinate restoration.

Integrity

Package Directory SHA-256
yolov8n-seg.mlpackage 40e067215baf17be1d4c1a63483538d0fa39c5d0f231cb63248c404e929ce9bc
yolov8s-seg.mlpackage ab06bcad128a494510f6451c22cdebb79a58db01f628e9a9a60216b246691399
yolov8m-seg.mlpackage 685049dbc644c5f9abd088aa398942b052d3256819dfe7bf27456e7136c0e6a5

License

The converted models retain the upstream Ultralytics licensing terms and are published under AGPL-3.0. Review Ultralytics licensing requirements before commercial or closed-source use. Hugging Mac is not affiliated with or endorsed by Ultralytics.

Downloads last month
10
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support