Browse our Products
Aspose.OCR for Java 25.5.0 - Release Notes
This article contains a summary of recent changes, enhancements and bug fixes in Aspose.OCR for Java 25.5.0 (May 2025) release.
GPU version: 23.10.1
What was changed
Key | Summary | Category |
---|---|---|
OCRJAVA‑430 | Exposed control over ONNX session options for advanced users. | New feature |
OCRJAVA‑429 | Optimization: create classes for one-time InferenceSession initialization and optimize performance. | Enhancement |
Public API changes and backwards compatibility
This section lists all public API changes introduced in Aspose.OCR for Java 25.5.0 that may affect the code of existing applications.
Added public APIs:
The following public APIs have been introduced in this release:
OnnxRuntimeSessionOptions
class
Allows overriding the default ONNX runtime settings. Aspose.OCR for Java is already optimized, so modifications are recommended only for fine-tuning the library’s behavior on specific hardware.
OnnxRuntimeSessionOptions
is a static class that exposes the following properties:
Property | Type | Description |
---|---|---|
graphOptimizationLevel | GraphOptimizationLevelOnnx | Graph optimization level for the session:
|
executionMode | 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. |
Updated public APIs:
No changes.
Deprecated APIs
The following public APIs have been marked as deprecated and will be removed in 25.10.0 (October 2025) release:
RecognitionResult.recognitionAreasText
RecognitionResult.recognitionAreasRectangles
Removed public APIs:
No changes.
Examples
The code samples below illustrate the changes introduced in this release:
Change the number of threads for ONNX runtime
import com.aspose.ocr.models.*;
OnnxRuntimeSessionOptions.intraOpNumThreads = 8;
// Initialize recognition API
AsposeOCR api = new AsposeOCR();
// Add an image to OcrInput object
OcrInput input = new OcrInput(InputType.SingleImage);
input.Add("source.png");
// Recognize image
ArrayList<RecognitionResult> results = api.Recognize(input);