![]() |
iVS3D v2.0.0
|
Factory class for creating NeuralNet instances. This abstracts from the underlying inference engine (e.g., ONNX Runtime). More...
#include <NeuralNetFactory.h>
Static Public Member Functions | |
| static tl::expected< NeuralNetPtr, NeuralError > | create (const std::string &modelPath, bool useGpu=false, int gpuId=0) |
| Create a NeuralNet instance from a model file. | |
Factory class for creating NeuralNet instances. This abstracts from the underlying inference engine (e.g., ONNX Runtime).
|
static |
Create a NeuralNet instance from a model file.
| modelPath | The path to the model file (e.g., ONNX model). |
| useGpu | Whether to use CUDA for inference (default: false). |
| gpuId | The GPU ID to use if CUDA is enabled (default: 0). |
This method loads the model from the specified path and creates an instance of NeuralNet. If the model cannot be loaded or the creation fails, an error object is returned.