@realeyes/verifeye-sdk 1.1.1 → 1.1.2
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.
|
@@ -8,7 +8,7 @@ class f {
|
|
|
8
8
|
if (!(this.isInitialized && this.faceDetector))
|
|
9
9
|
try {
|
|
10
10
|
const e = await d.forVisionTasks(
|
|
11
|
-
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision
|
|
11
|
+
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision/wasm"
|
|
12
12
|
);
|
|
13
13
|
this.faceDetector = await m.createFromOptions(e, {
|
|
14
14
|
baseOptions: {
|
|
@@ -59,18 +59,18 @@ class f {
|
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
61
|
this.canvas.width = e.videoWidth, this.canvas.height = e.videoHeight, this.ctx.drawImage(e, 0, 0);
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
const n =
|
|
62
|
+
const h = this.faceDetector.detect(e);
|
|
63
|
+
if (h.detections.length > 0) {
|
|
64
|
+
const n = h.detections[0].categories[0].score, l = this.compressCanvasToJpeg(this.canvas);
|
|
65
65
|
if (n >= r) {
|
|
66
66
|
cancelAnimationFrame(i), a({
|
|
67
67
|
hasFace: !0,
|
|
68
|
-
base64Image:
|
|
68
|
+
base64Image: l,
|
|
69
69
|
confidence: n
|
|
70
70
|
});
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
(!t || n > t.confidence) && (t = { image:
|
|
73
|
+
(!t || n > t.confidence) && (t = { image: l, confidence: n });
|
|
74
74
|
}
|
|
75
75
|
i = requestAnimationFrame(o);
|
|
76
76
|
};
|
|
@@ -1176,7 +1176,7 @@ class Xt {
|
|
|
1176
1176
|
}));
|
|
1177
1177
|
}
|
|
1178
1178
|
async loadAndInitMediaPipe() {
|
|
1179
|
-
this.faceDetectionServiceModule = await import("./faceDetectionService-
|
|
1179
|
+
this.faceDetectionServiceModule = await import("./faceDetectionService-CohHJWWF.js"), await this.faceDetectionServiceModule.faceDetectionService.initialize(), this.livenessCheckType === "basic" && (this.videoRecorderServiceModule = await import("./videoRecorderService-eqEwhEav.js"), await this.videoRecorderServiceModule.videoRecorderService.initialize());
|
|
1180
1180
|
}
|
|
1181
1181
|
async ensureMediaPipeInitialized() {
|
|
1182
1182
|
this.mediaPipeInitPromise || this.preloadMediaPipe(), await this.mediaPipeInitPromise;
|
|
@@ -1925,7 +1925,7 @@ const rr = ({
|
|
|
1925
1925
|
)
|
|
1926
1926
|
}
|
|
1927
1927
|
) }) : null;
|
|
1928
|
-
}, ar = gt(() => import("./livenessCheckDialog-
|
|
1928
|
+
}, ar = gt(() => import("./livenessCheckDialog-BaqSpUpX.js")), cr = Et({
|
|
1929
1929
|
palette: {
|
|
1930
1930
|
mode: "light"
|
|
1931
1931
|
},
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import m from "@mui/material/DialogContent";
|
|
3
3
|
import a from "@mui/material/IconButton";
|
|
4
|
-
import { R as p, C as f, D as g } from "./index-
|
|
4
|
+
import { R as p, C as f, D as g } from "./index-Wwkx7Prz.js";
|
|
5
5
|
import { Box as u, Stack as x } from "@mui/material";
|
|
6
6
|
import { FaceLivenessDetector as d } from "@aws-amplify/ui-react-liveness";
|
|
7
7
|
import "@aws-amplify/ui-react/styles.css";
|