UNPKG

@idscan/idvc2

Version:

component for the capturing documents

21 lines (20 loc) 834 B
import { InferenceSession } from 'onnxruntime-web'; import NeuralModel from './neuralModel'; import { Provider } from './Provider'; import { RGBColor32 } from '../helpers/image'; interface Prediction { value: string; confidence: number; } export type PredictionList = Prediction[]; export default class MrzModel extends NeuralModel { predictionList: InferenceSession.OnnxValueMapType[]; interpretedPredictionsList: PredictionList[]; constructor(url?: string, provider?: Provider, wasmPaths?: string); predict(rgb: RGBColor32): Promise<InferenceSession.OnnxValueMapType>; predictFromArray(input: Float32Array, batchSize: number): Promise<PredictionList[]>; interpret(data: Float32Array): PredictionList; get isLoading(): boolean; predictFromImage(input: any, dstCanvas: any): void; } export {};