To package trained Onnx models with a WPF .Net Core 3.1 app, I'm wondering if there are any difference to these two methods: Microsoft.ML.OnnxRuntime and Microsoft.AI.MachineLearning (WinML)? OnnxRuntime seems to be easier to implement with C# while WinML's samples for desktop apps are in C++.
Are there any drawbacks to deploy Onnx models with OnnxRuntime for public users? Or does it require a specific environment for inference?
Why is there a need for Microsoft to maintain two different methods if they are essentially the same?
Thanks for the great question. Using Microsoft.AI.MachineLearning gives you high-performance and reliable hardware acceleration for ML inferences on any Windows devices. The ONNX Runtime is focused on being a cross-platform inferencing engine. Microsoft.AI.MachineLearning actually utilizes the ONNX Runtime for optimized performance on CPUs, and the DirectML backend for optimized acceleration with GPUs. This diagram illustrates the full stack of Windows ML.