shared-ritm 1.3.44 → 1.3.46
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/shared-ritm.es.js
CHANGED
|
@@ -16772,24 +16772,34 @@ class kn {
|
|
|
16772
16772
|
withCredentials: !0
|
|
16773
16773
|
}), this.axiosInstance.interceptors.request.use(
|
|
16774
16774
|
(n) => {
|
|
16775
|
-
const t = this.
|
|
16775
|
+
const t = this.getAccessToken();
|
|
16776
16776
|
return t && n.headers && (n.headers.Authorization = `Bearer ${t}`), n;
|
|
16777
16777
|
},
|
|
16778
16778
|
(n) => Promise.reject(n)
|
|
16779
16779
|
), this.axiosInstance.interceptors.response.use(
|
|
16780
16780
|
(n) => n.data,
|
|
16781
16781
|
async (n) => {
|
|
16782
|
-
var
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
|
|
16786
|
-
|
|
16787
|
-
|
|
16782
|
+
var r, o;
|
|
16783
|
+
const t = n.config;
|
|
16784
|
+
if (t != null && t._retry)
|
|
16785
|
+
throw n;
|
|
16786
|
+
return ((r = n.response) == null ? void 0 : r.status) === 401 || ((o = n.response) == null ? void 0 : o.status) === 403 ? this.getAccessToken() && !this.isRefresh ? (t._retry = !0, this.isRefresh = !0, this.refresh().then((a) => {
|
|
16787
|
+
if (!(a != null && a.accessToken)) {
|
|
16788
|
+
this.logoutUser();
|
|
16789
|
+
return;
|
|
16790
|
+
}
|
|
16791
|
+
if (a != null && a.accessToken) {
|
|
16792
|
+
this.setAccessToken(a.accessToken), this.axiosInstance(t);
|
|
16793
|
+
return;
|
|
16794
|
+
}
|
|
16788
16795
|
})) : this.logoutUser() : Promise.reject(n);
|
|
16789
16796
|
}
|
|
16790
16797
|
);
|
|
16791
16798
|
}
|
|
16792
|
-
|
|
16799
|
+
setAccessToken(n) {
|
|
16800
|
+
localStorage.setItem("token", n);
|
|
16801
|
+
}
|
|
16802
|
+
getAccessToken() {
|
|
16793
16803
|
return localStorage.getItem("token");
|
|
16794
16804
|
}
|
|
16795
16805
|
removeToken() {
|
|
@@ -16799,7 +16809,7 @@ class kn {
|
|
|
16799
16809
|
return this.post("/v2/auth/refresh", null);
|
|
16800
16810
|
}
|
|
16801
16811
|
logoutUser() {
|
|
16802
|
-
|
|
16812
|
+
this.post("/v2/logout", {}), this.removeToken(), window.location.href = "/sign-in";
|
|
16803
16813
|
}
|
|
16804
16814
|
handleError(n) {
|
|
16805
16815
|
n.response ? console.error("API Error:", n.response.status, n.response.data) : n.request ? console.error("No response received:", n.request) : console.error("Error during request setup:", n.message);
|
|
@@ -31317,7 +31327,7 @@ var zr = "/", ca = "tensorflowjs_models", h0 = "info", XT = "model_topology", QT
|
|
|
31317
31327
|
function p0(e) {
|
|
31318
31328
|
return { info: [ca, e, h0].join(zr), topology: [ca, e, XT].join(zr), weightSpecs: [ca, e, QT].join(zr), weightData: [ca, e, ZT].join(zr), modelMetadata: [ca, e, JT].join(zr) };
|
|
31319
31329
|
}
|
|
31320
|
-
function
|
|
31330
|
+
function eA(e) {
|
|
31321
31331
|
var n = e.split(zr);
|
|
31322
31332
|
if (n.length < 3) throw new Error("Invalid key format: " + e);
|
|
31323
31333
|
return n.slice(1, n.length - 1).join(zr);
|
|
@@ -31371,7 +31381,7 @@ var ka = function() {
|
|
|
31371
31381
|
var n;
|
|
31372
31382
|
};
|
|
31373
31383
|
Xn.registerSaveRouter(Np), Xn.registerLoadRouter(Np);
|
|
31374
|
-
var
|
|
31384
|
+
var tA = function() {
|
|
31375
31385
|
function e() {
|
|
31376
31386
|
B(ie().getBool("IS_BROWSER"), function() {
|
|
31377
31387
|
return "Current environment is not a web browser";
|
|
@@ -31383,7 +31393,7 @@ var t6 = function() {
|
|
|
31383
31393
|
return Me(this, void 0, void 0, function() {
|
|
31384
31394
|
var n, t, r, o, a, i;
|
|
31385
31395
|
return Fe(this, function(s) {
|
|
31386
|
-
for (n = {}, t = ca + zr, r = zr + h0, o = 0; o < this.LS.length; ++o) (a = this.LS.key(o)).startsWith(t) && a.endsWith(r) && (i =
|
|
31396
|
+
for (n = {}, t = ca + zr, r = zr + h0, o = 0; o < this.LS.length; ++o) (a = this.LS.key(o)).startsWith(t) && a.endsWith(r) && (i = eA(a), n[i] = JSON.parse(this.LS.getItem(a)));
|
|
31387
31397
|
return [2, n];
|
|
31388
31398
|
});
|
|
31389
31399
|
});
|
|
@@ -31399,10 +31409,10 @@ var t6 = function() {
|
|
|
31399
31409
|
}, e;
|
|
31400
31410
|
}();
|
|
31401
31411
|
if (ie().getBool("IS_BROWSER")) try {
|
|
31402
|
-
lo.registerManager(ka.URL_SCHEME, new
|
|
31412
|
+
lo.registerManager(ka.URL_SCHEME, new tA());
|
|
31403
31413
|
} catch {
|
|
31404
31414
|
}
|
|
31405
|
-
var
|
|
31415
|
+
var nA = "model", rA = ".json", oA = ".weights.bin";
|
|
31406
31416
|
function Lp(e) {
|
|
31407
31417
|
return new Promise(function(n) {
|
|
31408
31418
|
return setTimeout(n);
|
|
@@ -31411,7 +31421,7 @@ function Lp(e) {
|
|
|
31411
31421
|
var Jl = function() {
|
|
31412
31422
|
function e(n) {
|
|
31413
31423
|
if (!ie().getBool("IS_BROWSER")) throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");
|
|
31414
|
-
n.startsWith(e.URL_SCHEME) && (n = n.slice(e.URL_SCHEME.length)), n != null && n.length !== 0 || (n =
|
|
31424
|
+
n.startsWith(e.URL_SCHEME) && (n = n.slice(e.URL_SCHEME.length)), n != null && n.length !== 0 || (n = nA), this.modelTopologyFileName = n + rA, this.weightDataFileName = n + oA;
|
|
31415
31425
|
}
|
|
31416
31426
|
return e.prototype.save = function(n) {
|
|
31417
31427
|
return Me(this, void 0, void 0, function() {
|
|
@@ -31438,7 +31448,7 @@ var Jl = function() {
|
|
|
31438
31448
|
});
|
|
31439
31449
|
});
|
|
31440
31450
|
}, e.URL_SCHEME = "downloads://", e;
|
|
31441
|
-
}(),
|
|
31451
|
+
}(), aA = function() {
|
|
31442
31452
|
function e(n) {
|
|
31443
31453
|
if (n == null || n.length < 1) throw new Error("When calling browserFiles, at least 1 file is required, but received " + n);
|
|
31444
31454
|
this.files = n;
|
|
@@ -31706,7 +31716,7 @@ var ec = function() {
|
|
|
31706
31716
|
});
|
|
31707
31717
|
});
|
|
31708
31718
|
}, e;
|
|
31709
|
-
}(),
|
|
31719
|
+
}(), iA = function() {
|
|
31710
31720
|
function e(n) {
|
|
31711
31721
|
this.saveHandler = n;
|
|
31712
31722
|
}
|
|
@@ -31718,7 +31728,7 @@ var ec = function() {
|
|
|
31718
31728
|
});
|
|
31719
31729
|
}, e;
|
|
31720
31730
|
}(), g0 = Object.freeze({ browserFiles: function(e) {
|
|
31721
|
-
return new
|
|
31731
|
+
return new aA(e);
|
|
31722
31732
|
}, browserHTTPRequest: function(e, n) {
|
|
31723
31733
|
return Hc(e, n);
|
|
31724
31734
|
}, concatenateArrayBuffers: nf, decodeWeights: d0, encodeWeights: function(e, n) {
|
|
@@ -31779,7 +31789,7 @@ var ec = function() {
|
|
|
31779
31789
|
}, registerSaveRouter: function(e) {
|
|
31780
31790
|
return Xn.registerSaveRouter(e);
|
|
31781
31791
|
}, weightsLoaderFactory: Vp, withSaveHandler: function(e) {
|
|
31782
|
-
return new
|
|
31792
|
+
return new iA(e);
|
|
31783
31793
|
}, copyModel: function(e, n) {
|
|
31784
31794
|
return Me(this, void 0, void 0, function() {
|
|
31785
31795
|
return Fe(this, function(t) {
|
|
@@ -31835,7 +31845,7 @@ $({ confusionMatrix_: function(e, n, t) {
|
|
|
31835
31845
|
var a = Bc(r.asType("int32"), t), i = Bc(o.asType("int32"), t);
|
|
31836
31846
|
return a.transpose().matMul(i).asType("int32");
|
|
31837
31847
|
} });
|
|
31838
|
-
var
|
|
31848
|
+
var sA = $({ fromPixels_: function(e, n) {
|
|
31839
31849
|
if (n === void 0 && (n = 3), n > 4) throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");
|
|
31840
31850
|
if (e == null) throw new Error("pixels passed to tf.browser.fromPixels() can not be null");
|
|
31841
31851
|
var t = !1, r = !1, o = !1, a = !1, i = !1;
|
|
@@ -31881,7 +31891,7 @@ var s6 = $({ fromPixels_: function(e, n) {
|
|
|
31881
31891
|
}
|
|
31882
31892
|
});
|
|
31883
31893
|
});
|
|
31884
|
-
}, fromPixels:
|
|
31894
|
+
}, fromPixels: sA }), uA = function() {
|
|
31885
31895
|
function e() {
|
|
31886
31896
|
}
|
|
31887
31897
|
return e.prototype.getClassName = function() {
|
|
@@ -31889,7 +31899,7 @@ var s6 = $({ fromPixels_: function(e, n) {
|
|
|
31889
31899
|
}, e.fromConfig = function(n, t) {
|
|
31890
31900
|
return new n(t);
|
|
31891
31901
|
}, e;
|
|
31892
|
-
}(),
|
|
31902
|
+
}(), lA = function() {
|
|
31893
31903
|
function e() {
|
|
31894
31904
|
this.classNameMap = {};
|
|
31895
31905
|
}
|
|
@@ -31906,7 +31916,7 @@ function Go(e) {
|
|
|
31906
31916
|
return "className is required to be a string, but got type " + typeof e.className;
|
|
31907
31917
|
}), B(e.className.length > 0, function() {
|
|
31908
31918
|
return "Class being registered has an empty-string as its className, which is disallowed.";
|
|
31909
|
-
}),
|
|
31919
|
+
}), lA.register(e);
|
|
31910
31920
|
}
|
|
31911
31921
|
var Ko = function(e) {
|
|
31912
31922
|
function n() {
|
|
@@ -31961,11 +31971,11 @@ var Ko = function(e) {
|
|
|
31961
31971
|
});
|
|
31962
31972
|
});
|
|
31963
31973
|
}, n;
|
|
31964
|
-
}(
|
|
31974
|
+
}(uA);
|
|
31965
31975
|
Object.defineProperty(Ko, Symbol.hasInstance, { value: function(e) {
|
|
31966
31976
|
return e.minimize != null && e.computeGradients != null && e.applyGradients != null;
|
|
31967
31977
|
} });
|
|
31968
|
-
var
|
|
31978
|
+
var cA = function(e) {
|
|
31969
31979
|
function n(t, r, o) {
|
|
31970
31980
|
o === void 0 && (o = null);
|
|
31971
31981
|
var a = e.call(this) || this;
|
|
@@ -32035,8 +32045,8 @@ var c6 = function(e) {
|
|
|
32035
32045
|
return new t(r.learningRate, r.rho, r.epsilon);
|
|
32036
32046
|
}, n.className = "Adadelta", n;
|
|
32037
32047
|
}(Ko);
|
|
32038
|
-
Go(
|
|
32039
|
-
var
|
|
32048
|
+
Go(cA);
|
|
32049
|
+
var dA = function(e) {
|
|
32040
32050
|
function n(t, r) {
|
|
32041
32051
|
r === void 0 && (r = 0.1);
|
|
32042
32052
|
var o = e.call(this) || this;
|
|
@@ -32098,8 +32108,8 @@ var d6 = function(e) {
|
|
|
32098
32108
|
return new t(r.learningRate, r.initialAccumulatorValue);
|
|
32099
32109
|
}, n.className = "Adagrad", n;
|
|
32100
32110
|
}(Ko);
|
|
32101
|
-
Go(
|
|
32102
|
-
var
|
|
32111
|
+
Go(dA);
|
|
32112
|
+
var fA = function(e) {
|
|
32103
32113
|
function n(t, r, o, a) {
|
|
32104
32114
|
a === void 0 && (a = null);
|
|
32105
32115
|
var i = e.call(this) || this;
|
|
@@ -32173,8 +32183,8 @@ var f6 = function(e) {
|
|
|
32173
32183
|
return new t(r.learningRate, r.beta1, r.beta2, r.epsilon);
|
|
32174
32184
|
}, n.className = "Adam", n;
|
|
32175
32185
|
}(Ko);
|
|
32176
|
-
Go(
|
|
32177
|
-
var
|
|
32186
|
+
Go(fA);
|
|
32187
|
+
var hA = function(e) {
|
|
32178
32188
|
function n(t, r, o, a, i) {
|
|
32179
32189
|
a === void 0 && (a = null), i === void 0 && (i = 0);
|
|
32180
32190
|
var s = e.call(this) || this;
|
|
@@ -32224,7 +32234,7 @@ var h6 = function(e) {
|
|
|
32224
32234
|
return new t(r.learningRate, r.beta1, r.beta2, r.epsilon, r.decay);
|
|
32225
32235
|
}, n.className = "Adamax", n;
|
|
32226
32236
|
}(Ko);
|
|
32227
|
-
Go(
|
|
32237
|
+
Go(hA);
|
|
32228
32238
|
var y0 = function(e) {
|
|
32229
32239
|
function n(t) {
|
|
32230
32240
|
var r = e.call(this) || this;
|
|
@@ -32278,7 +32288,7 @@ var y0 = function(e) {
|
|
|
32278
32288
|
}, n.className = "SGD", n;
|
|
32279
32289
|
}(Ko);
|
|
32280
32290
|
Go(y0);
|
|
32281
|
-
var
|
|
32291
|
+
var pA = function(e) {
|
|
32282
32292
|
function n(t, r, o) {
|
|
32283
32293
|
o === void 0 && (o = !1);
|
|
32284
32294
|
var a = e.call(this, t) || this;
|
|
@@ -32337,8 +32347,8 @@ var p6 = function(e) {
|
|
|
32337
32347
|
return new t(r.learningRate, r.momentum, r.useNesterov);
|
|
32338
32348
|
}, n.className = "Momentum", n;
|
|
32339
32349
|
}(y0);
|
|
32340
|
-
Go(
|
|
32341
|
-
var
|
|
32350
|
+
Go(pA);
|
|
32351
|
+
var vA = function(e) {
|
|
32342
32352
|
function n(t, r, o, a, i) {
|
|
32343
32353
|
r === void 0 && (r = 0.9), o === void 0 && (o = 0), a === void 0 && (a = null), i === void 0 && (i = !1);
|
|
32344
32354
|
var s = e.call(this) || this;
|
|
@@ -32421,7 +32431,7 @@ var v6 = function(e) {
|
|
|
32421
32431
|
return new t(r.learningRate, r.decay, r.momentum, r.epsilon, r.centered);
|
|
32422
32432
|
}, n.className = "RMSProp", n;
|
|
32423
32433
|
}(Ko);
|
|
32424
|
-
Go(
|
|
32434
|
+
Go(vA);
|
|
32425
32435
|
Ht.prototype.squaredDifference = function(e) {
|
|
32426
32436
|
return Fg(this, e);
|
|
32427
32437
|
}, ee = zT;
|
|
@@ -32596,7 +32606,7 @@ var Oo = (
|
|
|
32596
32606
|
function Fu(e, n) {
|
|
32597
32607
|
return e instanceof Ht && e.shape.length === n;
|
|
32598
32608
|
}
|
|
32599
|
-
function
|
|
32609
|
+
function mA(e) {
|
|
32600
32610
|
return Fu(e, 2);
|
|
32601
32611
|
}
|
|
32602
32612
|
function Pu(e) {
|
|
@@ -32605,7 +32615,7 @@ function Pu(e) {
|
|
|
32605
32615
|
function co(e) {
|
|
32606
32616
|
return Fu(e, 4);
|
|
32607
32617
|
}
|
|
32608
|
-
function
|
|
32618
|
+
function gA(e) {
|
|
32609
32619
|
return e % 1 !== 0;
|
|
32610
32620
|
}
|
|
32611
32621
|
function $p(e) {
|
|
@@ -32619,7 +32629,7 @@ function b0(e, n) {
|
|
|
32619
32629
|
function Wp(e) {
|
|
32620
32630
|
return e && e.width && e.height;
|
|
32621
32631
|
}
|
|
32622
|
-
function
|
|
32632
|
+
function yA(e, n) {
|
|
32623
32633
|
var t = e.width, r = e.height, o = n / Math.max(r, t);
|
|
32624
32634
|
return new Oo(Math.round(t * o), Math.round(r * o));
|
|
32625
32635
|
}
|
|
@@ -32896,12 +32906,12 @@ var _t = (
|
|
|
32896
32906
|
}, n;
|
|
32897
32907
|
}(w0)
|
|
32898
32908
|
);
|
|
32899
|
-
function
|
|
32909
|
+
function bA(e, n, t) {
|
|
32900
32910
|
t === void 0 && (t = !0);
|
|
32901
32911
|
var r = Math.max(0, Math.min(e.right, n.right) - Math.max(e.left, n.left)), o = Math.max(0, Math.min(e.bottom, n.bottom) - Math.max(e.top, n.top)), a = r * o;
|
|
32902
32912
|
return t ? a / (e.area + n.area - a) : a / Math.min(e.area, n.area);
|
|
32903
32913
|
}
|
|
32904
|
-
function
|
|
32914
|
+
function wA(e) {
|
|
32905
32915
|
var n = e.map(function(s) {
|
|
32906
32916
|
return s.x;
|
|
32907
32917
|
}), t = e.map(function(s) {
|
|
@@ -32930,7 +32940,7 @@ function yi(e, n, t, r) {
|
|
|
32930
32940
|
a.push(s);
|
|
32931
32941
|
for (var u = o, l = [], c = 0; c < u.length; c++) {
|
|
32932
32942
|
var d = u[c], f = e[s], h = e[d];
|
|
32933
|
-
l.push(
|
|
32943
|
+
l.push(bA(f, h, r));
|
|
32934
32944
|
}
|
|
32935
32945
|
o = o.filter(function(p, m) {
|
|
32936
32946
|
return l[m] <= t;
|
|
@@ -32945,7 +32955,7 @@ function qi(e, n) {
|
|
|
32945
32955
|
return un(e, u);
|
|
32946
32956
|
});
|
|
32947
32957
|
}
|
|
32948
|
-
function
|
|
32958
|
+
function xA(e, n) {
|
|
32949
32959
|
return n === void 0 && (n = !1), Re(function() {
|
|
32950
32960
|
var t = e.shape.slice(1), r = t[0], o = t[1];
|
|
32951
32961
|
if (r === o)
|
|
@@ -32977,7 +32987,7 @@ var Ou = (
|
|
|
32977
32987
|
}
|
|
32978
32988
|
return n;
|
|
32979
32989
|
}(Ar)
|
|
32980
|
-
),
|
|
32990
|
+
), CA = 0.5, kA = 0.43, _A = 0.45, Ba = (
|
|
32981
32991
|
/** @class */
|
|
32982
32992
|
function() {
|
|
32983
32993
|
function e(n, t, r) {
|
|
@@ -33036,16 +33046,16 @@ var Ou = (
|
|
|
33036
33046
|
}, e.prototype.alignDlib = function() {
|
|
33037
33047
|
var n = this.getRefPointsForAlignment(), t = n[0], r = n[1], o = n[2], a = function(d) {
|
|
33038
33048
|
return o.sub(d).magnitude();
|
|
33039
|
-
}, i = (a(t) + a(r)) / 2, s = Math.floor(i /
|
|
33049
|
+
}, i = (a(t) + a(r)) / 2, s = Math.floor(i / _A), u = of(n), l = Math.floor(Math.max(0, u.x - CA * s)), c = Math.floor(Math.max(0, u.y - kA * s));
|
|
33040
33050
|
return new Ou(l, c, Math.min(s, this.imageWidth + l), Math.min(s, this.imageHeight + c));
|
|
33041
33051
|
}, e.prototype.alignMinBbox = function(n) {
|
|
33042
|
-
var t =
|
|
33052
|
+
var t = wA(this.positions);
|
|
33043
33053
|
return t.pad(t.width * n, t.height * n);
|
|
33044
33054
|
}, e.prototype.getRefPointsForAlignment = function() {
|
|
33045
33055
|
throw new Error("getRefPointsForAlignment not implemented by base class");
|
|
33046
33056
|
}, e;
|
|
33047
33057
|
}()
|
|
33048
|
-
),
|
|
33058
|
+
), SA = (
|
|
33049
33059
|
/** @class */
|
|
33050
33060
|
function(e) {
|
|
33051
33061
|
nt(n, e);
|
|
@@ -33298,7 +33308,7 @@ function E0() {
|
|
|
33298
33308
|
return typeof global == "object" && typeof require == "function" && typeof module < "u" && typeof process < "u" && !!process.version;
|
|
33299
33309
|
}
|
|
33300
33310
|
var nn;
|
|
33301
|
-
function
|
|
33311
|
+
function EA() {
|
|
33302
33312
|
if (!nn)
|
|
33303
33313
|
throw new Error("getEnv - environment is not defined, check isNodejs() and isBrowser()");
|
|
33304
33314
|
return nn;
|
|
@@ -33309,7 +33319,7 @@ function jc(e) {
|
|
|
33309
33319
|
function af() {
|
|
33310
33320
|
S0() && jc(C0()), E0() && jc(_0());
|
|
33311
33321
|
}
|
|
33312
|
-
function
|
|
33322
|
+
function RA(e) {
|
|
33313
33323
|
if (nn || af(), !nn)
|
|
33314
33324
|
throw new Error("monkeyPatch - environment is not defined, check isNodejs() and isBrowser()");
|
|
33315
33325
|
var n = e.Canvas, t = n === void 0 ? nn.Canvas : n, r = e.Image, o = r === void 0 ? nn.Image : r;
|
|
@@ -33320,13 +33330,13 @@ function R6(e) {
|
|
|
33320
33330
|
}, nn.ImageData = e.ImageData || nn.ImageData, nn.Video = e.Video || nn.Video, nn.fetch = e.fetch || nn.fetch, nn.readFile = e.readFile || nn.readFile;
|
|
33321
33331
|
}
|
|
33322
33332
|
var Mn = {
|
|
33323
|
-
getEnv:
|
|
33333
|
+
getEnv: EA,
|
|
33324
33334
|
setEnv: jc,
|
|
33325
33335
|
initialize: af,
|
|
33326
33336
|
createBrowserEnv: C0,
|
|
33327
33337
|
createFileSystem: k0,
|
|
33328
33338
|
createNodejsEnv: _0,
|
|
33329
|
-
monkeyPatch:
|
|
33339
|
+
monkeyPatch: RA,
|
|
33330
33340
|
isBrowser: S0,
|
|
33331
33341
|
isNodejs: E0
|
|
33332
33342
|
};
|
|
@@ -33360,7 +33370,7 @@ var R0 = (
|
|
|
33360
33370
|
}
|
|
33361
33371
|
return e;
|
|
33362
33372
|
}()
|
|
33363
|
-
),
|
|
33373
|
+
), IA = (
|
|
33364
33374
|
/** @class */
|
|
33365
33375
|
function() {
|
|
33366
33376
|
function e(n, t, r) {
|
|
@@ -33395,7 +33405,7 @@ var R0 = (
|
|
|
33395
33405
|
});
|
|
33396
33406
|
}, e;
|
|
33397
33407
|
}()
|
|
33398
|
-
),
|
|
33408
|
+
), TA = (
|
|
33399
33409
|
/** @class */
|
|
33400
33410
|
/* @__PURE__ */ function() {
|
|
33401
33411
|
function e(n) {
|
|
@@ -33410,32 +33420,32 @@ var R0 = (
|
|
|
33410
33420
|
}
|
|
33411
33421
|
return e;
|
|
33412
33422
|
}()
|
|
33413
|
-
),
|
|
33423
|
+
), AA = (
|
|
33414
33424
|
/** @class */
|
|
33415
33425
|
function() {
|
|
33416
33426
|
function e(n, t) {
|
|
33417
|
-
t === void 0 && (t = {}), this.box = new Ar(n), this.options = new
|
|
33427
|
+
t === void 0 && (t = {}), this.box = new Ar(n), this.options = new TA(t);
|
|
33418
33428
|
}
|
|
33419
33429
|
return e.prototype.draw = function(n) {
|
|
33420
33430
|
var t = Dr(n), r = this.options, o = r.boxColor, a = r.lineWidth, i = this.box, s = i.x, u = i.y, l = i.width, c = i.height;
|
|
33421
33431
|
t.strokeStyle = o, t.lineWidth = a, t.strokeRect(s, u, l, c);
|
|
33422
33432
|
var d = this.options.label;
|
|
33423
|
-
d && new
|
|
33433
|
+
d && new IA([d], { x: s - a / 2, y: u }, this.options.drawLabelOptions).draw(n);
|
|
33424
33434
|
}, e;
|
|
33425
33435
|
}()
|
|
33426
33436
|
);
|
|
33427
|
-
function
|
|
33437
|
+
function DA(e, n) {
|
|
33428
33438
|
var t = Array.isArray(n) ? n : [n];
|
|
33429
33439
|
t.forEach(function(r) {
|
|
33430
33440
|
var o = r instanceof er ? r.score : tu(r) ? r.detection.score : void 0, a = r instanceof er ? r.box : tu(r) ? r.detection.box : new Ar(r), i = o ? "" + b0(o) : void 0;
|
|
33431
|
-
new
|
|
33441
|
+
new AA(a, { label: i }).draw(e);
|
|
33432
33442
|
});
|
|
33433
33443
|
}
|
|
33434
33444
|
function I0(e) {
|
|
33435
33445
|
var n = Mn.getEnv(), t = n.Image, r = n.Video;
|
|
33436
33446
|
return e instanceof t && e.complete || e instanceof r && e.readyState >= 3;
|
|
33437
33447
|
}
|
|
33438
|
-
function
|
|
33448
|
+
function MA(e) {
|
|
33439
33449
|
return new Promise(function(n, t) {
|
|
33440
33450
|
if (e instanceof Mn.getEnv().Canvas || I0(e))
|
|
33441
33451
|
return n();
|
|
@@ -33463,7 +33473,7 @@ function Lu(e, n) {
|
|
|
33463
33473
|
var r = uf(e), o = r.width, a = r.height, i = Nu({ width: o, height: a });
|
|
33464
33474
|
return e instanceof t ? Dr(i).putImageData(e, 0, 0) : Dr(i).drawImage(e, 0, 0, o, a), i;
|
|
33465
33475
|
}
|
|
33466
|
-
function
|
|
33476
|
+
function FA(e, n) {
|
|
33467
33477
|
return Le(this, void 0, void 0, function() {
|
|
33468
33478
|
var t, r, o, a, i, s;
|
|
33469
33479
|
return qe(this, function(u) {
|
|
@@ -33482,7 +33492,7 @@ function Gp(e) {
|
|
|
33482
33492
|
var n = Mn.getEnv(), t = n.Image, r = n.Canvas, o = n.Video;
|
|
33483
33493
|
return e instanceof t || e instanceof r || e instanceof o;
|
|
33484
33494
|
}
|
|
33485
|
-
function
|
|
33495
|
+
function PA(e, n, t) {
|
|
33486
33496
|
t === void 0 && (t = !1);
|
|
33487
33497
|
var r = Mn.getEnv(), o = r.Image, a = r.Canvas;
|
|
33488
33498
|
if (!(e instanceof o || e instanceof a))
|
|
@@ -33570,7 +33580,7 @@ var nu = (
|
|
|
33570
33580
|
if (typeof this.inputSize != "number")
|
|
33571
33581
|
throw new Error("getReshapedInputDimensions - inputSize not set, toBatchTensor has not been called yet");
|
|
33572
33582
|
var t = this.getInputWidth(n), r = this.getInputHeight(n);
|
|
33573
|
-
return
|
|
33583
|
+
return yA({ width: t, height: r }, this.inputSize);
|
|
33574
33584
|
}, e.prototype.toBatchTensor = function(n, t) {
|
|
33575
33585
|
var r = this;
|
|
33576
33586
|
return t === void 0 && (t = !0), this._inputSize = n, Re(function() {
|
|
@@ -33578,10 +33588,10 @@ var nu = (
|
|
|
33578
33588
|
var s = r.getInput(i);
|
|
33579
33589
|
if (s instanceof Ht) {
|
|
33580
33590
|
var u = co(s) ? s : s.expandDims();
|
|
33581
|
-
return u =
|
|
33591
|
+
return u = xA(u, t), (u.shape[1] !== n || u.shape[2] !== n) && (u = Qd.resizeBilinear(u, [n, n])), u.as3D(n, n, 3);
|
|
33582
33592
|
}
|
|
33583
33593
|
if (s instanceof Mn.getEnv().Canvas)
|
|
33584
|
-
return rf.fromPixels(
|
|
33594
|
+
return rf.fromPixels(PA(s, n, t));
|
|
33585
33595
|
throw new Error("toBatchTensor - at batchIdx " + i + ", expected input to be instanceof tf.Tensor or instanceof HTMLCanvasElement, instead have " + s);
|
|
33586
33596
|
}), a = Zn(o.map(function(i) {
|
|
33587
33597
|
return i.toFloat();
|
|
@@ -33612,7 +33622,7 @@ function mn(e) {
|
|
|
33612
33622
|
throw new Error("toNetInput -" + t(i) + " tf.Tensor4D with batchSize " + s + " passed, but not supported in input array");
|
|
33613
33623
|
}
|
|
33614
33624
|
}), [4, Promise.all(r.map(function(a) {
|
|
33615
|
-
return Gp(a) &&
|
|
33625
|
+
return Gp(a) && MA(a);
|
|
33616
33626
|
}))];
|
|
33617
33627
|
case 1:
|
|
33618
33628
|
return o.sent(), [2, new nu(r, Array.isArray(e))];
|
|
@@ -33632,7 +33642,7 @@ function qu(e, n) {
|
|
|
33632
33642
|
throw new Error("extractFaces - batchSize > 1 not supported");
|
|
33633
33643
|
return a = o.getInput(0), a instanceof t ? (i = a, [3, 4]) : [3, 2];
|
|
33634
33644
|
case 2:
|
|
33635
|
-
return [4,
|
|
33645
|
+
return [4, FA(a)];
|
|
33636
33646
|
case 3:
|
|
33637
33647
|
i = l.sent(), l.label = 4;
|
|
33638
33648
|
case 4:
|
|
@@ -33671,7 +33681,7 @@ function lf(e, n) {
|
|
|
33671
33681
|
});
|
|
33672
33682
|
});
|
|
33673
33683
|
}
|
|
33674
|
-
function
|
|
33684
|
+
function BA(e, n) {
|
|
33675
33685
|
return Le(this, void 0, void 0, function() {
|
|
33676
33686
|
var t, r;
|
|
33677
33687
|
return qe(this, function(o) {
|
|
@@ -33686,12 +33696,12 @@ function B6(e, n) {
|
|
|
33686
33696
|
});
|
|
33687
33697
|
});
|
|
33688
33698
|
}
|
|
33689
|
-
function
|
|
33699
|
+
function OA(e) {
|
|
33690
33700
|
return Le(this, void 0, void 0, function() {
|
|
33691
33701
|
return qe(this, function(n) {
|
|
33692
33702
|
switch (n.label) {
|
|
33693
33703
|
case 0:
|
|
33694
|
-
return [4,
|
|
33704
|
+
return [4, BA(e)];
|
|
33695
33705
|
case 1:
|
|
33696
33706
|
return [2, n.sent().json()];
|
|
33697
33707
|
}
|
|
@@ -33720,20 +33730,20 @@ function T0(e, n) {
|
|
|
33720
33730
|
manifestUri: i === "/" ? "/" + a : i + "/" + a
|
|
33721
33731
|
};
|
|
33722
33732
|
}
|
|
33723
|
-
function
|
|
33733
|
+
function NA(e, n) {
|
|
33724
33734
|
return Le(this, void 0, void 0, function() {
|
|
33725
33735
|
var t, r, o, a;
|
|
33726
33736
|
return qe(this, function(i) {
|
|
33727
33737
|
switch (i.label) {
|
|
33728
33738
|
case 0:
|
|
33729
|
-
return t = T0(e, n), r = t.manifestUri, o = t.modelBaseUri, [4,
|
|
33739
|
+
return t = T0(e, n), r = t.manifestUri, o = t.modelBaseUri, [4, OA(r)];
|
|
33730
33740
|
case 1:
|
|
33731
33741
|
return a = i.sent(), [2, g0.loadWeights(a, o)];
|
|
33732
33742
|
}
|
|
33733
33743
|
});
|
|
33734
33744
|
});
|
|
33735
33745
|
}
|
|
33736
|
-
function
|
|
33746
|
+
function LA(e, n, t) {
|
|
33737
33747
|
t === void 0 && (t = !1);
|
|
33738
33748
|
var r = t ? uf(n) : n, o = r.width, a = r.height;
|
|
33739
33749
|
return e.width = o, e.height = a, { width: o, height: a };
|
|
@@ -33835,7 +33845,7 @@ var Kr = (
|
|
|
33835
33845
|
case 0:
|
|
33836
33846
|
if (n && typeof n != "string")
|
|
33837
33847
|
throw new Error(this._name + ".loadFromUri - expected model uri");
|
|
33838
|
-
return [4,
|
|
33848
|
+
return [4, NA(n, this.getDefaultModelName())];
|
|
33839
33849
|
case 1:
|
|
33840
33850
|
return t = r.sent(), this.loadFromWeightMap(t), [
|
|
33841
33851
|
2
|
|
@@ -33995,7 +34005,7 @@ function D0(e, n) {
|
|
|
33995
34005
|
extractDenseBlock4Params: a
|
|
33996
34006
|
};
|
|
33997
34007
|
}
|
|
33998
|
-
function
|
|
34008
|
+
function qA(e) {
|
|
33999
34009
|
var n = [], t = Xr(e), r = t.extractWeights, o = t.getRemainingWeights, a = D0(r, n).extractDenseBlock4Params, i = a(3, 32, "dense0", !0), s = a(32, 64, "dense1"), u = a(64, 128, "dense2"), l = a(128, 256, "dense3");
|
|
34000
34010
|
if (o().length !== 0)
|
|
34001
34011
|
throw new Error("weights remaing after extract: " + o().length);
|
|
@@ -34027,7 +34037,7 @@ function F0(e, n) {
|
|
|
34027
34037
|
extractDenseBlock4Params: i
|
|
34028
34038
|
};
|
|
34029
34039
|
}
|
|
34030
|
-
function
|
|
34040
|
+
function VA(e) {
|
|
34031
34041
|
var n = [], t = F0(e, n).extractDenseBlock4Params, r = {
|
|
34032
34042
|
dense0: t("dense0", !0),
|
|
34033
34043
|
dense1: t("dense1"),
|
|
@@ -34066,9 +34076,9 @@ var P0 = (
|
|
|
34066
34076
|
}, n.prototype.getDefaultModelName = function() {
|
|
34067
34077
|
return "face_feature_extractor_model";
|
|
34068
34078
|
}, n.prototype.extractParamsFromWeigthMap = function(t) {
|
|
34069
|
-
return
|
|
34079
|
+
return VA(t);
|
|
34070
34080
|
}, n.prototype.extractParams = function(t) {
|
|
34071
|
-
return
|
|
34081
|
+
return qA(t);
|
|
34072
34082
|
}, n;
|
|
34073
34083
|
}(Kr)
|
|
34074
34084
|
);
|
|
@@ -34077,7 +34087,7 @@ function Sr(e, n) {
|
|
|
34077
34087
|
return ft(Au(e, n.weights), n.bias);
|
|
34078
34088
|
});
|
|
34079
34089
|
}
|
|
34080
|
-
function
|
|
34090
|
+
function zA(e, n, t) {
|
|
34081
34091
|
var r = [], o = Xr(e), a = o.extractWeights, i = o.getRemainingWeights, s = cf(a, r), u = s(n, t, "fc");
|
|
34082
34092
|
if (i().length !== 0)
|
|
34083
34093
|
throw new Error("weights remaing after extract: " + i().length);
|
|
@@ -34086,7 +34096,7 @@ function z6(e, n, t) {
|
|
|
34086
34096
|
params: { fc: u }
|
|
34087
34097
|
};
|
|
34088
34098
|
}
|
|
34089
|
-
function $
|
|
34099
|
+
function $A(e) {
|
|
34090
34100
|
var n = [], t = go(e, n);
|
|
34091
34101
|
function r(a) {
|
|
34092
34102
|
var i = t(a + "/weights", 2), s = t(a + "/bias", 1);
|
|
@@ -34132,16 +34142,16 @@ var O0 = (
|
|
|
34132
34142
|
var r = this.extractClassifierParams(t), o = r.params, a = r.paramMappings;
|
|
34133
34143
|
this._params = o, this._paramMappings = a;
|
|
34134
34144
|
}, n.prototype.extractClassifierParams = function(t) {
|
|
34135
|
-
return
|
|
34145
|
+
return zA(t, this.getClassifierChannelsIn(), this.getClassifierChannelsOut());
|
|
34136
34146
|
}, n.prototype.extractParamsFromWeigthMap = function(t) {
|
|
34137
34147
|
var r = B0(t), o = r.featureExtractorMap, a = r.classifierMap;
|
|
34138
|
-
return this.faceFeatureExtractor.loadFromWeightMap(o), $
|
|
34148
|
+
return this.faceFeatureExtractor.loadFromWeightMap(o), $A(a);
|
|
34139
34149
|
}, n.prototype.extractParams = function(t) {
|
|
34140
34150
|
var r = this.getClassifierChannelsIn(), o = this.getClassifierChannelsOut(), a = o * r + o, i = t.slice(0, t.length - a), s = t.slice(t.length - a);
|
|
34141
34151
|
return this.faceFeatureExtractor.extractWeights(i), this.extractClassifierParams(s);
|
|
34142
34152
|
}, n;
|
|
34143
34153
|
}(Kr)
|
|
34144
|
-
), Kp = ["neutral", "happy", "sad", "angry", "fearful", "disgusted", "surprised"],
|
|
34154
|
+
), Kp = ["neutral", "happy", "sad", "angry", "fearful", "disgusted", "surprised"], WA = (
|
|
34145
34155
|
/** @class */
|
|
34146
34156
|
function() {
|
|
34147
34157
|
function e(n) {
|
|
@@ -34161,7 +34171,7 @@ var O0 = (
|
|
|
34161
34171
|
});
|
|
34162
34172
|
}, e;
|
|
34163
34173
|
}()
|
|
34164
|
-
),
|
|
34174
|
+
), HA = (
|
|
34165
34175
|
/** @class */
|
|
34166
34176
|
function(e) {
|
|
34167
34177
|
nt(n, e);
|
|
@@ -34210,7 +34220,7 @@ var O0 = (
|
|
|
34210
34220
|
}))];
|
|
34211
34221
|
case 3:
|
|
34212
34222
|
return a = u.sent(), o.dispose(), i = a.map(function(l) {
|
|
34213
|
-
return new
|
|
34223
|
+
return new WA(l);
|
|
34214
34224
|
}), [2, r.isBatchInput ? i : i[0]];
|
|
34215
34225
|
}
|
|
34216
34226
|
});
|
|
@@ -34239,7 +34249,7 @@ function zu(e, n) {
|
|
|
34239
34249
|
};
|
|
34240
34250
|
return Object.assign({}, e, s);
|
|
34241
34251
|
}
|
|
34242
|
-
var
|
|
34252
|
+
var UA = (
|
|
34243
34253
|
/** @class */
|
|
34244
34254
|
/* @__PURE__ */ function() {
|
|
34245
34255
|
function e(n) {
|
|
@@ -34249,11 +34259,11 @@ var U6 = (
|
|
|
34249
34259
|
}
|
|
34250
34260
|
return e;
|
|
34251
34261
|
}()
|
|
34252
|
-
),
|
|
34262
|
+
), jA = (
|
|
34253
34263
|
/** @class */
|
|
34254
34264
|
function() {
|
|
34255
34265
|
function e(n, t) {
|
|
34256
|
-
t === void 0 && (t = {}), this.faceLandmarks = n, this.options = new
|
|
34266
|
+
t === void 0 && (t = {}), this.faceLandmarks = n, this.options = new UA(t);
|
|
34257
34267
|
}
|
|
34258
34268
|
return e.prototype.draw = function(n) {
|
|
34259
34269
|
var t = Dr(n), r = this.options, o = r.drawLines, a = r.drawPoints, i = r.lineWidth, s = r.lineColor, u = r.pointSize, l = r.pointColor;
|
|
@@ -34267,16 +34277,16 @@ var U6 = (
|
|
|
34267
34277
|
}, e;
|
|
34268
34278
|
}()
|
|
34269
34279
|
);
|
|
34270
|
-
function
|
|
34280
|
+
function GA(e, n) {
|
|
34271
34281
|
var t = Array.isArray(n) ? n : [n];
|
|
34272
34282
|
t.forEach(function(r) {
|
|
34273
34283
|
var o = r instanceof Ba ? r : hf(r) ? r.landmarks : void 0;
|
|
34274
34284
|
if (!o)
|
|
34275
34285
|
throw new Error("drawFaceLandmarks - expected faceExpressions to be FaceLandmarks | WithFaceLandmarks<WithFaceDetection<{}>> or array thereof");
|
|
34276
|
-
new
|
|
34286
|
+
new jA(o).draw(e);
|
|
34277
34287
|
});
|
|
34278
34288
|
}
|
|
34279
|
-
function
|
|
34289
|
+
function KA(e, n) {
|
|
34280
34290
|
var t = Vu(e, n), r = df(e, n);
|
|
34281
34291
|
function o(i, s, u) {
|
|
34282
34292
|
var l = r(i, s, u + "/separable_conv0"), c = r(s, s, u + "/separable_conv1"), d = t(i, s, 1, u + "/expansion_conv");
|
|
@@ -34293,8 +34303,8 @@ function K6(e, n) {
|
|
|
34293
34303
|
extractMainBlockParams: a
|
|
34294
34304
|
};
|
|
34295
34305
|
}
|
|
34296
|
-
function
|
|
34297
|
-
var t = [], r = Xr(e), o = r.extractWeights, a = r.getRemainingWeights, i =
|
|
34306
|
+
function YA(e, n) {
|
|
34307
|
+
var t = [], r = Xr(e), o = r.extractWeights, a = r.getRemainingWeights, i = KA(o, t), s = i.extractConvParams, u = i.extractSeparableConvParams, l = i.extractReductionBlockParams, c = i.extractMainBlockParams, d = s(3, 32, 3, "entry_flow/conv_in"), f = l(32, 64, "entry_flow/reduction_block_0"), h = l(64, 128, "entry_flow/reduction_block_1"), p = {
|
|
34298
34308
|
conv_in: d,
|
|
34299
34309
|
reduction_block_0: f,
|
|
34300
34310
|
reduction_block_1: h
|
|
@@ -34313,7 +34323,7 @@ function Y6(e, n) {
|
|
|
34313
34323
|
params: { entry_flow: p, middle_flow: m, exit_flow: w }
|
|
34314
34324
|
};
|
|
34315
34325
|
}
|
|
34316
|
-
function
|
|
34326
|
+
function XA(e, n) {
|
|
34317
34327
|
var t = go(e, n), r = M0(t), o = ff(t);
|
|
34318
34328
|
function a(s) {
|
|
34319
34329
|
var u = o(s + "/separable_conv0"), l = o(s + "/separable_conv1"), c = r(s + "/expansion_conv");
|
|
@@ -34330,8 +34340,8 @@ function X6(e, n) {
|
|
|
34330
34340
|
extractMainBlockParams: i
|
|
34331
34341
|
};
|
|
34332
34342
|
}
|
|
34333
|
-
function
|
|
34334
|
-
var t = [], r =
|
|
34343
|
+
function QA(e, n) {
|
|
34344
|
+
var t = [], r = XA(e, t), o = r.extractConvParams, a = r.extractSeparableConvParams, i = r.extractReductionBlockParams, s = r.extractMainBlockParams, u = o("entry_flow/conv_in"), l = i("entry_flow/reduction_block_0"), c = i("entry_flow/reduction_block_1"), d = {
|
|
34335
34345
|
conv_in: u,
|
|
34336
34346
|
reduction_block_0: l,
|
|
34337
34347
|
reduction_block_1: c
|
|
@@ -34353,11 +34363,11 @@ function rc(e, n, t) {
|
|
|
34353
34363
|
var r = t ? Ut(e) : e;
|
|
34354
34364
|
return r = Qn(r, n.separable_conv0, [1, 1]), r = Qn(Ut(r), n.separable_conv1, [1, 1]), r = dn(r, [3, 3], [2, 2], "same"), r = ft(r, L0(e, n.expansion_conv, [2, 2])), r;
|
|
34355
34365
|
}
|
|
34356
|
-
function
|
|
34366
|
+
function ZA(e, n) {
|
|
34357
34367
|
var t = Qn(Ut(e), n.separable_conv0, [1, 1]);
|
|
34358
34368
|
return t = Qn(Ut(t), n.separable_conv1, [1, 1]), t = Qn(Ut(t), n.separable_conv2, [1, 1]), t = ft(t, e), t;
|
|
34359
34369
|
}
|
|
34360
|
-
var
|
|
34370
|
+
var JA = (
|
|
34361
34371
|
/** @class */
|
|
34362
34372
|
function(e) {
|
|
34363
34373
|
nt(n, e);
|
|
@@ -34372,7 +34382,7 @@ var J6 = (
|
|
|
34372
34382
|
return Re(function() {
|
|
34373
34383
|
var a = t.toBatchTensor(112, !0), i = [122.782, 117.001, 104.298], s = qi(a, i).div(Ce(256)), u = Ut(L0(s, o.entry_flow.conv_in, [2, 2]));
|
|
34374
34384
|
return u = rc(u, o.entry_flow.reduction_block_0, !1), u = rc(u, o.entry_flow.reduction_block_1), gi(r._numMainBlocks, 0, 1).forEach(function(l) {
|
|
34375
|
-
u =
|
|
34385
|
+
u = ZA(u, o.middle_flow["main_block_" + l]);
|
|
34376
34386
|
}), u = rc(u, o.exit_flow.reduction_block), u = Ut(Qn(u, o.exit_flow.separable_conv, [1, 1])), u;
|
|
34377
34387
|
});
|
|
34378
34388
|
}, n.prototype.forward = function(t) {
|
|
@@ -34390,13 +34400,13 @@ var J6 = (
|
|
|
34390
34400
|
}, n.prototype.getDefaultModelName = function() {
|
|
34391
34401
|
return "tiny_xception_model";
|
|
34392
34402
|
}, n.prototype.extractParamsFromWeigthMap = function(t) {
|
|
34393
|
-
return
|
|
34403
|
+
return QA(t, this._numMainBlocks);
|
|
34394
34404
|
}, n.prototype.extractParams = function(t) {
|
|
34395
|
-
return
|
|
34405
|
+
return YA(t, this._numMainBlocks);
|
|
34396
34406
|
}, n;
|
|
34397
34407
|
}(Kr)
|
|
34398
34408
|
);
|
|
34399
|
-
function
|
|
34409
|
+
function e6(e) {
|
|
34400
34410
|
var n = [], t = Xr(e), r = t.extractWeights, o = t.getRemainingWeights, a = cf(r, n), i = a(512, 1, "fc/age"), s = a(512, 2, "fc/gender");
|
|
34401
34411
|
if (o().length !== 0)
|
|
34402
34412
|
throw new Error("weights remaing after extract: " + o().length);
|
|
@@ -34405,7 +34415,7 @@ function eA(e) {
|
|
|
34405
34415
|
params: { fc: { age: i, gender: s } }
|
|
34406
34416
|
};
|
|
34407
34417
|
}
|
|
34408
|
-
function
|
|
34418
|
+
function t6(e) {
|
|
34409
34419
|
var n = [], t = go(e, n);
|
|
34410
34420
|
function r(a) {
|
|
34411
34421
|
var i = t(a + "/weights", 2), s = t(a + "/bias", 1);
|
|
@@ -34423,12 +34433,12 @@ var ru;
|
|
|
34423
34433
|
(function(e) {
|
|
34424
34434
|
e.FEMALE = "female", e.MALE = "male";
|
|
34425
34435
|
})(ru || (ru = {}));
|
|
34426
|
-
var
|
|
34436
|
+
var n6 = (
|
|
34427
34437
|
/** @class */
|
|
34428
34438
|
function(e) {
|
|
34429
34439
|
nt(n, e);
|
|
34430
34440
|
function n(t) {
|
|
34431
|
-
t === void 0 && (t = new
|
|
34441
|
+
t === void 0 && (t = new JA(2));
|
|
34432
34442
|
var r = e.call(this, "AgeGenderNet") || this;
|
|
34433
34443
|
return r._faceFeatureExtractor = t, r;
|
|
34434
34444
|
}
|
|
@@ -34508,10 +34518,10 @@ var nA = (
|
|
|
34508
34518
|
var r = this.extractClassifierParams(t), o = r.params, a = r.paramMappings;
|
|
34509
34519
|
this._params = o, this._paramMappings = a;
|
|
34510
34520
|
}, n.prototype.extractClassifierParams = function(t) {
|
|
34511
|
-
return
|
|
34521
|
+
return e6(t);
|
|
34512
34522
|
}, n.prototype.extractParamsFromWeigthMap = function(t) {
|
|
34513
34523
|
var r = B0(t), o = r.featureExtractorMap, a = r.classifierMap;
|
|
34514
|
-
return this.faceFeatureExtractor.loadFromWeightMap(o),
|
|
34524
|
+
return this.faceFeatureExtractor.loadFromWeightMap(o), t6(a);
|
|
34515
34525
|
}, n.prototype.extractParams = function(t) {
|
|
34516
34526
|
var r = 1539, o = t.slice(0, t.length - r), a = t.slice(t.length - r);
|
|
34517
34527
|
return this.faceFeatureExtractor.extractWeights(o), this.extractClassifierParams(a);
|
|
@@ -34634,7 +34644,7 @@ var nA = (
|
|
|
34634
34644
|
}, n;
|
|
34635
34645
|
}(q0)
|
|
34636
34646
|
);
|
|
34637
|
-
function
|
|
34647
|
+
function r6(e) {
|
|
34638
34648
|
var n = [], t = F0(e, n).extractDenseBlock3Params, r = {
|
|
34639
34649
|
dense0: t("dense0", !0),
|
|
34640
34650
|
dense1: t("dense1"),
|
|
@@ -34642,7 +34652,7 @@ function rA(e) {
|
|
|
34642
34652
|
};
|
|
34643
34653
|
return Yr(e, n), { params: r, paramMappings: n };
|
|
34644
34654
|
}
|
|
34645
|
-
function
|
|
34655
|
+
function o6(e) {
|
|
34646
34656
|
var n = [], t = Xr(e), r = t.extractWeights, o = t.getRemainingWeights, a = D0(r, n).extractDenseBlock3Params, i = a(3, 32, "dense0", !0), s = a(32, 64, "dense1"), u = a(64, 128, "dense2");
|
|
34647
34657
|
if (o().length !== 0)
|
|
34648
34658
|
throw new Error("weights remaing after extract: " + o().length);
|
|
@@ -34651,7 +34661,7 @@ function oA(e) {
|
|
|
34651
34661
|
params: { dense0: i, dense1: s, dense2: u }
|
|
34652
34662
|
};
|
|
34653
34663
|
}
|
|
34654
|
-
var
|
|
34664
|
+
var a6 = (
|
|
34655
34665
|
/** @class */
|
|
34656
34666
|
function(e) {
|
|
34657
34667
|
nt(n, e);
|
|
@@ -34681,17 +34691,17 @@ var aA = (
|
|
|
34681
34691
|
}, n.prototype.getDefaultModelName = function() {
|
|
34682
34692
|
return "face_feature_extractor_tiny_model";
|
|
34683
34693
|
}, n.prototype.extractParamsFromWeigthMap = function(t) {
|
|
34684
|
-
return
|
|
34694
|
+
return r6(t);
|
|
34685
34695
|
}, n.prototype.extractParams = function(t) {
|
|
34686
|
-
return
|
|
34696
|
+
return o6(t);
|
|
34687
34697
|
}, n;
|
|
34688
34698
|
}(Kr)
|
|
34689
|
-
),
|
|
34699
|
+
), i6 = (
|
|
34690
34700
|
/** @class */
|
|
34691
34701
|
function(e) {
|
|
34692
34702
|
nt(n, e);
|
|
34693
34703
|
function n(t) {
|
|
34694
|
-
return t === void 0 && (t = new
|
|
34704
|
+
return t === void 0 && (t = new a6()), e.call(this, "FaceLandmark68TinyNet", t) || this;
|
|
34695
34705
|
}
|
|
34696
34706
|
return n.prototype.getDefaultModelName = function() {
|
|
34697
34707
|
return "face_landmark_68_tiny_model";
|
|
@@ -34707,15 +34717,15 @@ var aA = (
|
|
|
34707
34717
|
}
|
|
34708
34718
|
return n;
|
|
34709
34719
|
})(V0);
|
|
34710
|
-
function
|
|
34720
|
+
function s6(e, n) {
|
|
34711
34721
|
return ft(Dn(e, n.weights), n.biases);
|
|
34712
34722
|
}
|
|
34713
34723
|
function pf(e, n, t, r, o) {
|
|
34714
34724
|
o === void 0 && (o = "same");
|
|
34715
34725
|
var a = n.conv, i = a.filters, s = a.bias, u = ir(e, i, t, o);
|
|
34716
|
-
return u = ft(u, s), u =
|
|
34726
|
+
return u = ft(u, s), u = s6(u, n.scale), r ? Ut(u) : u;
|
|
34717
34727
|
}
|
|
34718
|
-
function
|
|
34728
|
+
function u6(e, n) {
|
|
34719
34729
|
return pf(e, n, [1, 1], !0);
|
|
34720
34730
|
}
|
|
34721
34731
|
function z0(e, n) {
|
|
@@ -34724,10 +34734,10 @@ function z0(e, n) {
|
|
|
34724
34734
|
function $0(e, n) {
|
|
34725
34735
|
return pf(e, n, [2, 2], !0, "valid");
|
|
34726
34736
|
}
|
|
34727
|
-
function
|
|
34737
|
+
function l6(e, n) {
|
|
34728
34738
|
function t(s, u, l) {
|
|
34729
34739
|
var c = e(s), d = c.length / (u * l * l);
|
|
34730
|
-
if (
|
|
34740
|
+
if (gA(d))
|
|
34731
34741
|
throw new Error("depth has to be an integer: " + d + ", weights.length: " + c.length + ", numFilters: " + u + ", filterSize: " + l);
|
|
34732
34742
|
return Re(function() {
|
|
34733
34743
|
return ho(Pn(c, [u, d, l, l]), [2, 3, 1, 0]);
|
|
@@ -34758,8 +34768,8 @@ function lA(e, n) {
|
|
|
34758
34768
|
extractResidualLayerParams: i
|
|
34759
34769
|
};
|
|
34760
34770
|
}
|
|
34761
|
-
function
|
|
34762
|
-
var n = Xr(e), t = n.extractWeights, r = n.getRemainingWeights, o = [], a =
|
|
34771
|
+
function c6(e) {
|
|
34772
|
+
var n = Xr(e), t = n.extractWeights, r = n.getRemainingWeights, o = [], a = l6(t, o), i = a.extractConvLayerParams, s = a.extractResidualLayerParams, u = i(4704, 32, 7, "conv32_down"), l = s(9216, 32, 3, "conv32_1"), c = s(9216, 32, 3, "conv32_2"), d = s(9216, 32, 3, "conv32_3"), f = s(36864, 64, 3, "conv64_down", !0), h = s(36864, 64, 3, "conv64_1"), p = s(36864, 64, 3, "conv64_2"), m = s(36864, 64, 3, "conv64_3"), v = s(147456, 128, 3, "conv128_down", !0), y = s(147456, 128, 3, "conv128_1"), w = s(147456, 128, 3, "conv128_2"), b = s(589824, 256, 3, "conv256_down", !0), g = s(589824, 256, 3, "conv256_1"), x = s(589824, 256, 3, "conv256_2"), C = s(589824, 256, 3, "conv256_down_out"), S = Re(function() {
|
|
34763
34773
|
return ho(uo(t(256 * 128), [128, 256]), [1, 0]);
|
|
34764
34774
|
});
|
|
34765
34775
|
if (o.push({ paramPath: "fc" }), r().length !== 0)
|
|
@@ -34784,7 +34794,7 @@ function cA(e) {
|
|
|
34784
34794
|
};
|
|
34785
34795
|
return { params: E, paramMappings: o };
|
|
34786
34796
|
}
|
|
34787
|
-
function
|
|
34797
|
+
function d6(e, n) {
|
|
34788
34798
|
var t = go(e, n);
|
|
34789
34799
|
function r(i) {
|
|
34790
34800
|
var s = t(i + "/scale/weights", 1), u = t(i + "/scale/biases", 1);
|
|
@@ -34805,9 +34815,9 @@ function dA(e, n) {
|
|
|
34805
34815
|
extractResidualLayerParams: a
|
|
34806
34816
|
};
|
|
34807
34817
|
}
|
|
34808
|
-
function
|
|
34809
|
-
var n = [], t =
|
|
34810
|
-
if (n.push({ originalPath: "fc", paramPath: "fc" }), !
|
|
34818
|
+
function f6(e) {
|
|
34819
|
+
var n = [], t = d6(e, n), r = t.extractConvLayerParams, o = t.extractResidualLayerParams, a = r("conv32_down"), i = o("conv32_1"), s = o("conv32_2"), u = o("conv32_3"), l = o("conv64_down"), c = o("conv64_1"), d = o("conv64_2"), f = o("conv64_3"), h = o("conv128_down"), p = o("conv128_1"), m = o("conv128_2"), v = o("conv256_down"), y = o("conv256_1"), w = o("conv256_2"), b = o("conv256_down_out"), g = e.fc;
|
|
34820
|
+
if (n.push({ originalPath: "fc", paramPath: "fc" }), !mA(g))
|
|
34811
34821
|
throw new Error("expected weightMap[fc] to be a Tensor2D, instead have " + g);
|
|
34812
34822
|
var x = {
|
|
34813
34823
|
conv32_down: a,
|
|
@@ -34830,7 +34840,7 @@ function fA(e) {
|
|
|
34830
34840
|
return Yr(e, n), { params: x, paramMappings: n };
|
|
34831
34841
|
}
|
|
34832
34842
|
function br(e, n) {
|
|
34833
|
-
var t =
|
|
34843
|
+
var t = u6(e, n.conv1);
|
|
34834
34844
|
return t = z0(t, n.conv2), t = ft(t, e), t = Ut(t), t;
|
|
34835
34845
|
}
|
|
34836
34846
|
function us(e, n) {
|
|
@@ -34849,7 +34859,7 @@ function us(e, n) {
|
|
|
34849
34859
|
}
|
|
34850
34860
|
return r = a ? on([r, o], 3) : r, t = ft(r, t), t = Ut(t), t;
|
|
34851
34861
|
}
|
|
34852
|
-
var
|
|
34862
|
+
var h6 = (
|
|
34853
34863
|
/** @class */
|
|
34854
34864
|
function(e) {
|
|
34855
34865
|
nt(n, e);
|
|
@@ -34901,9 +34911,9 @@ var hA = (
|
|
|
34901
34911
|
}, n.prototype.getDefaultModelName = function() {
|
|
34902
34912
|
return "face_recognition_model";
|
|
34903
34913
|
}, n.prototype.extractParamsFromWeigthMap = function(t) {
|
|
34904
|
-
return
|
|
34914
|
+
return f6(t);
|
|
34905
34915
|
}, n.prototype.extractParams = function(t) {
|
|
34906
|
-
return
|
|
34916
|
+
return c6(t);
|
|
34907
34917
|
}, n;
|
|
34908
34918
|
}(Kr)
|
|
34909
34919
|
);
|
|
@@ -34972,7 +34982,7 @@ var j0 = (
|
|
|
34972
34982
|
}), e;
|
|
34973
34983
|
}()
|
|
34974
34984
|
);
|
|
34975
|
-
function
|
|
34985
|
+
function p6(e, n) {
|
|
34976
34986
|
function t(u, l) {
|
|
34977
34987
|
var c = Pn(e(9 * u), [3, 3, u, 1]), d = tn(e(u)), f = tn(e(u)), h = tn(e(u)), p = tn(e(u));
|
|
34978
34988
|
return n.push({ paramPath: l + "/filters" }, { paramPath: l + "/batch_norm_scale" }, { paramPath: l + "/batch_norm_offset" }, { paramPath: l + "/batch_norm_mean" }, { paramPath: l + "/batch_norm_variance" }), {
|
|
@@ -35059,8 +35069,8 @@ function pA(e, n) {
|
|
|
35059
35069
|
extractPredictionLayerParams: s
|
|
35060
35070
|
};
|
|
35061
35071
|
}
|
|
35062
|
-
function
|
|
35063
|
-
var n = [], t = Xr(e), r = t.extractWeights, o = t.getRemainingWeights, a =
|
|
35072
|
+
function v6(e) {
|
|
35073
|
+
var n = [], t = Xr(e), r = t.extractWeights, o = t.getRemainingWeights, a = p6(r, n), i = a.extractMobilenetV1Params, s = a.extractPredictionLayerParams, u = i(), l = s(), c = Dd(r(5118 * 4), [1, 5118, 4]), d = {
|
|
35064
35074
|
extra_dim: c
|
|
35065
35075
|
};
|
|
35066
35076
|
if (n.push({ paramPath: "output_layer/extra_dim" }), o().length !== 0)
|
|
@@ -35074,7 +35084,7 @@ function vA(e) {
|
|
|
35074
35084
|
paramMappings: n
|
|
35075
35085
|
};
|
|
35076
35086
|
}
|
|
35077
|
-
function
|
|
35087
|
+
function m6(e, n) {
|
|
35078
35088
|
var t = go(e, n);
|
|
35079
35089
|
function r(l, c, d) {
|
|
35080
35090
|
var f = t(l + "/Conv2d_" + c + "_pointwise/weights", 4, d + "/filters"), h = t(l + "/Conv2d_" + c + "_pointwise/convolution_bn_offset", 1, d + "/batch_norm_offset");
|
|
@@ -35142,8 +35152,8 @@ function mA(e, n) {
|
|
|
35142
35152
|
extractPredictionLayerParams: u
|
|
35143
35153
|
};
|
|
35144
35154
|
}
|
|
35145
|
-
function
|
|
35146
|
-
var n = [], t =
|
|
35155
|
+
function g6(e) {
|
|
35156
|
+
var n = [], t = m6(e, n), r = t.extractMobilenetV1Params, o = t.extractPredictionLayerParams, a = e["Output/extra_dim"];
|
|
35147
35157
|
if (n.push({ originalPath: "Output/extra_dim", paramPath: "output_layer/extra_dim" }), !Pu(a))
|
|
35148
35158
|
throw new Error("expected weightMap['Output/extra_dim'] to be a Tensor3D, instead have " + a);
|
|
35149
35159
|
var i = {
|
|
@@ -35161,19 +35171,19 @@ function xr(e, n, t) {
|
|
|
35161
35171
|
return r = ft(r, n.batch_norm_offset), $d(r, 0, 6);
|
|
35162
35172
|
});
|
|
35163
35173
|
}
|
|
35164
|
-
var
|
|
35165
|
-
function
|
|
35174
|
+
var y6 = 0.0010000000474974513;
|
|
35175
|
+
function b6(e, n, t) {
|
|
35166
35176
|
return Re(function() {
|
|
35167
35177
|
var r = Tu(e, n.filters, t, "same");
|
|
35168
|
-
return r = qg(r, n.batch_norm_mean, n.batch_norm_variance, n.batch_norm_offset, n.batch_norm_scale,
|
|
35178
|
+
return r = qg(r, n.batch_norm_mean, n.batch_norm_variance, n.batch_norm_offset, n.batch_norm_scale, y6), $d(r, 0, 6);
|
|
35169
35179
|
});
|
|
35170
35180
|
}
|
|
35171
|
-
function
|
|
35181
|
+
function w6(e) {
|
|
35172
35182
|
return [2, 4, 6, 12].some(function(n) {
|
|
35173
35183
|
return n === e;
|
|
35174
35184
|
}) ? [2, 2] : [1, 1];
|
|
35175
35185
|
}
|
|
35176
|
-
function
|
|
35186
|
+
function x6(e, n) {
|
|
35177
35187
|
return Re(function() {
|
|
35178
35188
|
var t = null, r = xr(e, n.conv_0, [2, 2]), o = [
|
|
35179
35189
|
n.conv_1,
|
|
@@ -35191,8 +35201,8 @@ function xA(e, n) {
|
|
|
35191
35201
|
n.conv_13
|
|
35192
35202
|
];
|
|
35193
35203
|
if (o.forEach(function(a, i) {
|
|
35194
|
-
var s = i + 1, u =
|
|
35195
|
-
r =
|
|
35204
|
+
var s = i + 1, u = w6(s);
|
|
35205
|
+
r = b6(r, a.depthwise_conv, u), r = xr(r, a.pointwise_conv, [1, 1]), s === 11 && (t = r);
|
|
35196
35206
|
}), t === null)
|
|
35197
35207
|
throw new Error("mobileNetV1 - output of conv layer 11 is null");
|
|
35198
35208
|
return {
|
|
@@ -35201,7 +35211,7 @@ function xA(e, n) {
|
|
|
35201
35211
|
};
|
|
35202
35212
|
});
|
|
35203
35213
|
}
|
|
35204
|
-
function
|
|
35214
|
+
function C6(e, n, t, r, o) {
|
|
35205
35215
|
var a = e.shape[0], i = Math.min(t, a), s = n.map(function(c, d) {
|
|
35206
35216
|
return { score: c, boxIndex: d };
|
|
35207
35217
|
}).filter(function(c) {
|
|
@@ -35214,7 +35224,7 @@ function CA(e, n, t, r, o) {
|
|
|
35214
35224
|
return s.forEach(function(c) {
|
|
35215
35225
|
if (!(l.length >= i)) {
|
|
35216
35226
|
for (var d = c.score, f = l.length - 1; f >= 0; --f) {
|
|
35217
|
-
var h =
|
|
35227
|
+
var h = k6(e, c.boxIndex, l[f]);
|
|
35218
35228
|
if (h !== 0 && (c.score *= u(h), c.score <= o))
|
|
35219
35229
|
break;
|
|
35220
35230
|
}
|
|
@@ -35222,14 +35232,14 @@ function CA(e, n, t, r, o) {
|
|
|
35222
35232
|
}
|
|
35223
35233
|
}), l;
|
|
35224
35234
|
}
|
|
35225
|
-
function
|
|
35235
|
+
function k6(e, n, t) {
|
|
35226
35236
|
var r = e.arraySync(), o = Math.min(r[n][0], r[n][2]), a = Math.min(r[n][1], r[n][3]), i = Math.max(r[n][0], r[n][2]), s = Math.max(r[n][1], r[n][3]), u = Math.min(r[t][0], r[t][2]), l = Math.min(r[t][1], r[t][3]), c = Math.max(r[t][0], r[t][2]), d = Math.max(r[t][1], r[t][3]), f = (i - o) * (s - a), h = (c - u) * (d - l);
|
|
35227
35237
|
if (f <= 0 || h <= 0)
|
|
35228
35238
|
return 0;
|
|
35229
35239
|
var p = Math.max(o, u), m = Math.max(a, l), v = Math.min(i, c), y = Math.min(s, d), w = Math.max(v - p, 0) * Math.max(y - m, 0);
|
|
35230
35240
|
return w / (f + h - w);
|
|
35231
35241
|
}
|
|
35232
|
-
function
|
|
35242
|
+
function _6(e) {
|
|
35233
35243
|
var n = an(ho(e, [1, 0])), t = [
|
|
35234
35244
|
un(n[2], n[0]),
|
|
35235
35245
|
un(n[3], n[1])
|
|
@@ -35242,8 +35252,8 @@ function _A(e) {
|
|
|
35242
35252
|
centers: r
|
|
35243
35253
|
};
|
|
35244
35254
|
}
|
|
35245
|
-
function
|
|
35246
|
-
var t =
|
|
35255
|
+
function S6(e, n) {
|
|
35256
|
+
var t = _6(e), r = t.sizes, o = t.centers, a = an(ho(n, [1, 0])), i = lr(Dn(qc(lr(a[2], Ce(5))), r[0]), Ce(2)), s = ft(Dn(lr(a[0], Ce(10)), r[0]), o[0]), u = lr(Dn(qc(lr(a[3], Ce(5))), r[1]), Ce(2)), l = ft(Dn(lr(a[1], Ce(10)), r[1]), o[1]);
|
|
35247
35257
|
return ho(Zn([
|
|
35248
35258
|
un(s, i),
|
|
35249
35259
|
un(l, u),
|
|
@@ -35251,9 +35261,9 @@ function SA(e, n) {
|
|
|
35251
35261
|
ft(l, u)
|
|
35252
35262
|
]), [1, 0]);
|
|
35253
35263
|
}
|
|
35254
|
-
function
|
|
35264
|
+
function E6(e, n, t) {
|
|
35255
35265
|
return Re(function() {
|
|
35256
|
-
var r = e.shape[0], o =
|
|
35266
|
+
var r = e.shape[0], o = S6(cr(ba(t.extra_dim, [r, 1, 1]), [-1, 4]), cr(e, [-1, 4]));
|
|
35257
35267
|
o = cr(o, [r, o.shape[0] / r, 4]);
|
|
35258
35268
|
var a = Bg(Tr(n, [0, 0, 1], [-1, -1, -1])), i = Tr(a, [0, 0, 0], [-1, -1, 1]);
|
|
35259
35269
|
i = cr(i, [r, i.shape[1]]);
|
|
@@ -35273,7 +35283,7 @@ function ia(e, n) {
|
|
|
35273
35283
|
};
|
|
35274
35284
|
});
|
|
35275
35285
|
}
|
|
35276
|
-
function
|
|
35286
|
+
function R6(e, n, t) {
|
|
35277
35287
|
return Re(function() {
|
|
35278
35288
|
var r = xr(e, t.conv_0, [1, 1]), o = xr(r, t.conv_1, [2, 2]), a = xr(o, t.conv_2, [1, 1]), i = xr(a, t.conv_3, [2, 2]), s = xr(i, t.conv_4, [1, 1]), u = xr(s, t.conv_5, [2, 2]), l = xr(u, t.conv_6, [1, 1]), c = xr(l, t.conv_7, [2, 2]), d = ia(n, t.box_predictor_0), f = ia(e, t.box_predictor_1), h = ia(o, t.box_predictor_2), p = ia(i, t.box_predictor_3), m = ia(u, t.box_predictor_4), v = ia(c, t.box_predictor_5), y = on([
|
|
35279
35289
|
d.boxPredictionEncoding,
|
|
@@ -35332,8 +35342,8 @@ var $u = (
|
|
|
35332
35342
|
if (!r)
|
|
35333
35343
|
throw new Error("SsdMobilenetv1 - load model before inference");
|
|
35334
35344
|
return Re(function() {
|
|
35335
|
-
var o = t.toBatchTensor(512, !1).toFloat(), a = un(Dn(o, Ce(0.007843137718737125)), Ce(1)), i =
|
|
35336
|
-
return
|
|
35345
|
+
var o = t.toBatchTensor(512, !1).toFloat(), a = un(Dn(o, Ce(0.007843137718737125)), Ce(1)), i = x6(a, r.mobilenetv1), s = R6(i.out, i.conv11, r.prediction_layer), u = s.boxPredictions, l = s.classPredictions;
|
|
35346
|
+
return E6(u, l, r.output_layer);
|
|
35337
35347
|
});
|
|
35338
35348
|
}, n.prototype.forward = function(t) {
|
|
35339
35349
|
return Le(this, void 0, void 0, function() {
|
|
@@ -35359,7 +35369,7 @@ var $u = (
|
|
|
35359
35369
|
l[h].dispose(), c[h].dispose();
|
|
35360
35370
|
return v = (m = Array).from, [4, f.data()];
|
|
35361
35371
|
case 2:
|
|
35362
|
-
return p = v.apply(m, [R.sent()]), y = 0.5, w =
|
|
35372
|
+
return p = v.apply(m, [R.sent()]), y = 0.5, w = C6(d, p, a, y, i), b = s.getReshapedInputDimensions(0), g = s.inputSize, x = g / b.width, C = g / b.height, S = d.arraySync(), E = w.map(function(k) {
|
|
35363
35373
|
var T = [
|
|
35364
35374
|
Math.max(0, S[k][0]),
|
|
35365
35375
|
Math.min(1, S[k][2])
|
|
@@ -35382,9 +35392,9 @@ var $u = (
|
|
|
35382
35392
|
}, n.prototype.getDefaultModelName = function() {
|
|
35383
35393
|
return "ssd_mobilenetv1_model";
|
|
35384
35394
|
}, n.prototype.extractParamsFromWeigthMap = function(t) {
|
|
35385
|
-
return
|
|
35395
|
+
return g6(t);
|
|
35386
35396
|
}, n.prototype.extractParams = function(t) {
|
|
35387
|
-
return
|
|
35397
|
+
return v6(t);
|
|
35388
35398
|
}, n;
|
|
35389
35399
|
}(Kr)
|
|
35390
35400
|
);
|
|
@@ -35395,22 +35405,22 @@ var $u = (
|
|
|
35395
35405
|
}
|
|
35396
35406
|
return n;
|
|
35397
35407
|
})(G0);
|
|
35398
|
-
var
|
|
35408
|
+
var I6 = 0.4, T6 = [
|
|
35399
35409
|
new _t(0.738768, 0.874946),
|
|
35400
35410
|
new _t(2.42204, 2.65704),
|
|
35401
35411
|
new _t(4.30971, 7.04493),
|
|
35402
35412
|
new _t(10.246, 4.59428),
|
|
35403
35413
|
new _t(12.6868, 11.8741)
|
|
35404
|
-
],
|
|
35414
|
+
], A6 = [
|
|
35405
35415
|
new _t(1.603231, 2.094468),
|
|
35406
35416
|
new _t(6.041143, 7.080126),
|
|
35407
35417
|
new _t(2.882459, 3.518061),
|
|
35408
35418
|
new _t(4.266906, 5.178857),
|
|
35409
35419
|
new _t(9.041765, 10.66308)
|
|
35410
|
-
],
|
|
35420
|
+
], D6 = [117.001, 114.697, 97.404], M6 = "tiny_yolov2_model", F6 = "tiny_yolov2_separable_conv_model", ls = function(e) {
|
|
35411
35421
|
return typeof e == "number";
|
|
35412
35422
|
};
|
|
35413
|
-
function
|
|
35423
|
+
function P6(e) {
|
|
35414
35424
|
if (!e)
|
|
35415
35425
|
throw new Error("invalid config: " + e);
|
|
35416
35426
|
if (typeof e.withSeparableConvs != "boolean")
|
|
@@ -35448,7 +35458,7 @@ function Jr(e, n) {
|
|
|
35448
35458
|
return t = jd(t, n.depthwise_filter, n.pointwise_filter, [1, 1], "valid"), t = ft(t, n.bias), vf(t);
|
|
35449
35459
|
});
|
|
35450
35460
|
}
|
|
35451
|
-
function
|
|
35461
|
+
function B6(e, n) {
|
|
35452
35462
|
var t = Vu(e, n);
|
|
35453
35463
|
function r(i, s) {
|
|
35454
35464
|
var u = tn(e(i)), l = tn(e(i));
|
|
@@ -35465,8 +35475,8 @@ function BA(e, n) {
|
|
|
35465
35475
|
extractSeparableConvParams: a
|
|
35466
35476
|
};
|
|
35467
35477
|
}
|
|
35468
|
-
function
|
|
35469
|
-
var o = Xr(e), a = o.extractWeights, i = o.getRemainingWeights, s = [], u =
|
|
35478
|
+
function O6(e, n, t, r) {
|
|
35479
|
+
var o = Xr(e), a = o.extractWeights, i = o.getRemainingWeights, s = [], u = B6(a, s), l = u.extractConvParams, c = u.extractConvWithBatchNormParams, d = u.extractSeparableConvParams, f;
|
|
35470
35480
|
if (n.withSeparableConvs) {
|
|
35471
35481
|
var h = r[0], p = r[1], m = r[2], v = r[3], y = r[4], w = r[5], b = r[6], g = r[7], x = r[8], C = n.isFirstLayerConv2d ? l(h, p, 3, "conv0") : d(h, p, "conv0"), S = d(p, m, "conv1"), E = d(m, v, "conv2"), R = d(v, y, "conv3"), k = d(y, w, "conv4"), T = d(w, b, "conv5"), A = g ? d(b, g, "conv6") : void 0, q = x ? d(g, x, "conv7") : void 0, D = l(x || g || b, 5 * t, 1, "conv8");
|
|
35472
35482
|
f = { conv0: C, conv1: S, conv2: E, conv3: R, conv4: k, conv5: T, conv6: A, conv7: q, conv8: D };
|
|
@@ -35478,7 +35488,7 @@ function OA(e, n, t, r) {
|
|
|
35478
35488
|
throw new Error("weights remaing after extract: " + i().length);
|
|
35479
35489
|
return { params: f, paramMappings: s };
|
|
35480
35490
|
}
|
|
35481
|
-
function
|
|
35491
|
+
function N6(e, n) {
|
|
35482
35492
|
var t = go(e, n);
|
|
35483
35493
|
function r(s) {
|
|
35484
35494
|
var u = t(s + "/sub", 1), l = t(s + "/truediv", 1);
|
|
@@ -35499,8 +35509,8 @@ function NA(e, n) {
|
|
|
35499
35509
|
extractSeparableConvParams: i
|
|
35500
35510
|
};
|
|
35501
35511
|
}
|
|
35502
|
-
function
|
|
35503
|
-
var t = [], r =
|
|
35512
|
+
function L6(e, n) {
|
|
35513
|
+
var t = [], r = N6(e, t), o = r.extractConvParams, a = r.extractConvWithBatchNormParams, i = r.extractSeparableConvParams, s;
|
|
35504
35514
|
if (n.withSeparableConvs) {
|
|
35505
35515
|
var u = n.filterSizes && n.filterSizes.length || 9;
|
|
35506
35516
|
s = {
|
|
@@ -35562,7 +35572,7 @@ var mf = (
|
|
|
35562
35572
|
nt(n, e);
|
|
35563
35573
|
function n(t) {
|
|
35564
35574
|
var r = e.call(this, "TinyYolov2") || this;
|
|
35565
|
-
return
|
|
35575
|
+
return P6(t), r._config = t, r;
|
|
35566
35576
|
}
|
|
35567
35577
|
return Object.defineProperty(n.prototype, "config", {
|
|
35568
35578
|
get: function() {
|
|
@@ -35646,12 +35656,12 @@ var mf = (
|
|
|
35646
35656
|
}, n.prototype.getDefaultModelName = function() {
|
|
35647
35657
|
return "";
|
|
35648
35658
|
}, n.prototype.extractParamsFromWeigthMap = function(t) {
|
|
35649
|
-
return
|
|
35659
|
+
return L6(t, this.config);
|
|
35650
35660
|
}, n.prototype.extractParams = function(t) {
|
|
35651
35661
|
var r = this.config.filterSizes || n.DEFAULT_FILTER_SIZES, o = r ? r.length : void 0;
|
|
35652
35662
|
if (o !== 7 && o !== 8 && o !== 9)
|
|
35653
35663
|
throw new Error("TinyYolov2 - expected 7 | 8 | 9 convolutional filters, but found " + o + " filterSizes in config");
|
|
35654
|
-
return
|
|
35664
|
+
return O6(t, this.config, this.boxEncodingSize, r);
|
|
35655
35665
|
}, n.prototype.extractBoxes = function(t, r, o) {
|
|
35656
35666
|
return Le(this, void 0, void 0, function() {
|
|
35657
35667
|
var a, i, s, u, l, c, d, f, h, p, m, v, y, w, b, g, x, C, S, E, R, k, T, A, q, D, O, z, F, P = this;
|
|
@@ -35724,7 +35734,7 @@ var mf = (
|
|
|
35724
35734
|
1024
|
|
35725
35735
|
], n;
|
|
35726
35736
|
}(Kr)
|
|
35727
|
-
),
|
|
35737
|
+
), q6 = (
|
|
35728
35738
|
/** @class */
|
|
35729
35739
|
function(e) {
|
|
35730
35740
|
nt(n, e);
|
|
@@ -35732,13 +35742,13 @@ var mf = (
|
|
|
35732
35742
|
t === void 0 && (t = !0);
|
|
35733
35743
|
var r = this, o = Object.assign({}, {
|
|
35734
35744
|
withSeparableConvs: t,
|
|
35735
|
-
iouThreshold:
|
|
35745
|
+
iouThreshold: I6,
|
|
35736
35746
|
classes: ["face"]
|
|
35737
35747
|
}, t ? {
|
|
35738
|
-
anchors:
|
|
35739
|
-
meanRgb:
|
|
35748
|
+
anchors: A6,
|
|
35749
|
+
meanRgb: D6
|
|
35740
35750
|
} : {
|
|
35741
|
-
anchors:
|
|
35751
|
+
anchors: T6,
|
|
35742
35752
|
withClassScores: !0
|
|
35743
35753
|
});
|
|
35744
35754
|
return r = e.call(this, o) || this, r;
|
|
@@ -35770,7 +35780,7 @@ var mf = (
|
|
|
35770
35780
|
});
|
|
35771
35781
|
});
|
|
35772
35782
|
}, n.prototype.getDefaultModelName = function() {
|
|
35773
|
-
return this.withSeparableConvs ?
|
|
35783
|
+
return this.withSeparableConvs ? F6 : M6;
|
|
35774
35784
|
}, n.prototype.extractParamsFromWeigthMap = function(t) {
|
|
35775
35785
|
return e.prototype.extractParamsFromWeigthMap.call(this, t);
|
|
35776
35786
|
}, n;
|
|
@@ -35855,13 +35865,13 @@ function gf(e, n, t, r, o) {
|
|
|
35855
35865
|
});
|
|
35856
35866
|
});
|
|
35857
35867
|
}
|
|
35858
|
-
function
|
|
35868
|
+
function V6(e) {
|
|
35859
35869
|
return Re(function() {
|
|
35860
35870
|
return Zn(an(e, 3).reverse(), 3);
|
|
35861
35871
|
});
|
|
35862
35872
|
}
|
|
35863
35873
|
var cs = 2, ou = 12;
|
|
35864
|
-
function
|
|
35874
|
+
function z6(e, n) {
|
|
35865
35875
|
var t = Vu(e, n), r = cf(e, n);
|
|
35866
35876
|
function o(l, c) {
|
|
35867
35877
|
var d = tn(e(l));
|
|
@@ -35890,13 +35900,13 @@ function zA(e, n) {
|
|
|
35890
35900
|
extractONetParams: u
|
|
35891
35901
|
};
|
|
35892
35902
|
}
|
|
35893
|
-
function $
|
|
35894
|
-
var n = Xr(e), t = n.extractWeights, r = n.getRemainingWeights, o = [], a =
|
|
35903
|
+
function $6(e) {
|
|
35904
|
+
var n = Xr(e), t = n.extractWeights, r = n.getRemainingWeights, o = [], a = z6(t, o), i = a.extractPNetParams, s = a.extractRNetParams, u = a.extractONetParams, l = i(), c = s(), d = u();
|
|
35895
35905
|
if (r().length !== 0)
|
|
35896
35906
|
throw new Error("weights remaing after extract: " + r().length);
|
|
35897
35907
|
return { params: { pnet: l, rnet: c, onet: d }, paramMappings: o };
|
|
35898
35908
|
}
|
|
35899
|
-
function
|
|
35909
|
+
function W6(e, n) {
|
|
35900
35910
|
var t = go(e, n);
|
|
35901
35911
|
function r(c) {
|
|
35902
35912
|
var d = t(c + "/weights", 4, c + "/filters"), f = t(c + "/bias", 1);
|
|
@@ -35931,8 +35941,8 @@ function WA(e, n) {
|
|
|
35931
35941
|
extractONetParams: l
|
|
35932
35942
|
};
|
|
35933
35943
|
}
|
|
35934
|
-
function
|
|
35935
|
-
var n = [], t =
|
|
35944
|
+
function H6(e) {
|
|
35945
|
+
var n = [], t = W6(e, n), r = t.extractPNetParams, o = t.extractRNetParams, a = t.extractONetParams, i = r(), s = o(), u = a();
|
|
35936
35946
|
return Yr(e, n), { params: { pnet: i, rnet: s, onet: u }, paramMappings: n };
|
|
35937
35947
|
}
|
|
35938
35948
|
function Gc(e, n) {
|
|
@@ -35942,7 +35952,7 @@ function Gc(e, n) {
|
|
|
35942
35952
|
width: Math.floor(r * e)
|
|
35943
35953
|
};
|
|
35944
35954
|
}
|
|
35945
|
-
function
|
|
35955
|
+
function U6(e, n, t) {
|
|
35946
35956
|
for (var r = t[0], o = t[1], a = ou / e, i = [], s = Math.min(r, o) * a, u = 0; s >= 12; )
|
|
35947
35957
|
i.push(a * Math.pow(n, u)), s = s * n, u += 1;
|
|
35948
35958
|
return i;
|
|
@@ -35973,19 +35983,19 @@ function bf(e, n, t) {
|
|
|
35973
35983
|
return r = _a(r, n.prelu1_alpha), r = dn(r, t ? [2, 2] : [3, 3], [2, 2], "same"), r = dr(r, n.conv2, "valid"), r = _a(r, n.prelu2_alpha), r = t ? r : dn(r, [3, 3], [2, 2], "valid"), r = dr(r, n.conv3, "valid"), r = _a(r, n.prelu3_alpha), r;
|
|
35974
35984
|
});
|
|
35975
35985
|
}
|
|
35976
|
-
function
|
|
35986
|
+
function j6(e, n) {
|
|
35977
35987
|
return Re(function() {
|
|
35978
35988
|
var t = bf(e, n, !0), r = dr(t, n.conv4_1, "valid"), o = rr(Du(r, 3), 3), a = jr(un(r, o), 3), i = dr(t, n.conv4_2, "valid");
|
|
35979
35989
|
return { prob: a, regions: i };
|
|
35980
35990
|
});
|
|
35981
35991
|
}
|
|
35982
|
-
function
|
|
35992
|
+
function G6(e, n) {
|
|
35983
35993
|
return Re(function() {
|
|
35984
35994
|
var t = Gc(n, e.shape.slice(1)), r = t.height, o = t.width, a = Qd.resizeBilinear(e, [r, o]), i = X0(a);
|
|
35985
35995
|
return ho(i, [0, 2, 1, 3]);
|
|
35986
35996
|
});
|
|
35987
35997
|
}
|
|
35988
|
-
function
|
|
35998
|
+
function K6(e, n, t, r) {
|
|
35989
35999
|
for (var o = [], a = e.arraySync(), i = 0; i < e.shape[0]; i++)
|
|
35990
36000
|
for (var s = 0; s < e.shape[1]; s++)
|
|
35991
36001
|
a[i][s] >= r && o.push(new _t(s, i));
|
|
@@ -35999,11 +36009,11 @@ function KA(e, n, t, r) {
|
|
|
35999
36009
|
});
|
|
36000
36010
|
return u;
|
|
36001
36011
|
}
|
|
36002
|
-
function
|
|
36012
|
+
function Y6(e, n, t, r, o) {
|
|
36003
36013
|
o.stage1 = [];
|
|
36004
36014
|
var a = n.map(function(f) {
|
|
36005
36015
|
return Re(function() {
|
|
36006
|
-
var h = { scale: f }, p =
|
|
36016
|
+
var h = { scale: f }, p = G6(e, f), m = Date.now(), v = j6(p, r), y = v.prob, w = v.regions;
|
|
36007
36017
|
h.pnet = Date.now() - m;
|
|
36008
36018
|
var b = an(an(y, 3)[1])[0], g = an(w)[0];
|
|
36009
36019
|
return {
|
|
@@ -36014,7 +36024,7 @@ function YA(e, n, t, r, o) {
|
|
|
36014
36024
|
};
|
|
36015
36025
|
});
|
|
36016
36026
|
}), i = a.map(function(f) {
|
|
36017
|
-
var h = f.scoresTensor, p = f.regionsTensor, m = f.scale, v = f.statsForScale, y =
|
|
36027
|
+
var h = f.scoresTensor, p = f.regionsTensor, m = f.scale, v = f.statsForScale, y = K6(h, p, m, t);
|
|
36018
36028
|
if (h.dispose(), p.dispose(), !y.length)
|
|
36019
36029
|
return o.stage1.push(v), [];
|
|
36020
36030
|
var w = Date.now(), b = yi(y.map(function(g) {
|
|
@@ -36081,13 +36091,13 @@ function Q0(e, n, t) {
|
|
|
36081
36091
|
});
|
|
36082
36092
|
});
|
|
36083
36093
|
}
|
|
36084
|
-
function
|
|
36094
|
+
function X6(e, n) {
|
|
36085
36095
|
return Re(function() {
|
|
36086
36096
|
var t = bf(e, n), r = cr(t, [t.shape[0], n.fc1.weights.shape[0]]), o = Sr(r, n.fc1), a = _a(o, n.prelu4_alpha), i = Sr(a, n.fc2_1), s = rr(Du(i, 1), 1), u = jr(un(i, s), 1), l = Sr(a, n.fc2_2), c = an(u, 1)[1];
|
|
36087
36097
|
return { scores: c, regions: l };
|
|
36088
36098
|
});
|
|
36089
36099
|
}
|
|
36090
|
-
function
|
|
36100
|
+
function Q6(e, n, t, r, o) {
|
|
36091
36101
|
return Le(this, void 0, void 0, function() {
|
|
36092
36102
|
var a, i, s, u, l, c, d, f, h, p, m, v, y, w;
|
|
36093
36103
|
return qe(this, function(b) {
|
|
@@ -36096,7 +36106,7 @@ function QA(e, n, t, r, o) {
|
|
|
36096
36106
|
return a = Date.now(), [4, Q0(e, n, { width: 24, height: 24 })];
|
|
36097
36107
|
case 1:
|
|
36098
36108
|
return i = b.sent(), o.stage2_extractImagePatches = Date.now() - a, a = Date.now(), s = i.map(function(g) {
|
|
36099
|
-
var x =
|
|
36109
|
+
var x = X6(g, r);
|
|
36100
36110
|
return g.dispose(), x;
|
|
36101
36111
|
}), o.stage2_rnet = Date.now() - a, u = s.length > 1 ? on(s.map(function(g) {
|
|
36102
36112
|
return g.scores;
|
|
@@ -36130,7 +36140,7 @@ function QA(e, n, t, r, o) {
|
|
|
36130
36140
|
});
|
|
36131
36141
|
});
|
|
36132
36142
|
}
|
|
36133
|
-
function
|
|
36143
|
+
function Z6(e, n) {
|
|
36134
36144
|
return Re(function() {
|
|
36135
36145
|
var t = bf(e, n);
|
|
36136
36146
|
t = dn(t, [2, 2], [2, 2], "same"), t = dr(t, n.conv4, "valid"), t = _a(t, n.prelu4_alpha);
|
|
@@ -36138,7 +36148,7 @@ function ZA(e, n) {
|
|
|
36138
36148
|
return { scores: d, regions: l, points: c };
|
|
36139
36149
|
});
|
|
36140
36150
|
}
|
|
36141
|
-
function
|
|
36151
|
+
function J6(e, n, t, r, o) {
|
|
36142
36152
|
return Le(this, void 0, void 0, function() {
|
|
36143
36153
|
var a, i, s, u, l, c, d, f, h, p, m, v, y, w, b;
|
|
36144
36154
|
return qe(this, function(g) {
|
|
@@ -36147,7 +36157,7 @@ function JA(e, n, t, r, o) {
|
|
|
36147
36157
|
return a = Date.now(), [4, Q0(e, n, { width: 48, height: 48 })];
|
|
36148
36158
|
case 1:
|
|
36149
36159
|
return i = g.sent(), o.stage3_extractImagePatches = Date.now() - a, a = Date.now(), s = i.map(function(x) {
|
|
36150
|
-
var C =
|
|
36160
|
+
var C = Z6(x, r);
|
|
36151
36161
|
return x.dispose(), C;
|
|
36152
36162
|
}), o.stage3_onet = Date.now() - a, u = s.length > 1 ? on(s.map(function(x) {
|
|
36153
36163
|
return x.scores;
|
|
@@ -36217,25 +36227,25 @@ var eD = (
|
|
|
36217
36227
|
if (a = t.canvases[0], !a)
|
|
36218
36228
|
throw new Error("Mtcnn - inputCanvas is not defined, note that passing tensors into Mtcnn.forwardInput is not supported yet.");
|
|
36219
36229
|
return i = {}, s = Date.now(), u = Re(function() {
|
|
36220
|
-
return
|
|
36230
|
+
return V6(rr(rf.fromPixels(a)).toFloat());
|
|
36221
36231
|
}), l = function(k) {
|
|
36222
36232
|
return u.dispose(), i.total = Date.now() - s, k;
|
|
36223
|
-
}, c = u.shape.slice(1), d = c[0], f = c[1], h = new j0(r), p = h.minFaceSize, m = h.scaleFactor, v = h.maxNumScales, y = h.scoreThresholds, w = h.scaleSteps, b = (w ||
|
|
36233
|
+
}, c = u.shape.slice(1), d = c[0], f = c[1], h = new j0(r), p = h.minFaceSize, m = h.scaleFactor, v = h.maxNumScales, y = h.scoreThresholds, w = h.scaleSteps, b = (w || U6(p, m, [d, f])).filter(function(k) {
|
|
36224
36234
|
var T = Gc(k, [d, f]);
|
|
36225
36235
|
return Math.min(T.width, T.height) > ou;
|
|
36226
36236
|
}).slice(0, v), i.scales = b, i.pyramid = b.map(function(k) {
|
|
36227
36237
|
return Gc(k, [d, f]);
|
|
36228
|
-
}), g = Date.now(), [4,
|
|
36238
|
+
}), g = Date.now(), [4, Y6(u, b, y[0], o.pnet, i)];
|
|
36229
36239
|
case 1:
|
|
36230
|
-
return x = R.sent(), i.total_stage1 = Date.now() - g, x.boxes.length ? (i.stage2_numInputBoxes = x.boxes.length, g = Date.now(), [4,
|
|
36240
|
+
return x = R.sent(), i.total_stage1 = Date.now() - g, x.boxes.length ? (i.stage2_numInputBoxes = x.boxes.length, g = Date.now(), [4, Q6(a, x.boxes, y[1], o.rnet, i)]) : [2, l({ results: [], stats: i })];
|
|
36231
36241
|
case 2:
|
|
36232
|
-
return C = R.sent(), i.total_stage2 = Date.now() - g, C.boxes.length ? (i.stage3_numInputBoxes = C.boxes.length, g = Date.now(), [4,
|
|
36242
|
+
return C = R.sent(), i.total_stage2 = Date.now() - g, C.boxes.length ? (i.stage3_numInputBoxes = C.boxes.length, g = Date.now(), [4, J6(a, C.boxes, y[2], o.onet, i)]) : [2, l({ results: [], stats: i })];
|
|
36233
36243
|
case 3:
|
|
36234
36244
|
return S = R.sent(), i.total_stage3 = Date.now() - g, E = S.boxes.map(function(k, T) {
|
|
36235
36245
|
return zu(bi({}, new er(S.scores[T], new Ou(k.left / f, k.top / d, k.width / f, k.height / d), {
|
|
36236
36246
|
height: d,
|
|
36237
36247
|
width: f
|
|
36238
|
-
})), new
|
|
36248
|
+
})), new SA(S.points[T].map(function(A) {
|
|
36239
36249
|
return A.sub(new _t(k.left, k.top)).div(new _t(k.width, k.height));
|
|
36240
36250
|
}), { width: k.width, height: k.height }));
|
|
36241
36251
|
}), [2, l({ results: E, stats: i })];
|
|
@@ -36277,9 +36287,9 @@ var eD = (
|
|
|
36277
36287
|
}, n.prototype.getDefaultModelName = function() {
|
|
36278
36288
|
return "mtcnn_model";
|
|
36279
36289
|
}, n.prototype.extractParamsFromWeigthMap = function(t) {
|
|
36280
|
-
return
|
|
36290
|
+
return H6(t);
|
|
36281
36291
|
}, n.prototype.extractParams = function(t) {
|
|
36282
|
-
return $
|
|
36292
|
+
return $6(t);
|
|
36283
36293
|
}, n;
|
|
36284
36294
|
}(Kr)
|
|
36285
36295
|
), tD = 0.4, nD = [
|
|
@@ -36333,13 +36343,13 @@ var eD = (
|
|
|
36333
36343
|
), Ln = {
|
|
36334
36344
|
ssdMobilenetv1: new G0(),
|
|
36335
36345
|
tinyFaceDetector: new oD(),
|
|
36336
|
-
tinyYolov2: new
|
|
36346
|
+
tinyYolov2: new q6(),
|
|
36337
36347
|
mtcnn: new eD(),
|
|
36338
36348
|
faceLandmark68Net: new V0(),
|
|
36339
|
-
faceLandmark68TinyNet: new
|
|
36340
|
-
faceRecognitionNet: new
|
|
36341
|
-
faceExpressionNet: new
|
|
36342
|
-
ageGenderNet: new
|
|
36349
|
+
faceLandmark68TinyNet: new i6(),
|
|
36350
|
+
faceRecognitionNet: new h6(),
|
|
36351
|
+
faceExpressionNet: new HA(),
|
|
36352
|
+
ageGenderNet: new n6()
|
|
36343
36353
|
}, Z0 = (
|
|
36344
36354
|
/** @class */
|
|
36345
36355
|
function(e) {
|
|
@@ -36993,12 +37003,12 @@ class dD {
|
|
|
36993
37003
|
return Lu(n);
|
|
36994
37004
|
}
|
|
36995
37005
|
getResizedAndDetection(n, t, r, o, a) {
|
|
36996
|
-
|
|
37006
|
+
LA(n, { width: o, height: a });
|
|
36997
37007
|
const i = r1(t, {
|
|
36998
37008
|
width: o,
|
|
36999
37009
|
height: a
|
|
37000
37010
|
});
|
|
37001
|
-
r.clearRect(0, 0, o, a),
|
|
37011
|
+
r.clearRect(0, 0, o, a), DA(n, i), GA(n, i);
|
|
37002
37012
|
}
|
|
37003
37013
|
async getFaceSnapshot(n, t) {
|
|
37004
37014
|
const r = [new Ou(t.x, t.y, t.width, t.height)], o = await qu(n, r);
|