pub trait InferenceEngine:
Send
+ Sync
+ Debug {
type Input: Send + Sync + Debug;
type Output: Send + Sync + Debug;
// Required methods
fn infer(&self, input: &Self::Input) -> Result<Self::Output, OCRError>;
fn engine_info(&self) -> String;
// Provided method
fn validate_inference_input(
&self,
_input: &Self::Input,
) -> Result<(), OCRError> { ... }
}Expand description
Trait for inference engine operations.
This trait handles running the actual model inference, whether through ONNX Runtime, TensorRT, PyTorch, or other backends.
Required Associated Types§
Required Methods§
Sourcefn engine_info(&self) -> String
fn engine_info(&self) -> String
Get information about the inference engine.
§Returns
String describing the inference engine (model type, backend, etc.)