From e1d742500fbfc24a08c4eb664d0111eaffc8827a Mon Sep 17 00:00:00 2001 From: Ryan Romanchuk Date: Wed, 30 Apr 2025 17:16:20 -0500 Subject: [PATCH] `ultralytics 8.3.122` Native Xcode preview of YOLO CoreML Classification models (#20437) Co-authored-by: UltralyticsAssistant Co-authored-by: Glenn Jocher --- ultralytics/__init__.py | 2 +- ultralytics/engine/exporter.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ultralytics/__init__.py b/ultralytics/__init__.py index 8f5c06ea..42a6e4cd 100644 --- a/ultralytics/__init__.py +++ b/ultralytics/__init__.py @@ -1,6 +1,6 @@ # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license -__version__ = "8.3.121" +__version__ = "8.3.122" import os diff --git a/ultralytics/engine/exporter.py b/ultralytics/engine/exporter.py index 116a47b1..a201b024 100644 --- a/ultralytics/engine/exporter.py +++ b/ultralytics/engine/exporter.py @@ -851,6 +851,9 @@ class Exporter: ct_model.license = m.pop("license") ct_model.version = m.pop("version") ct_model.user_defined_metadata.update({k: str(v) for k, v in m.items()}) + if self.model.task == "classify": + ct_model.user_defined_metadata.update({"com.apple.coreml.model.preview.type": "imageClassifier"}) + try: ct_model.save(str(f)) # save *.mlpackage except Exception as e: