Defined in: modules/computer_vision/VerticalOCRModule.ts:11
Module for Vertical Optical Character Recognition (Vertical OCR) tasks.
delete():
void
Defined in: modules/computer_vision/VerticalOCRModule.ts:100
Release the memory held by the module. Calling forward afterwards is invalid.
Note that you cannot delete model while it's generating.
void
forward(
imageSource):Promise<OCRDetection[]>
Defined in: modules/computer_vision/VerticalOCRModule.ts:92
Executes the model's forward pass, where imageSource can be a fetchable resource or a Base64-encoded string.
string
The image source to be processed.
Promise<OCRDetection[]>
The OCR result as a OCRDetection[].
staticfromCustomModel(detectorSource,recognizerSource,language,independentCharacters?,onDownloadProgress?):Promise<VerticalOCRModule>
Defined in: modules/computer_vision/VerticalOCRModule.ts:68
Creates a Vertical OCR instance with a user-provided model binary.
Use this when working with a custom-exported Vertical OCR model.
Internally uses 'custom' as the model name for telemetry.
A fetchable resource pointing to the text detector model binary.
A fetchable resource pointing to the text recognizer model binary.
The language for the OCR model.
"abq" | "ady" | "af" | "ava" | "az" | "be" | "bg" | "bs" | "chSim" | "che" | "cs" | "cy" | "da" | "dar" | "de" | "en" | "es" | "et" | "fr" | "ga" | "hr" | "hu" | "id" | "inh" | "ic" | "it" | "ja" | "kbd" | "kn" | "ko" | "ku" | "la" | "lbe" | "lez" | "lt" | "lv" | "mi" | "mn" | "ms" | "mt" | "nl" | "no" | "oc" | "pi" | "pl" | "pt" | "ro" | "ru" | "rsCyrillic" | "rsLatin" | "sk" | "sl" | "sq" | "sv" | "sw" | "tab" | "te" | "tjk" | "tl" | "tr" | "uk" | "uz" | "vi"
boolean = false
Whether to treat characters independently during recognition.
(progress) => void
Optional callback to monitor download progress, receiving a value between 0 and 1.
Promise<VerticalOCRModule>
A Promise resolving to a VerticalOCRModule instance.
The native model contract for this method is not formally defined and may change between releases. Refer to the native source code for the current expected tensor interface.
staticfromModelName(namedSources,onDownloadProgress?):Promise<VerticalOCRModule>
Defined in: modules/computer_vision/VerticalOCRModule.ts:29
Creates a Vertical OCR instance for a built-in model.
An object specifying the model name, detector source, recognizer source, language, and optional independent characters flag.
boolean
"abq" | "ady" | "af" | "ava" | "az" | "be" | "bg" | "bs" | "chSim" | "che" | "cs" | "cy" | "da" | "dar" | "de" | "en" | "es" | "et" | "fr" | "ga" | "hr" | "hu" | "id" | "inh" | "ic" | "it" | "ja" | "kbd" | "kn" | "ko" | "ku" | "la" | "lbe" | "lez" | "lt" | "lv" | "mi" | "mn" | "ms" | "mt" | "nl" | "no" | "oc" | "pi" | "pl" | "pt" | "ro" | "ru" | "rsCyrillic" | "rsLatin" | "sk" | "sl" | "sq" | "sv" | "sw" | "tab" | "te" | "tjk" | "tl" | "tr" | "uk" | "uz" | "vi"
"ocr-abq" | "ocr-ady" | "ocr-af" | "ocr-ava" | "ocr-az" | "ocr-be" | "ocr-bg" | "ocr-bs" | "ocr-chSim" | "ocr-che" | "ocr-cs" | "ocr-cy" | "ocr-da" | "ocr-dar" | "ocr-de" | "ocr-en" | "ocr-es" | "ocr-et" | "ocr-fr" | "ocr-ga" | "ocr-hr" | "ocr-hu" | "ocr-id" | "ocr-inh" | "ocr-ic" | "ocr-it" | "ocr-ja" | "ocr-kbd" | "ocr-kn" | "ocr-ko" | "ocr-ku" | "ocr-la" | "ocr-lbe" | "ocr-lez" | "ocr-lt" | "ocr-lv" | "ocr-mi" | "ocr-mn" | "ocr-ms" | "ocr-mt" | "ocr-nl" | "ocr-no" | "ocr-oc" | "ocr-pi" | "ocr-pl" | "ocr-pt" | "ocr-ro" | "ocr-ru" | "ocr-rsCyrillic" | "ocr-rsLatin" | "ocr-sk" | "ocr-sl" | "ocr-sq" | "ocr-sv" | "ocr-sw" | "ocr-tab" | "ocr-te" | "ocr-tjk" | "ocr-tl" | "ocr-tr" | "ocr-uk" | "ocr-uz" | "ocr-vi"
(progress) => void
Optional callback to monitor download progress, receiving a value between 0 and 1.
Promise<VerticalOCRModule>
A Promise resolving to a VerticalOCRModule instance.
import { VerticalOCRModule, OCR_JAPANESE } from 'react-native-executorch';
const ocr = await VerticalOCRModule.fromModelName({ ...OCR_JAPANESE, independentCharacters: true });