idmission-web-sdk 1.0.363 → 1.0.365

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.
@@ -1,5 +1,5 @@
1
1
  import { ObjectDetector } from '@mediapipe/tasks-vision';
2
- export declare const defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240517/model_fp16.tflite";
2
+ export declare const defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240530/model_fp16.tflite";
3
3
  export declare const defaultDocumentDetectionModelLoadTimeoutMs = 45000;
4
4
  export type DocumentType = 'none' | 'idCard' | 'passport';
5
5
  export type Label = 'Document' | 'MRZ' | 'PDF417' | 'Primary face' | 'Secondary face' | 'Glare' | 'Punch Hole' | 'Passport Page';
@@ -10,12 +10,6 @@ export type DetectedObjectBox = {
10
10
  yMax: number;
11
11
  width: number;
12
12
  height: number;
13
- xMinPct: number;
14
- xMaxPct: number;
15
- yMinPct: number;
16
- yMaxPct: number;
17
- widthPct: number;
18
- heightPct: number;
19
13
  };
20
14
  export type DetectedObject = {
21
15
  box: DetectedObjectBox;
@@ -49,7 +49,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
49
49
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
50
50
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
51
51
 
52
- var webSdkVersion = '1.0.363';
52
+ var webSdkVersion = '1.0.365';
53
53
 
54
54
  function getPlatform() {
55
55
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -2227,10 +2227,7 @@ function loadTinyModel(delegate) {
2227
2227
  });
2228
2228
  }
2229
2229
 
2230
- // export const documentDetectorModelPath = `https://websdk-cdn-dev.idmission.com/assets/models/mpobjtest/model_int8_qat.tflite`
2231
- // export const documentDetectorModelPath = `https://websdk-cdn-dev.idmission.com/assets/models/mpobjtest/model.tflite`
2232
- // export const documentDetectorModelPath = `https://websdk-cdn-dev.idmission.com/assets/models/mpobjtest/model_fp16.tflite`
2233
- var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240517/model_fp16.tflite";
2230
+ var defaultDocumentDetectorModelPath = "https://websdk-cdn-dev.idmission.com/assets/models/docdetectmp20240530/model_fp16.tflite";
2234
2231
  var defaultDocumentDetectionModelLoadTimeoutMs = 45000;
2235
2232
  var detectors = {};
2236
2233
  function loadDocumentDetector(modelAssetPath, scoreThreshold) {
@@ -2816,14 +2813,7 @@ function processPrediction(prediction, thresholds) {
2816
2813
  return {
2817
2814
  label: category === null || category === void 0 ? void 0 : category.categoryName,
2818
2815
  score: category === null || category === void 0 ? void 0 : category.score,
2819
- box: tslib.__assign(tslib.__assign({}, box), {
2820
- xMinPct: box.xMin / frameWidth,
2821
- xMaxPct: box.xMax / frameWidth,
2822
- yMinPct: box.yMin / frameHeight,
2823
- yMaxPct: box.yMax / frameHeight,
2824
- widthPct: box.width / frameWidth,
2825
- heightPct: box.height / frameHeight
2826
- })
2816
+ box: box
2827
2817
  };
2828
2818
  }));
2829
2819
  var allZero = detections.length > 0 && !detections.some(function (_a) {
@@ -2878,7 +2868,7 @@ function processPrediction(prediction, thresholds) {
2878
2868
  }
2879
2869
  var documentTooClose = false;
2880
2870
  if (bestDocumentOrPassport) {
2881
- var _k = [bestDocumentOrPassport.box.widthPct, bestDocumentOrPassport.box.heightPct],
2871
+ var _k = [bestDocumentOrPassport.box.width / frameWidth, bestDocumentOrPassport.box.height / frameHeight],
2882
2872
  docWidth = _k[0],
2883
2873
  docHeight = _k[1];
2884
2874
  documentTooClose = docWidth > 0.85 || docHeight > 0.85;