ultralytics / yolo-ios-app

Ultralytics YOLO iOS App source code for running YOLOv8 in your own iOS apps 🌟
https://ultralytics.com/yolo
GNU Affero General Public License v3.0
164 stars 29 forks source link

Custom Model export for simulation app #65

Open bibekdhakal opened 1 week ago

bibekdhakal commented 1 week ago

Do we need a specific output format to detect the object using the same code base? I tried importing my custom model to the application and was able to import the .mlpackage as well, but unable to detect anything.

Model conversion

from ultralytics import YOLO import coremltools as ct import os

model = YOLO('./corrosionModel.pt') model.export(format="coreml", data="./data.data.yaml",)

Initially, I had an issue referring to the class label missing, but I fixed the issue by using names from additional metadata as class labels. I was able to build the application, but it detected nothing.

Did I miss something?

Thanks

UltralyticsAssistant commented 1 week ago

👋 Hello @bibekdhakal, thank you for opening this ultralytics/yolo-ios-app 🚀 Issue. To help us address your concern more efficiently, please make sure you've provided the following information:

  1. For bug reports:
    • A clear and concise description of the issue you're experiencing
    • A minimum reproducible example (MRE) see here that demonstrates the problem
    • Details about your environment, such as iOS version and device details
    • The expected behavior vs. the actual behavior you're facing
    • Any error messages or logs related to the issue

👏 Thank you for mentioning that you managed to import the .mlpackage and addressed the class label issue. It sounds like the conversion part is mostly working, but let's dig deeper to understand why detection isn't happening.

  1. Have you verified the following?
    • Ensured the input size for the model matches the expected input size in the app
    • Double-checked that the class labels are correctly set in your Core ML model

Feel free to update this issue with any additional info, and please ensure you've checked similar issues to avoid duplicates. An Ultralytics engineer will review your issue soon to provide further assistance. Thank you for contributing and helping us improve! 🤖✨

pderrenger commented 1 week ago

@bibekdhakal ensure that your input image dimensions match those used during training and that the model's input and output specifications align with your application requirements. Additionally, verify that the class labels are correctly mapped in your application. If the issue persists, try testing the model with a simple script to confirm its functionality outside the app environment.