idmission-web-sdk 2.1.107 → 2.1.108
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/dist/lib/models/DocumentDetection.d.ts +4 -2
- package/dist/lib/models/defaults/DocumentDetector.d.ts +1 -1
- package/dist/sdk2.cjs.development.js +10 -6
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +10 -6
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +10 -6
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -24,11 +24,13 @@ export type DetectedObject = {
|
|
|
24
24
|
label: Label;
|
|
25
25
|
score: number;
|
|
26
26
|
};
|
|
27
|
-
export type
|
|
27
|
+
export type DocumentThresholds = {
|
|
28
28
|
idCardFront?: number;
|
|
29
29
|
idCardBack?: number;
|
|
30
30
|
passport?: number;
|
|
31
|
-
|
|
31
|
+
};
|
|
32
|
+
export type DocumentDetectionThresholds = DocumentThresholds & {
|
|
33
|
+
stability?: DocumentThresholds;
|
|
32
34
|
};
|
|
33
35
|
export declare function loadDocumentDetector(modelAssetPath?: string, scoreThreshold?: number): Promise<ObjectDetector>;
|
|
34
36
|
export declare function useLoadDocumentDetector({ modelPath, modelLoadTimeoutMs, scoreThreshold, onModelError, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/
|
|
1
|
+
export declare const defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/DocumentDetector/DocumentDetector-20241010_134238.tflite";
|
|
@@ -234,7 +234,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
234
234
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
-
var webSdkVersion = '2.1.
|
|
237
|
+
var webSdkVersion = '2.1.108';
|
|
238
238
|
|
|
239
239
|
function getPlatform() {
|
|
240
240
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2778,7 +2778,7 @@ function average(arr) {
|
|
|
2778
2778
|
|
|
2779
2779
|
var DEFAULT_CDN_URL = 'https://websdk-cdn-dev.idmission.com/assets';
|
|
2780
2780
|
|
|
2781
|
-
var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/
|
|
2781
|
+
var defaultDocumentDetectorModelPath = "".concat(DEFAULT_CDN_URL, "/models/DocumentDetector/DocumentDetector-20241010_134238.tflite");
|
|
2782
2782
|
|
|
2783
2783
|
var defaultFocusModelPath = "".concat(DEFAULT_CDN_URL, "/models/Focus/Focus-20241008_102708.tflite");
|
|
2784
2784
|
|
|
@@ -5569,7 +5569,11 @@ var defaultDocumentDetectionThresholds = {
|
|
|
5569
5569
|
idCardFront: 0.6,
|
|
5570
5570
|
idCardBack: 0.6,
|
|
5571
5571
|
passport: 0.4,
|
|
5572
|
-
stability:
|
|
5572
|
+
stability: {
|
|
5573
|
+
idCardFront: 0.85,
|
|
5574
|
+
idCardBack: 0.85,
|
|
5575
|
+
passport: 0.5
|
|
5576
|
+
}
|
|
5573
5577
|
};
|
|
5574
5578
|
var documentTypeDisplayNames = {
|
|
5575
5579
|
idCardFront: 'ID card front',
|
|
@@ -5609,8 +5613,7 @@ function loadDocumentDetector() {
|
|
|
5609
5613
|
delegate: modelCapabilities.delegate
|
|
5610
5614
|
},
|
|
5611
5615
|
scoreThreshold: scoreThreshold,
|
|
5612
|
-
runningMode: 'VIDEO'
|
|
5613
|
-
maxResults: 3
|
|
5616
|
+
runningMode: 'VIDEO'
|
|
5614
5617
|
}])];
|
|
5615
5618
|
case 3:
|
|
5616
5619
|
_a[_b] = _e.sent();
|
|
@@ -5833,7 +5836,8 @@ function processDocumentDetectorPrediction(prediction, thresholds, boundaries) {
|
|
|
5833
5836
|
docHeight = _o[1];
|
|
5834
5837
|
documentTooClose = docWidth > 0.85 || docHeight > 0.85;
|
|
5835
5838
|
if (detectionThresholdMet && documentInBounds && !documentTooClose) {
|
|
5836
|
-
var
|
|
5839
|
+
var thresholdSet = (_m = thresholds.stability) !== null && _m !== void 0 ? _m : defaultDocumentDetectionThresholds.stability;
|
|
5840
|
+
var threshold_1 = thresholdSet[detectedDocumentType];
|
|
5837
5841
|
var framesNeeded = Math.ceil(average(framesNeededSamples));
|
|
5838
5842
|
trackBox(bestDocument.box, framesNeeded);
|
|
5839
5843
|
documentIsStable = lastNBoxes.length >= framesNeeded && !lastNPairs.some(function (pair) {
|