Repository navigation
Replies: 1 comment
|
Short answer: there's no published language list, and there's no API to enumerate languages. 1. Language list: the docs don't have one. The Text Recognition platform card only says the model "can automatically detect and recognize text in supported languages … without explicit language selection". The get-started page and the API reference don't name any languages either. 2. Enumerating languages: not possible. I checked the public metadata (
So there's no equivalent of For a multilingual app, I'd do this: // 1. Is the AI OCR usable at all on this machine? (NPU / Copilot+ PC only)
var state = TextRecognizer.GetReadyState();
// Ready, NotReady, NotSupportedOnCurrentSystem, DisabledByUser,
// CapabilityMissing, NotCompatibleWithSystemHardware, OSUpdateNeeded
bool canUseAiOcr = state == AIFeatureReadyState.Ready ||
(state == AIFeatureReadyState.NotReady &&
(await TextRecognizer.EnsureReadyAsync()).Status == AIFeatureReadyResultState.Success);
// 2. For languages you haven't validated on the AI model, or when it isn't
// available, use the legacy engine, which you *can* query per language:
var lang = new Windows.Globalization.Language("ja");
if (!canUseAiOcr || !validatedForAiOcr.Contains(lang.LanguageTag))
{
if (Windows.Media.Ocr.OcrEngine.IsLanguageSupported(lang))
{
var engine = Windows.Media.Ocr.OcrEngine.TryCreateFromLanguage(lang);
// ...
}
}
|
Uh oh!
There was an error while loading. Please reload this page.
I'm developing a multilingual application that requires OCR. I am considering adding Microsoft.Windows.AI.Imaging.TextRecognizer and leaving Windows.Media.Ocr.OcrEngine as fallback.
I have two questions:
I couldn't find this information in the official documentation.
Thanks.
All reactions