@agilemotion/oui-react-js 1.8.62 → 1.8.63
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.
|
@@ -12,19 +12,13 @@ require("./FacialRecognition.css");
|
|
|
12
12
|
var _Button = _interopRequireDefault(require("@mui/material/Button"));
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
|
-
|
|
16
|
-
try {
|
|
17
|
-
const u = new URL('../../assets/models/ssd_mobilenetv1_model-weights_manifest.json', import.meta.url);
|
|
18
|
-
return u.toString().replace(/[^/]+$/, '');
|
|
19
|
-
} catch (_unused) {
|
|
20
|
-
return '';
|
|
21
|
-
}
|
|
22
|
-
}
|
|
15
|
+
const DEFAULT_MODELS_PATH = '/models/';
|
|
23
16
|
const FaceRecognitionComponent = _ref => {
|
|
24
17
|
let {
|
|
25
18
|
mode,
|
|
26
19
|
processingPath,
|
|
27
|
-
onComplete
|
|
20
|
+
onComplete,
|
|
21
|
+
modelsPath
|
|
28
22
|
} = _ref;
|
|
29
23
|
const [imageUrl, setImageUrl] = (0, _react.useState)(null);
|
|
30
24
|
const [boxes, setBoxes] = (0, _react.useState)([]);
|
|
@@ -38,7 +32,7 @@ const FaceRecognitionComponent = _ref => {
|
|
|
38
32
|
const canvasRef = (0, _react.useRef)(null);
|
|
39
33
|
const navigate = (0, _reactRouterDom.useNavigate)();
|
|
40
34
|
(0, _react.useEffect)(() => {
|
|
41
|
-
const base = process.env.FACE_API_MODULE_BASE ||
|
|
35
|
+
const base = modelsPath || process.env.FACE_API_MODULE_BASE || DEFAULT_MODELS_PATH;
|
|
42
36
|
console.log("LOADING FACIAL RECOGNITION ASSETS FROM BASE : ", base);
|
|
43
37
|
const loadModels = async () => {
|
|
44
38
|
await faceapi.nets.ssdMobilenetv1.loadFromUri(base);
|
package/package.json
CHANGED