react-native-executorch
Version:
An easy way to run AI models in React Native with ExecuTorch
22 lines (21 loc) • 657 B
JavaScript
;
import { OCRController } from '../../controllers/OCRController';
export class OCRModule {
constructor() {
this.controller = new OCRController();
}
async load(model, onDownloadProgressCallback = () => {}) {
await this.controller.load(model.detectorSource, {
recognizerLarge: model.recognizerLarge,
recognizerMedium: model.recognizerMedium,
recognizerSmall: model.recognizerSmall
}, model.language, onDownloadProgressCallback);
}
async forward(imageSource) {
return await this.controller.forward(imageSource);
}
delete() {
this.controller.delete();
}
}
//# sourceMappingURL=OCRModule.js.map