public class InferEngineFactory
Provides a centralized creation point for different inference implementations, abstracting concrete engine instantiation from consuming code. 为不同的推理实现提供集中的创建点,将对具体引擎的实例化与使用代码解耦。
This factory ensures proper initialization of backend-specific implementations following consistent patterns. 该工厂确保后端特定实现的正确初始化遵循一致的模式。
// Create an ONNX Runtime inference engine
var engine = InferEngineFactory.Create(InferenceBackend.OnnxRuntime);
// Create an OpenVINO inference engine
var openVinoEngine = InferEngineFactory.Create(InferenceBackend.OpenVINO);
InferEngineFactory | 初始化 InferEngineFactory 类的一个新实例 |
Create | Creates an inference engine instance for the specified backend type. 为指定的后端类型创建推理引擎实例 |
Equals | Determines whether the specified object is equal to the current object. (继承自 Object。) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (继承自 Object。) |
GetHashCode | Serves as the default hash function. (继承自 Object。) |
GetType | Gets the Type of the current instance. (继承自 Object。) |
MemberwiseClone | Creates a shallow copy of the current Object. (继承自 Object。) |
ToString | Returns a string that represents the current object. (继承自 Object。) |