Godot does not have a native tool to read pre-trained AI models in any format. This repository contains the project for a GDExtension to read and use pre-trained models stored in ONNX files.
I noticed that your code loads the onnx model and uses the CPU by default.
You can add the following code to support gpu loading model and inference, which will be much faster than cpu.
Use GPU:
OrtSessionOptionsAppendExecutionProvider_CUDA(session_options, 0);
session = new Ort::Session(env, model_path_w.c_str(), session_options);
Hope you can add some examples of doing onnx model inference in Godot, thanks !
You're right. I thank you very much for your contribution, I have been busy but these days I will work to implement it correctly. And I will try to make some examples of doing onnx model inference in Godot. 😁
I noticed that your code loads the onnx model and uses the CPU by default. You can add the following code to support gpu loading model and inference, which will be much faster than cpu.
Use GPU:
Hope you can add some examples of doing onnx model inference in Godot, thanks !