asus4 / onnxruntime-unity

ONNX Runtime Plugin for Unity
48 stars 2 forks source link

[Info Request] : How do use multiple execution providers for different platforms #20

Closed connorhoehninfra closed 2 months ago

connorhoehninfra commented 5 months ago

Is your feature request related to a problem? Please describe. In the past three weeks I have been doing research into Unity's CV capability. I came across Barracuda and then Sentis. Another engineer created this tutorial on building a plug-in for Unity that I reviewed. I would like to understand how to build, or utilize an existing ddl, that supports cross platform. The tutorial I mentioned previously uses Window and Nuget for the build. I am running on Mac OSX (M3). I'm unclear at this point on 1) how to create a ddl on OSX 2) how to include multiple execution providers so that Unity can leverage the GPU on desktop or mobile.

Describe the solution you'd like I would like to develop a Unity project that is focused on AR development. I want to also be able to run object detection models on multiple devices and take advantage of the hardware for the specific platform.

Describe alternatives you've considered I've been reviewing sentis and barracuda over the past two weeks. It appears that onnx execution providers are the most effective way to get performance in Unity.

Additional context I would like to develop a Unity project that is focused on AR development. I want to also be able to run object detection models on multiple devices and take advantage of the hardware for the specific platform.

asus4 commented 5 months ago

@connorhoehninfra I'm afraid but I don't have much time to write detailed tutorials on how I made multi-platform native plugins. However, pre-built native libraries and all codes are included here and in the UPM repository. You don't need to build the DLL yourself. Just build the example Unity project for iOS/Android here ↓ It should work on iOS, Android, macOS, Windows and Linux.

https://github.com/asus4/onnxruntime-unity-examples

In terms of AR development, Check out the library TextureSource, which is also used in the onnxruntime-unity-examples. It has a feature that retrieves a camera texture from the AR foundation.

stale[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.