idmission-web-sdk 1.0.184 → 1.0.185

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.
@@ -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.184';
51
+ var webSdkVersion = '1.0.185';
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
- return [4 /*yield*/, makePredictions(frame, thresholds, canvases, logPredictions)];
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, frame);
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, e_1;
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
- e_1 = _e.sent();
9068
- console.error('caught error in makeDocumentDetectionPredictions', e_1);
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: [],