Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.OCR for .NET leverages ONNX Runtime as its machine learning engine. While its communication with ONNX Runtime is optimized for the majority of common environments, the library’s behavior can be fine-tuned for specific hardware.
ONNX runtime is configured through Aspose.OCR.OnnxRuntimeSessionOptions
static class. This class exposes the following properties:
Property | Type | Description |
---|---|---|
GraphOptimizationLevel |
Aspose.OCR.GraphOptimizationLevelOnnx |
Graph optimization level for the session:
|
ExecutionMode |
Aspose.OCR.ExecutionModeOnnx |
Execution mode for the session:
|
IntraOpNumThreads |
int |
Number of threads for a single operations. |
InterOpNumThreads |
int |
Number of threads for running multiple operations in parallel. If sequential execution (ExecutionModeOnnx.ORT_SEQUENTIAL ) is enabled in ExecutionMode property, this value is ignored. |
For technical details, refer to ONNX Runtime documentation.
Changing the number of threads for ONNX runtime:
Aspose.OCR.OnnxRuntimeSessionOptions.IntraOpNumThreads = 8;
// Initialize recognition API
Aspose.OCR.AsposeOcr recognitionEngine = new Aspose.OCR.AsposeOcr();
// Add images to OcrInput object
Aspose.OCR.OcrInput input = new Aspose.OCR.OcrInput(Aspose.OCR.InputType.SingleImage);
input.Add("source1.png");
input.Add("source2.jpg");
// Recognize image
Aspose.OCR.OcrOutput results = recognitionEngine.Recognize(input);
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.