ultralytics 8.3.122 Native Xcode preview of YOLO CoreML Classification models (#20437)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Ryan Romanchuk 2025-04-30 17:16:20 -05:00 committed by GitHub
parent 3f7b8f65eb
commit e1d742500f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,6 @@
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
__version__ = "8.3.121"
__version__ = "8.3.122"
import os

View File

@ -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: