Browse our Products

Latest Release

What was changed

KeySummaryCategory
#OCRNET‑1272Added public region type metadata for recognized text lines and detected recognition regions.New feature
#OCRNET‑1265Improved region detection and expanded the number of detectable region types by updating the document structure detection model from aspose-ocr-document-structure-detection-v1.ocr to aspose-ocr-document-structure-detection-v2.ocr.Enhancement
#OCRNET‑1263Updated the AI module so model files are no longer downloaded automatically.Enhancement
#OCRNET‑1259Extended the Language.ExtLatin alphabet with currency symbols and added recognition of currency symbols.Enhancement

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for Python via .NET 26.9.1 that may affect the code of existing applications. See RecognitionResult API reference.

Added public APIs:

The following public APIs have been introduced in this release:

aspose.ocr.RecognitionResult.LinesResult.region_type - a new property

Returns the detected layout region type and the bounds of the region that contains the recognized text line.

aspose.ocr.RecognitionResult.RegionResult.region_type - a new property

Returns the detected layout type for a recognized region.

Updated public APIs:

No signature changes.

Table recognition has been improved to address a customer-reported issue.

Removed public APIs:

No changes.

Examples

The code samples below illustrate the changes introduced in this release:

Read region types from recognition results

import aspose.ocr

api = aspose.ocr.AsposeOcr()

input_data = aspose.ocr.OcrInput(aspose.ocr.InputType.SINGLE_IMAGE)
input_data.add("document.png")

settings = aspose.ocr.RecognitionSettings()
settings.detect_areas_mode = aspose.ocr.DetectAreasMode.MULTICOLUMN

result = api.recognize(input_data, settings)[0]

for region in result.recognition_regions_result:
    print(f"Region type: {region.region_type}")
    print(region.text_in_region)

Recognize currency symbols with ExtLatin

import aspose.ocr

api = aspose.ocr.AsposeOcr()

input_data = aspose.ocr.OcrInput(aspose.ocr.InputType.SINGLE_IMAGE)
input_data.add("price-list.png")

settings = aspose.ocr.RecognitionSettings()
settings.language = aspose.ocr.Language.EXT_LATIN

results = api.recognize(input_data, settings)

for result in results:
    print(result.recognition_text)

Recognize formulas with a local AI model

import aspose.ocr

api = aspose.ocr.AsposeOcr()

input_data = aspose.ocr.OcrInput(aspose.ocr.InputType.SINGLE_IMAGE)
input_data.add("formula.png")

model_path = "C:\Models\Some-Model-3-Vision-Latex.gguf"

results = api.recognize_formula_ai(input_data, False, model_path)

for result in results:
    print(result.result)

Detect document type with a local AI model

import aspose.ocr

api = aspose.ocr.AsposeOcr()

input_data = aspose.ocr.OcrInput(aspose.ocr.InputType.SINGLE_IMAGE)
input_data.add("invoice.png")

model_path = "C:\Models\Some-Model-3-Vision-Latex.gguf"

results = api.detect_document_type_ai(input_data, False, model_path)

for result in results:
    print(result.file_name)
    print(result.result)