ITextRecognizer<T>
Interfaces · AiDotNet.Document.Interfaces
Interface for text recognition models that read text from cropped image regions.
Implements: IDocumentModel<T>
Known implementations: ABINet<T>, SVTR<T>
For Beginners
Text recognition is the second step in reading text from images. Given a small image containing only text (like a single word or line), the recognizer outputs the actual characters. This is like reading what’s written in a highlighted region.
Example usage:
How It Works
Text recognition models convert cropped images of text into character sequences. They work on pre-detected text regions (from a text detector).
Properties
| Property | Summary |
|---|---|
bool SupportsAttentionVisualization { get; } |
Gets whether this recognizer supports attention visualization. |
int MaxSequenceLength { get; } |
Gets the maximum sequence length this recognizer can output. |
string SupportedCharacters { get; } |
Gets the supported character set (alphabet) for this recognizer. |
Methods
| Method | Summary |
|---|---|
IEnumerable<TextRecognitionResult<T>> RecognizeTextBatch(IEnumerable<Tensor<T>> croppedImages) |
Recognizes text from multiple cropped image regions (batch processing). |
Tensor<T> GetAttentionWeights() |
Gets the attention weights for visualization (if supported). |
Tensor<T> GetCharacterProbabilities() |
Gets the character-level probabilities for the last recognition. |
TextRecognitionResult<T> RecognizeText(Tensor<T> croppedImage) |
Recognizes text from a cropped image region. |