idmission-web-sdk 1.0.184 → 1.0.186
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/sdk2.cjs.development.js +19 -10
- 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 +19 -10
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +19 -10
- 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
|
@@ -48,7 +48,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
48
48
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
49
49
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
50
50
|
|
|
51
|
-
var webSdkVersion = '1.0.
|
|
51
|
+
var webSdkVersion = '1.0.186';
|
|
52
52
|
|
|
53
53
|
function getPlatform() {
|
|
54
54
|
if (typeof window === 'undefined') return;
|
|
@@ -8795,7 +8795,7 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
|
|
|
8795
8795
|
working.current = true;
|
|
8796
8796
|
(function () {
|
|
8797
8797
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
8798
|
-
var canvases, prediction;
|
|
8798
|
+
var canvases, prediction, e_1;
|
|
8799
8799
|
var _a, _b, _c;
|
|
8800
8800
|
return tslib.__generator(this, function (_d) {
|
|
8801
8801
|
switch (_d.label) {
|
|
@@ -8806,8 +8806,11 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
|
|
|
8806
8806
|
cropCanvas: cropCanvas.current,
|
|
8807
8807
|
rotateCanvas: rotateCanvas.current
|
|
8808
8808
|
};
|
|
8809
|
-
|
|
8809
|
+
_d.label = 1;
|
|
8810
8810
|
case 1:
|
|
8811
|
+
_d.trys.push([1, 3,, 4]);
|
|
8812
|
+
return [4 /*yield*/, makePredictions(frame, thresholds, canvases, logPredictions)];
|
|
8813
|
+
case 2:
|
|
8811
8814
|
prediction = _d.sent();
|
|
8812
8815
|
setDetectionTime(prediction.detectionTime);
|
|
8813
8816
|
setFocusPredictionTime(prediction.focusPredictionTime);
|
|
@@ -8816,12 +8819,18 @@ var IdCaptureModelsProvider = function IdCaptureModelsProvider(_a) {
|
|
|
8816
8819
|
setBestFrameBoundingBox((_b = (_a = prediction.bestDocumentOrPassport) === null || _a === void 0 ? void 0 : _a.bbox) !== null && _b !== void 0 ? _b : []);
|
|
8817
8820
|
setBestFrameDetectionScore(prediction.detectionScore);
|
|
8818
8821
|
setBestFrameFocusScore(prediction.focusScore);
|
|
8819
|
-
drawToCanvas(bestPredictionCanvas.current,
|
|
8822
|
+
drawToCanvas(bestPredictionCanvas.current, lastPredictionCanvas.current);
|
|
8820
8823
|
}
|
|
8821
8824
|
if (prediction.allZero) setTimesAllZero(function (n) {
|
|
8822
8825
|
return n + 1;
|
|
8823
8826
|
});
|
|
8824
8827
|
(_c = onPredictionHandler.current) === null || _c === void 0 ? void 0 : _c.call(onPredictionHandler, prediction);
|
|
8828
|
+
return [3 /*break*/, 4];
|
|
8829
|
+
case 3:
|
|
8830
|
+
e_1 = _d.sent();
|
|
8831
|
+
console.log('caught an error while predicting!', e_1);
|
|
8832
|
+
return [3 /*break*/, 4];
|
|
8833
|
+
case 4:
|
|
8825
8834
|
working.current = false;
|
|
8826
8835
|
return [2 /*return*/];
|
|
8827
8836
|
}
|
|
@@ -9003,7 +9012,7 @@ function makeDocumentDetectionPredictions(image, logPredictions) {
|
|
|
9003
9012
|
logPredictions = false;
|
|
9004
9013
|
}
|
|
9005
9014
|
return tslib.__awaiter(this, void 0, void 0, function () {
|
|
9006
|
-
var startedAt, tfImg, tfResize, tfInt32, tf4d_, _a, _b, _c, _d, tf4d, result, predictions, boxes, scores, labels, time,
|
|
9015
|
+
var startedAt, tfImg, tfResize, tfInt32, tf4d_, _a, _b, _c, _d, tf4d, result, predictions, boxes, scores, labels, time, e_2;
|
|
9007
9016
|
return tslib.__generator(this, function (_e) {
|
|
9008
9017
|
switch (_e.label) {
|
|
9009
9018
|
case 0:
|
|
@@ -9064,8 +9073,8 @@ function makeDocumentDetectionPredictions(image, logPredictions) {
|
|
|
9064
9073
|
time: time
|
|
9065
9074
|
}];
|
|
9066
9075
|
case 7:
|
|
9067
|
-
|
|
9068
|
-
console.error('caught error in makeDocumentDetectionPredictions',
|
|
9076
|
+
e_2 = _e.sent();
|
|
9077
|
+
console.error('caught error in makeDocumentDetectionPredictions', e_2);
|
|
9069
9078
|
return [2 /*return*/, {
|
|
9070
9079
|
boxes: [],
|
|
9071
9080
|
scores: [],
|
|
@@ -14162,6 +14171,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14162
14171
|
stopRecording();
|
|
14163
14172
|
}
|
|
14164
14173
|
}, [readTextPrompt, stopRecording]);
|
|
14174
|
+
var satisfied = goodFramesCount > 0 && faceCentered;
|
|
14165
14175
|
React.useEffect(function () {
|
|
14166
14176
|
(function () {
|
|
14167
14177
|
return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
@@ -14169,7 +14179,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14169
14179
|
return tslib.__generator(this, function (_a) {
|
|
14170
14180
|
switch (_a.label) {
|
|
14171
14181
|
case 0:
|
|
14172
|
-
if (!
|
|
14182
|
+
if (!satisfied) return [3 /*break*/, 5];
|
|
14173
14183
|
setCurrentDetectionScore(0);
|
|
14174
14184
|
setCurrentFocusScore(0);
|
|
14175
14185
|
setGoodFramesCount(0);
|
|
@@ -14210,7 +14220,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14210
14220
|
});
|
|
14211
14221
|
});
|
|
14212
14222
|
})();
|
|
14213
|
-
}, [captureFrame,
|
|
14223
|
+
}, [captureFrame, satisfied, onIdBackCaptureComplete, onIdBackImageCaptured, onIdFrontImageCaptured, requestedAction, resetBestFrame, skipShowIdCardBack]);
|
|
14214
14224
|
var onReadTextTimeout = React.useCallback(function () {
|
|
14215
14225
|
stopRecording();
|
|
14216
14226
|
}, [stopRecording]);
|
|
@@ -14252,7 +14262,6 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14252
14262
|
videoWidth: (_g = (_f = videoRef.current) === null || _f === void 0 ? void 0 : _f.videoWidth) !== null && _g !== void 0 ? _g : 0,
|
|
14253
14263
|
videoHeight: (_j = (_h = videoRef.current) === null || _h === void 0 ? void 0 : _h.videoHeight) !== null && _j !== void 0 ? _j : 0
|
|
14254
14264
|
});
|
|
14255
|
-
var satisfied = goodFramesCount > 0 && faceCentered;
|
|
14256
14265
|
return /*#__PURE__*/React__default['default'].createElement(PageContainer, {
|
|
14257
14266
|
ref: ref,
|
|
14258
14267
|
className: "flex ".concat((_k = classNames.container) !== null && _k !== void 0 ? _k : '')
|