react-native-executorch
Version:
An easy way to run AI models in react native with ExecuTorch
19 lines (18 loc) • 651 B
JavaScript
;
import { OCRController } from '../../controllers/OCRController';
export class OCRModule {
static onDownloadProgressCallback = _downloadProgress => {};
static async load(detectorSource, recognizerSources, language = 'en') {
this.module = new OCRController({
modelDownloadProgressCallback: this.onDownloadProgressCallback
});
await this.module.loadModel(detectorSource, recognizerSources, language);
}
static async forward(input) {
return await this.module.forward(input);
}
static onDownloadProgress(callback) {
this.onDownloadProgressCallback = callback;
}
}
//# sourceMappingURL=OCRModule.js.map