yolo-ios-app
yolo-ios-app copied to clipboard
The model converted to coreml format always shows confidence 100
Python code
from ultralytics import YOLO
model = YOLO("yolo11n.pt") model.export(format="coreml", nms=True, imgsz=640)
👋 Hello @menghengmen, thank you for submitting a ultralytics/yolo-ios-app 🚀 Issue. To help us address your concern efficiently, please ensure you've provided the following information:
-
For bug reports:
- A clear and concise description of the bug
- A minimum reproducible example MRE that demonstrates the issue
- Your environment details (OS, Python version, package versions)
- Expected behavior vs. actual behavior
- Any error messages or logs related to the issue
-
For feature requests:
- A clear and concise description of the proposed feature
- The problem this feature would solve
- Any alternative solutions you've considered
-
For questions:
- Provide as much context as possible about your question
- Include any research you've already done on the topic
- Specify which parts of the documentation, if any, you've already consulted
In your case, it would be helpful to know:
- The steps you followed after exporting the model to CoreML format
- The exact CoreML output you're seeing that suggests a confidence of 100%
- Any modifications or additional steps you performed after conversion
Please make sure you've searched existing issues to avoid duplicates. If you need to add any additional information, please comment on this issue. 😊
An Ultralytics engineer will review and assist you soon. Thank you for helping us improve! 🚀
@menghengmen thanks for reporting this! To help us investigate, could you:
- Confirm you're using the latest
ultralyticspackage (pip install -U ultralytics) - Share the exact code you're using to run inference with the CoreML model?
- Verify if this occurs specifically when using
nms=Truevsnms=False?
The CoreML export with NMS adds non-maximum suppression layers which might affect confidence score handling. For reference, see the CoreML export documentation section on NMS integration.
@menghengmen感谢您报告此事!为了帮助我们调查,您可以:
- 确认你正在使用最新的
ultralytics软件包(`
`)
- 分享您用于使用 CoreML 模型运行推理的确切代码?
- 验证使用
nms=Truevs时是否专门发生这种情况nms=False?使用 NMS 的 CoreML 导出添加了非最大抑制层,这可能会影响置信度分数处理。有关参考,请参阅有关 NMS 集成的 CoreML 导出文档部分。 2.code is use yolo-ios-app repositories
3.when use nms = False ,load the mlmodel will crash at this // Retrieve class labels directly from the CoreML model's class labels, if available. guard let classLabels = mlRobotModel.modelDescription.classLabels as? [String] else { fatalError("Class labels are missing from the model description") }
Thanks for sharing the details! For the CoreML nms=False crash, ensure your model includes class labels by exporting with names specified:
model.export(format="coreml", nms=False, names=['class1', 'class2', ...])
When using nms=True, confidence scores are normalized during NMS processing. For implementation details, see the CoreML model metadata requirements in our docs. Let us know if you need more specific guidance! 🚀
@menghengmen It has been reported that NMS breaks on certain combinations of macOS and coremltools versions. Could you please update these to the latest versions and try again?