@idscan/idvc2 2.8.10 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/css/idvc.css +1 -1
- package/dist/idvc.js +2 -1688
- package/dist/idvc.js.LICENSE.txt +42 -0
- package/dist/idvc.js.gzip +0 -0
- package/dist/index.html +22 -19
- package/dist/js/environment/generalTypeCenters.json +5569 -0
- package/dist/js/environment/langs.js +1 -1
- package/dist/js/environment/networkNames.json +3 -2
- package/dist/js/environment/stepsDescription.ts +5 -5
- package/dist/langs.js.gzip +0 -0
- package/dist/networks/Blur-chunk.js +1 -1
- package/dist/networks/Bubble-chunk.js +1 -1
- package/dist/networks/ClassLocal-chunk.js +1 -1
- package/dist/networks/Face-chunk.js +1 -1
- package/dist/networks/GeneralTypeDetectionYolo-chunk.js +1 -0
- package/dist/networks/MRZ-chunk.js +1 -1
- package/dist/networks/PDF-chunk.js +1 -1
- package/dist/networks/ZXing-chunk.js +1 -1
- package/dist/networks/blurWorker.js.gzip +0 -0
- package/dist/networks/bubbleWorker.js.gzip +0 -0
- package/dist/networks/generalTypeDetectionYolo.onnx.gzip +0 -0
- package/dist/networks/mrzWorker.js.gzip +0 -0
- package/dist/networks/ort-wasm-simd.wasm.gzip +0 -0
- package/dist/networks/ort-wasm.wasm.gzip +0 -0
- package/dist/networks/pdfWorker.js.gzip +0 -0
- package/dist/types/bl.d.ts +1 -0
- package/dist/types/helpers/canvas.d.ts +6 -0
- package/dist/types/helpers/color.d.ts +1 -0
- package/dist/types/helpers/image.d.ts +7 -6
- package/dist/types/helpers/math.d.ts +2 -0
- package/dist/types/idvc.d.ts +1 -0
- package/dist/types/loader/loaderGeneralTypeDetectionYolo.d.ts +2 -0
- package/dist/types/modules/FrontProcessing.d.ts +5 -5
- package/dist/types/modules/MrzModule.d.ts +4 -4
- package/dist/types/modules/manualUploadProcessing.d.ts +1 -1
- package/dist/types/modules/ui/canvas.d.ts +1 -0
- package/dist/types/neural models/anglesModel.d.ts +1 -0
- package/dist/types/neural models/classLocalModel.d.ts +2 -1
- package/dist/types/neural models/generalTypeDetectionYoloModel.d.ts +24 -0
- package/dist/types/neural models/generalTypeYolo/exits.d.ts +5 -0
- package/dist/types/neural models/mrzModel.d.ts +2 -2
- package/dist/types/neural models/neuralModel.d.ts +1 -1
- package/package.json +3 -4
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/types/bl.d.ts
CHANGED
|
@@ -11,5 +11,6 @@ declare const bl: {
|
|
|
11
11
|
updateDocumentTypes(documentTypes: IDocumentTypeConfig): Promise<any>;
|
|
12
12
|
reloadComponent(config: Partial<IConfig>): Promise<void>;
|
|
13
13
|
showSpinner(val: boolean): void;
|
|
14
|
+
showLoader(val: boolean, bottomText?: string, topText?: string): void;
|
|
14
15
|
};
|
|
15
16
|
export default bl;
|
|
@@ -29,6 +29,12 @@ export declare const cropAndResize: (src: HTMLCanvasElement | HTMLVideoElement,
|
|
|
29
29
|
export declare const createCanvas: (id: string, size: ISize) => HTMLCanvasElement;
|
|
30
30
|
export declare const createCanvasFromImage: (id: string, image: HTMLImageElement) => HTMLCanvasElement;
|
|
31
31
|
export declare const createCanvasFromImageData: (id: string, imageData: ImageData) => HTMLCanvasElement;
|
|
32
|
+
export declare function calculateFitInSquare(outerBox: any, innerBox: any, padding?: number): {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
};
|
|
32
38
|
declare const _default: {
|
|
33
39
|
getOrigData: () => ImageData;
|
|
34
40
|
getResizedData: () => ImageData;
|
|
@@ -10,5 +10,6 @@ export declare enum Normalization {
|
|
|
10
10
|
export declare const rgbaToGrayscale: (pixels: Uint8Array | number[], rgba: number[], nrows: number, ncols: number) => void;
|
|
11
11
|
export declare const normalize: <T extends TypedArray>(arr: T, normalization?: Normalization) => T;
|
|
12
12
|
export declare const rgbaToRgb: (rgba: ImageData, normalization?: Normalization) => Float32Array;
|
|
13
|
+
export declare const rgbaToBgr: (rgba: ImageData, normalization?: Normalization) => Float32Array;
|
|
13
14
|
declare const _default: Color;
|
|
14
15
|
export default _default;
|
|
@@ -6,7 +6,6 @@ export type RGBColor32 = Float32Array;
|
|
|
6
6
|
type PixelPosition = number;
|
|
7
7
|
type Segmentize = (binarizedImg: Uint8ClampedArray, width: number) => Set<PixelPosition>[];
|
|
8
8
|
type Binarize = (img: ImageData, threshold?: number) => Uint8ClampedArray;
|
|
9
|
-
type GetResizedSizes = (size: number, baseSize: IBaseSize) => ISize;
|
|
10
9
|
export interface IOffset {
|
|
11
10
|
top: number;
|
|
12
11
|
left: number;
|
|
@@ -18,10 +17,6 @@ export interface ISize {
|
|
|
18
17
|
width: number;
|
|
19
18
|
height: number;
|
|
20
19
|
}
|
|
21
|
-
interface IBaseSize {
|
|
22
|
-
baseWidth: number;
|
|
23
|
-
baseHeight: number;
|
|
24
|
-
}
|
|
25
20
|
export declare const generateFaceColorFromAngle: (angle: number) => RGBAColor;
|
|
26
21
|
/**
|
|
27
22
|
*
|
|
@@ -31,6 +26,12 @@ export declare const generateFaceColorFromAngle: (angle: number) => RGBAColor;
|
|
|
31
26
|
*/
|
|
32
27
|
export declare const binarize: Binarize;
|
|
33
28
|
export declare const segmentize2: Segmentize;
|
|
34
|
-
export declare const getResizedSizes:
|
|
29
|
+
export declare const getResizedSizes: (size: any, { baseWidth, baseHeight }: {
|
|
30
|
+
baseWidth: any;
|
|
31
|
+
baseHeight: any;
|
|
32
|
+
}) => {
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
};
|
|
35
36
|
export declare const getCrop: (src: ISize, dst: ISize) => ICrop;
|
|
36
37
|
export {};
|
|
@@ -27,9 +27,11 @@ export declare const STD: (vals: number[], normalization?: NormalizationFunction
|
|
|
27
27
|
* @return {number}
|
|
28
28
|
*/
|
|
29
29
|
export declare const randomIntFromInterval: (min: number, max: number) => number;
|
|
30
|
+
export declare const cosineDistance: (vector1: any, vector2: any) => number;
|
|
30
31
|
declare const _default: {
|
|
31
32
|
randomIntFromInterval: (min: number, max: number) => number;
|
|
32
33
|
mean: (...args: number[] | [number[]]) => number;
|
|
34
|
+
cosineDistance: (vector1: any, vector2: any) => number;
|
|
33
35
|
STD: (vals: number[], normalization?: NormalizationFunctionNames, fixed?: number) => number;
|
|
34
36
|
};
|
|
35
37
|
export default _default;
|
package/dist/types/idvc.d.ts
CHANGED
|
@@ -14,5 +14,6 @@ export default class VideoCapturing {
|
|
|
14
14
|
reloadComponent(newConfig: Partial<IConfig>): void;
|
|
15
15
|
updateDocumentTypes(documentTypes: IDocumentTypeConfig): void;
|
|
16
16
|
showSpinner(val: boolean): void;
|
|
17
|
+
showLoader(val: boolean, bottomText?: string, topText?: string): void;
|
|
17
18
|
private init;
|
|
18
19
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { GeneralTypeExitYolo } from '../neural models/generalTypeYolo/exits';
|
|
2
2
|
export type Status = 'PENDING' | 'FULFILLED';
|
|
3
|
-
type
|
|
4
|
-
side:
|
|
3
|
+
type YoloRecognitionResult = Promise<{
|
|
4
|
+
side: GeneralTypeExitYolo;
|
|
5
5
|
aspectRatio: number;
|
|
6
6
|
}>;
|
|
7
|
-
type ProcessUploadedImageResult = Awaited<
|
|
7
|
+
type ProcessUploadedImageResult = Awaited<YoloRecognitionResult> & {
|
|
8
8
|
perimeter: 'low' | 'ok';
|
|
9
9
|
};
|
|
10
10
|
type FillingQueueResult = {
|
|
11
11
|
status: Status;
|
|
12
|
-
promise:
|
|
12
|
+
promise: YoloRecognitionResult;
|
|
13
13
|
};
|
|
14
14
|
export declare const clearQueue: () => void;
|
|
15
15
|
export declare const processUploadedImage: (smallImage: ImageData) => Promise<ProcessUploadedImageResult>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IMRZLocation } from './manualUploadProcessing';
|
|
2
|
-
import { IMrzScanRes } from '../types/mrz';
|
|
3
|
-
import { IMrzCoords } from '../loop';
|
|
4
|
-
import { StepFunctionResult } from '../types/loop';
|
|
5
1
|
import MrzModel, { PredictionList } from '../neural models/mrzModel';
|
|
2
|
+
import type { IMRZLocation } from './manualUploadProcessing';
|
|
3
|
+
import type { IMrzScanRes } from '../types/mrz';
|
|
4
|
+
import type { IMrzCoords } from '../loop';
|
|
5
|
+
import type { StepFunctionResult } from '../types/loop';
|
|
6
6
|
interface IMrzStepResult extends StepFunctionResult {
|
|
7
7
|
coords?: IMrzCoords;
|
|
8
8
|
needToCut?: boolean;
|
|
@@ -9,6 +9,7 @@ export default class CanvasUi {
|
|
|
9
9
|
borderCanvas: HTMLCanvasElement;
|
|
10
10
|
faceCanvas: HTMLCanvasElement;
|
|
11
11
|
classLocalCanvas: HTMLCanvasElement;
|
|
12
|
+
generalTypeCanvas: HTMLCanvasElement;
|
|
12
13
|
blazeFaceCanvas: HTMLCanvasElement;
|
|
13
14
|
meshFaceCanvas: HTMLCanvasElement;
|
|
14
15
|
mrzCtx: CanvasRenderingContext2D;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="onnxruntime-web" />
|
|
1
2
|
import NeuralModel from './neuralModel';
|
|
2
3
|
import { Provider } from './Provider';
|
|
3
4
|
import { RGBColor32 } from '../helpers/image';
|
|
@@ -21,8 +22,8 @@ export declare class ClassLocalModel extends NeuralModel {
|
|
|
21
22
|
private canvasSize;
|
|
22
23
|
constructor(url?: string, provider?: Provider, wasmPaths?: string);
|
|
23
24
|
setSizes({ height, width }: ISize): void;
|
|
24
|
-
predict(rgb: RGBColor32): Promise<import("onnxruntime-web").InferenceSession.OnnxValueMapType>;
|
|
25
25
|
predictFromImage(input: HTMLCanvasElement | HTMLImageElement | ImageData, dstCanvas?: HTMLCanvasElement, offsets?: IOffset, cropSizes?: ISize): Promise<any[] | InterpretClassLocalRes>;
|
|
26
26
|
interpret(classifierData: Float32Array, bboxData: Float32Array): InterpretClassLocalRes;
|
|
27
|
+
protected predict(rgb: RGBColor32): Promise<import("onnxruntime-web").InferenceSession.OnnxValueMapType>;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="onnxruntime-web" />
|
|
2
|
+
import NeuralModel from './neuralModel';
|
|
3
|
+
import { Provider } from './Provider';
|
|
4
|
+
import type { ISize } from '../helpers/ts/common';
|
|
5
|
+
import type { GeneralTypeExitYolo } from './generalTypeYolo/exits';
|
|
6
|
+
import type { RGBColor32 } from '../helpers/image';
|
|
7
|
+
import type { Bbox } from '../types/geometry';
|
|
8
|
+
export type InterpretYoloDetectionResult = {
|
|
9
|
+
side: GeneralTypeExitYolo;
|
|
10
|
+
bbox: Bbox;
|
|
11
|
+
perimeterInPercents: ISize;
|
|
12
|
+
};
|
|
13
|
+
export declare class GeneralTypeDetectionYoloModel extends NeuralModel {
|
|
14
|
+
private canvasSize;
|
|
15
|
+
constructor(url?: string, provider?: Provider, wasmPaths?: string);
|
|
16
|
+
private setSizes;
|
|
17
|
+
predictFromImage(input: HTMLCanvasElement | HTMLImageElement | ImageData, dstCanvas?: HTMLCanvasElement): Promise<Record<string, unknown> | InterpretYoloDetectionResult>;
|
|
18
|
+
private interpret;
|
|
19
|
+
processOutput(output: any, imageWidth: number, imageHeight: number): any[];
|
|
20
|
+
iou(box1: any, box2: any): number;
|
|
21
|
+
union(box1: any, box2: any): number;
|
|
22
|
+
intersection(box1: any, box2: any): number;
|
|
23
|
+
protected predict(rgb: RGBColor32): Promise<import("onnxruntime-web").InferenceSession.OnnxValueMapType>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type GeneralTypeExitYolo = 'None' | 'BACKS_MRZ' | 'BACKS_MRZPDF' | 'BACKS_NO' | 'BACKS_PDF' | 'BCC' | 'CAC' | 'CREDITCARDS' | 'DLIC' | 'EA' | 'GC' | 'IID' | 'MID_NEW' | 'MID_OLD' | 'PASSP' | 'PC' | 'VA' | 'VHC';
|
|
2
|
+
export declare const validBackExits: Set<GeneralTypeExitYolo>;
|
|
3
|
+
export declare const validFrontExits: Set<GeneralTypeExitYolo>;
|
|
4
|
+
export declare const hasPDF: (side: GeneralTypeExitYolo) => boolean;
|
|
5
|
+
export declare const hasMRZ: (side: GeneralTypeExitYolo) => boolean;
|
|
@@ -8,8 +8,8 @@ interface Prediction {
|
|
|
8
8
|
}
|
|
9
9
|
export type PredictionList = Prediction[];
|
|
10
10
|
export default class MrzModel extends NeuralModel {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
predictionList: InferenceSession.OnnxValueMapType[];
|
|
12
|
+
interpretedPredictionsList: PredictionList[];
|
|
13
13
|
constructor(url?: string, provider?: Provider, wasmPaths?: string);
|
|
14
14
|
predict(rgb: RGBColor32): Promise<InferenceSession.OnnxValueMapType>;
|
|
15
15
|
predictFromArray(input: Float32Array, batchSize: number): Promise<PredictionList[]>;
|
|
@@ -15,7 +15,7 @@ declare abstract class NeuralModel {
|
|
|
15
15
|
initWasmPath(): Promise<void>;
|
|
16
16
|
initWasm(): Promise<void>;
|
|
17
17
|
init(): Promise<void>;
|
|
18
|
-
abstract predict(rgb: RGBColor32): any;
|
|
19
18
|
abstract predictFromImage(input: HTMLCanvasElement | HTMLImageElement, dstCanvas?: HTMLCanvasElement): unknown;
|
|
19
|
+
protected abstract predict(rgb: RGBColor32): any;
|
|
20
20
|
}
|
|
21
21
|
export default NeuralModel;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idscan/idvc2",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "component for the capturing documents",
|
|
5
5
|
"main": "dist/idvc.js",
|
|
6
6
|
"types": "dist/types/idvc.d.ts",
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"sass-loader": "13.2.1",
|
|
55
55
|
"string-replace-loader": "3.1.0",
|
|
56
56
|
"swc-loader": "0.2.3",
|
|
57
|
-
"swc-minify-webpack-plugin": "2.0.0",
|
|
58
57
|
"typescript": "5.0.4",
|
|
59
58
|
"webpack": "5.83.1",
|
|
60
59
|
"webpack-bundle-analyzer": "4.8.0",
|
|
@@ -70,12 +69,12 @@
|
|
|
70
69
|
"crypto-browserify": "3.12.0",
|
|
71
70
|
"detect-browser": "5.3.0",
|
|
72
71
|
"mobile-detect": "1.4.5",
|
|
73
|
-
"onnxruntime-web": "1.
|
|
72
|
+
"onnxruntime-web": "1.17.0",
|
|
74
73
|
"pako": "^2.1.0",
|
|
75
|
-
"process": "0.11.10",
|
|
76
74
|
"regenerator-runtime": "0.13.11",
|
|
77
75
|
"stream-browserify": "3.0.0",
|
|
78
76
|
"strtok3": "6.2.4",
|
|
77
|
+
"terser-webpack-plugin": "^5.3.10",
|
|
79
78
|
"token-types": "4.1.1",
|
|
80
79
|
"util": "0.12.5"
|
|
81
80
|
},
|