I have trained an ultralytics/yolov8 segmentation model (yolov8m-seg.pt) in PyTorch on a custom dataset. An iPhone app is required to be built using this model, for which the best.pt model is exported to CoreML format.
It would be great if anyone can tell me how to (properly) export the PyTorch yolov8m-seg model to CoreML in order to obtain class labels and polygons as inference results.
In Xcode, best.mlpackage does not show class labels and segmentation polygons, but as two MultiArray type objects p and var_1279. Upon some searching, the coremltools version was changed from 7.1 to 6.0.0 and nms=True was set while exporting the model. A warning message 'nms=True' is only available for Detect models like 'yolov8n.pt' is displayed during the conversion. And I still do not see class labels in the .mlpackage model.
Strangely, even if the yolov8n.pt model (without any additional training) is converted to CoreML format, Xcode shows only MultiArray outputs for the model, and no class labels.