Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporating YOLOv8 Pose ONNX model #13

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

pbanavara
Copy link

This is the PR for incorporating the YOLO v8 pose detection model natively using the ONNX model on iOS.

@glenn-jocher
Copy link
Member

@pbanavara hey there! 👋

Thanks for your effort and interest in integrating the YOLOv8 pose ONNX model with iOS. It's great to see such enthusiasm within our community. For this kind of integration, you'd typically need to ensure that the ONNX model is fully compatible with the iOS platform, which may require using ONNX Runtime or Core ML.

A simple outline to get started could be:

  1. Convert the YOLOv8 ONNX model to Core ML using ONNX-CoreML tools (if not directly using ONNX Runtime).
  2. Incorporate the converted model into your iOS app, ensuring you handle the input and output correctly.

Remember, performance and compatibility can vary, so testing is key. For more detailed guidance on working with ONNX models, you might want to check out the Ultralytics Docs. However, since specifics can get quite technical and platform-dependent, I recommend reaching out on specialized forums or platforms for iOS and ONNX integration for more tailored advice.

Keep up the great work, and we look forward to seeing what you achieve! 🚀

@pbanavara
Copy link
Author

Hi @glenn-jocher This ONNX model is compatible with iOS and I have tested the same. Listing down the instructions for testing. Is there an issue with using the Cocoapods architecture for this app ? I will try to get the CoreML conversion working. As per the ONNX repo, there is no supported tool to convert from ONNX to CoreML, will have to do this directly from Apple CoreMLTools which has support for Pytorch models. So it's back to square one :)

  • clone/fork this repo
  • Download the yolov8_pose_e2e model from the official onnx link
  • Run the yolov8_pose_e2e.py command with a test image to download the full onnx model.
  • Include the model in the build settings of this app by copying the same.
  • Build and run

@glenn-jocher
Copy link
Member

Hey @pbanavara! 🌟

Great to hear the ONNX model works well with iOS, and thanks for sharing your testing steps!

Regarding the use of Cocoapods, it's generally a sound approach for managing library dependencies in iOS projects. If it suits your project structure and you're comfortable managing dependencies through it, there shouldn't be an issue.

For the CoreML conversion, indeed, direct conversion tools from ONNX to CoreML might be limited, but using Apple's CoreMLTools with a PyTorch model as an intermediary step is a smart workaround. It might add an extra step, but if it bridges the compatibility gap, it's worth it.

For clarity to anyone following this:

  1. Convert your PyTorch model to ONNX.
  2. Use Apple's CoreMLTools to convert this ONNX model to CoreML format.

This method gives you the flexibility of PyTorch's extensive model ecosystem and the performance optimizations CoreML offers on iOS devices.

Keep pushing forward, and don't hesitate to reach out if you run into any hurdles! Your journey contributes to the broader knowledge base of our community. 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants