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
Yolov8 in Unity #12574
Comments
Hi there! 🚀 Integrating YOLOv8 in Unity for mobile deployment isn't directly supported, but you can achieve it by exporting the model to ONNX and then utilizing a plugin or framework compatible with Unity for ONNX models, like [Unity Barracuda](https://docs.unity3d.com/Packages/com.unity.barracuda @cmilanes93). Here’s a basic example of how you might export your model to ONNX: yolo export model=yolov8n.pt format=onnx Then, load this ONNX model into Unity with Barracuda. Ensure to optimize your model for mobile deployment to achieve good FPS, such as using smaller model variants and quantization if necessary. Feel free to ask more if you need further guidance! 😊 |
Quantization? We already build our mobile app with the yolov8, but we are trying to solve the problem of fps on mobile. |
Hi! Glad to hear you've made progress with YOLOv8 on mobile. If you're still facing low FPS issues, consider the following:
Here's a quick snippet on how you might quantize in ONNX: import onnx
from onnxruntime.quantization import quantize_dynamic, QuantType
model_path = "model.onnx"
quantized_model_path = "quantized_model.onnx"
model = onnx.load(model_path)
quantized_model = quantize_dynamic(model, quantized_model_path, weight_type=QuantType.QInt8)
onnx.save(quantized_model, quantized_model_path) Implementing these can potentially help improve your app's performance. Let me know if this helps or if you need more details! |
Search before asking
Question
Hi, has any one try it Yolo v8 on mobile using unity and achive good FPS??
Additional
No response
The text was updated successfully, but these errors were encountered: