Unverified Commit a988c98a by justadudewhohacks Committed by GitHub

Merge pull request #58 from justadudewhohacks/ssd-allfaces-facealignment-fix

Ssd allfaces facealignment fix
parents 5cc2741b 8fda8661
......@@ -69,7 +69,7 @@ var FaceLandmarks = /** @class */ (function () {
// TODO: pad in case rectangle is out of image bounds
var x = Math.floor(Math.max(0, refPoint.x - (relX * size)));
var y = Math.floor(Math.max(0, refPoint.y - (relY * size)));
return new Rect_1.Rect(x, y, Math.min(size, this._imageWidth - x), Math.min(size, this._imageHeight - y));
return new Rect_1.Rect(x, y, Math.min(size, this._imageWidth + x), Math.min(size, this._imageHeight + y));
};
FaceLandmarks.prototype.getRefPointsForAlignment = function () {
throw new Error('getRefPointsForAlignment not implemented by base class');
......
import { FaceDetectionNet } from './faceDetectionNet/FaceDetectionNet';
import { FaceLandmarkNet } from './faceLandmarkNet/FaceLandmarkNet';
import { FaceRecognitionNet } from './faceRecognitionNet/FaceRecognitionNet';
import { FullFaceDescription } from './FullFaceDescription';
import { Mtcnn } from './mtcnn/Mtcnn';
import { MtcnnForwardParams } from './mtcnn/types';
import { Rect } from './Rect';
import { TNetInput } from './types';
export declare function allFacesFactory(detectionNet: FaceDetectionNet, landmarkNet: FaceLandmarkNet, computeDescriptors: (input: TNetInput, alignedFaceBoxes: Rect[], useBatchProcessing: boolean) => Promise<Float32Array[]>): (input: TNetInput, minConfidence: number, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;
export declare function allFacesMtcnnFactory(mtcnn: Mtcnn, computeDescriptors: (input: TNetInput, alignedFaceBoxes: Rect[], useBatchProcessing: boolean) => Promise<Float32Array[]>): (input: TNetInput, mtcnnForwardParams: MtcnnForwardParams, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;
export declare function allFacesFactory(detectionNet: FaceDetectionNet, landmarkNet: FaceLandmarkNet, recognitionNet: FaceRecognitionNet): (input: TNetInput, minConfidence?: number, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;
export declare function allFacesMtcnnFactory(mtcnn: Mtcnn, recognitionNet: FaceRecognitionNet): (input: TNetInput, mtcnnForwardParams?: MtcnnForwardParams, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;
......@@ -3,8 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var extractFaceTensors_1 = require("./extractFaceTensors");
var FullFaceDescription_1 = require("./FullFaceDescription");
function allFacesFactory(detectionNet, landmarkNet, computeDescriptors) {
function computeDescriptorsFactory(recognitionNet) {
return function (input, alignedFaceBoxes, useBatchProcessing) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var alignedFaceTensors, descriptors, _a;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, extractFaceTensors_1.extractFaceTensors(input, alignedFaceBoxes)];
case 1:
alignedFaceTensors = _b.sent();
if (!useBatchProcessing) return [3 /*break*/, 3];
return [4 /*yield*/, recognitionNet.computeFaceDescriptor(alignedFaceTensors)];
case 2:
_a = _b.sent();
return [3 /*break*/, 5];
case 3: return [4 /*yield*/, Promise.all(alignedFaceTensors.map(function (faceTensor) { return recognitionNet.computeFaceDescriptor(faceTensor); }))];
case 4:
_a = _b.sent();
_b.label = 5;
case 5:
descriptors = _a;
alignedFaceTensors.forEach(function (t) { return t.dispose(); });
return [2 /*return*/, descriptors];
}
});
});
};
}
function allFacesFactory(detectionNet, landmarkNet, recognitionNet) {
var computeDescriptors = computeDescriptorsFactory(recognitionNet);
return function (input, minConfidence, useBatchProcessing) {
if (minConfidence === void 0) { minConfidence = 0.8; }
if (useBatchProcessing === void 0) { useBatchProcessing = false; }
return tslib_1.__awaiter(this, void 0, void 0, function () {
var detections, faceTensors, faceLandmarksByFace, _a, alignedFaceBoxes, descriptors;
......@@ -41,8 +70,10 @@ function allFacesFactory(detectionNet, landmarkNet, computeDescriptors) {
};
}
exports.allFacesFactory = allFacesFactory;
function allFacesMtcnnFactory(mtcnn, computeDescriptors) {
function allFacesMtcnnFactory(mtcnn, recognitionNet) {
var computeDescriptors = computeDescriptorsFactory(recognitionNet);
return function (input, mtcnnForwardParams, useBatchProcessing) {
if (mtcnnForwardParams === void 0) { mtcnnForwardParams = {}; }
if (useBatchProcessing === void 0) { useBatchProcessing = false; }
return tslib_1.__awaiter(this, void 0, void 0, function () {
var results, alignedFaceBoxes, descriptors;
......
{"version":3,"file":"allFacesFactory.js","sourceRoot":"","sources":["../src/allFacesFactory.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAI1D,6DAA4D;AAM5D,yBACE,YAA8B,EAC9B,WAA4B,EAC5B,kBAAwH;IAExH,OAAO,UACL,KAAgB,EAChB,aAAqB,EACrB,kBAAmC;QAAnC,mCAAA,EAAA,0BAAmC;;;;;4BAGhB,qBAAM,YAAY,CAAC,WAAW,CAAC,KAAK,EAAE,aAAa,CAAC,EAAA;;wBAAjE,UAAU,GAAG,SAAoD;wBAEnD,qBAAM,uCAAkB,CAAC,KAAK,EAAE,UAAU,CAAC,EAAA;;wBAAzD,WAAW,GAAG,SAA2C;6BAEnC,kBAAkB,EAAlB,wBAAkB;wBAC1C,qBAAM,WAAW,CAAC,eAAe,CAAC,WAAW,CAAC,EAAA;;wBAA9C,KAAA,SAAmE,CAAA;;4BACnE,qBAAM,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CACjC,UAAA,UAAU,IAAI,OAAA,WAAW,CAAC,eAAe,CAAC,UAAU,CAAC,EAAvC,CAAuC,CACtD,CAAC,EAAA;;wBAFA,KAAA,SAEqB,CAAA;;;wBAJnB,mBAAmB,KAIA;wBAEzB,WAAW,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,EAAE,EAAX,CAAW,CAAC,CAAA;wBAE/B,gBAAgB,GAAG,mBAAmB,CAAC,GAAG,CAC9C,UAAC,SAAS,EAAE,CAAC,IAAK,OAAA,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,EAAvC,CAAuC,CAC1D,CAAA;wBAEmB,qBAAM,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EAAA;;wBAAnF,WAAW,GAAG,SAAqE;wBAEzF,sBAAO,UAAU,CAAC,GAAG,CAAC,UAAC,SAAS,EAAE,CAAC;gCACjC,OAAA,IAAI,yCAAmB,CACrB,SAAS,EACT,mBAAmB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAkB,SAAS,CAAC,MAAM,EAAE,CAAC,EACxE,WAAW,CAAC,CAAC,CAAC,CACf;4BAJD,CAIC,CACF,EAAA;;;;KAEF,CAAA;AACH,CAAC;AAtCD,0CAsCC;AAED,8BACE,KAAY,EACZ,kBAAwH;IAExH,OAAO,UACL,KAAgB,EAChB,kBAAsC,EACtC,kBAAmC;QAAnC,mCAAA,EAAA,0BAAmC;;;;;4BAGnB,qBAAM,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,kBAAkB,CAAC,EAAA;;wBAAxD,OAAO,GAAG,SAA8C;wBAExD,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAClC,UAAC,EAAiB;gCAAf,gCAAa;4BAAO,OAAA,aAAa,CAAC,KAAK,EAAE;wBAArB,CAAqB,CAC7C,CAAA;wBAEmB,qBAAM,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EAAA;;wBAAnF,WAAW,GAAG,SAAqE;wBAEzF,sBAAO,OAAO,CAAC,GAAG,CAAC,UAAC,EAAgC,EAAE,CAAC;oCAAjC,gCAAa,EAAE,gCAAa;gCAChD,OAAA,IAAI,yCAAmB,CACrB,aAAa,EACb,aAAa,EACb,WAAW,CAAC,CAAC,CAAC,CACf;4BAJD,CAIC,CACF,EAAA;;;;KAEF,CAAA;AACH,CAAC;AA3BD,oDA2BC"}
\ No newline at end of file
{"version":3,"file":"allFacesFactory.js","sourceRoot":"","sources":["../src/allFacesFactory.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAK1D,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Af,gCAAa;4BAAO,OAAA,aAAa,CAAC,KAAK,EAAE;wBAArB,CAAqB,CAC7C,CAAA;wBAEmB,qBAAM,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EAAA;;wBAAnF,WAAW,GAAG,SAAqE;wBAEzF,sBAAO,OAAO,CAAC,GAAG,CAAC,UAAC,EAAgC,EAAE,CAAC;oCAAjC,gCAAa,EAAE,gCAAa;gCAChD,OAAA,IAAI,yCAAmB,CACrB,aAAa,EACb,aAAa,EACb,WAAW,CAAC,CAAC,CAAC,CACf;4BAJD,CAIC,CACF,EAAA;;;;KAEF,CAAA;AACH,CAAC;AA7BD,oDA6BC"}
\ No newline at end of file
......@@ -27,5 +27,7 @@ export declare function locateFaces(input: TNetInput, minConfidence?: number, ma
export declare function detectLandmarks(input: TNetInput): Promise<FaceLandmarks68 | FaceLandmarks68[]>;
export declare function computeFaceDescriptor(input: TNetInput): Promise<Float32Array | Float32Array[]>;
export declare function mtcnn(input: TNetInput, forwardParams: MtcnnForwardParams): Promise<MtcnnResult[]>;
export declare const allFaces: (input: tf.Tensor | NetInput | TNetInput, minConfidence: number, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;
export declare const allFacesMtcnn: (input: tf.Tensor | NetInput | TNetInput, mtcnnForwardParams: MtcnnForwardParams, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;
export declare type allFacesFunction = (input: tf.Tensor | NetInput | TNetInput, minConfidence?: number, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;
export declare const allFaces: allFacesFunction;
export declare type allFacesMtcnnFunction = (input: tf.Tensor | NetInput | TNetInput, mtcnnForwardParams?: MtcnnForwardParams, useBatchProcessing?: boolean) => Promise<FullFaceDescription[]>;
export declare const allFacesMtcnn: allFacesMtcnnFunction;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var allFacesFactory_1 = require("./allFacesFactory");
var extractFaceTensors_1 = require("./extractFaceTensors");
var FaceDetectionNet_1 = require("./faceDetectionNet/FaceDetectionNet");
var FaceLandmarkNet_1 = require("./faceLandmarkNet/FaceLandmarkNet");
var FaceRecognitionNet_1 = require("./faceRecognitionNet/FaceRecognitionNet");
......@@ -59,33 +57,6 @@ function mtcnn(input, forwardParams) {
return exports.nets.mtcnn.forward(input, forwardParams);
}
exports.mtcnn = mtcnn;
exports.allFaces = allFacesFactory_1.allFacesFactory(exports.detectionNet, exports.landmarkNet, computeDescriptorsFactory(exports.nets.faceRecognitionNet));
exports.allFacesMtcnn = allFacesFactory_1.allFacesMtcnnFactory(exports.nets.mtcnn, computeDescriptorsFactory(exports.nets.faceRecognitionNet));
function computeDescriptorsFactory(recognitionNet) {
return function (input, alignedFaceBoxes, useBatchProcessing) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var alignedFaceTensors, descriptors, _a;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, extractFaceTensors_1.extractFaceTensors(input, alignedFaceBoxes)];
case 1:
alignedFaceTensors = _b.sent();
if (!useBatchProcessing) return [3 /*break*/, 3];
return [4 /*yield*/, recognitionNet.computeFaceDescriptor(alignedFaceTensors)];
case 2:
_a = _b.sent();
return [3 /*break*/, 5];
case 3: return [4 /*yield*/, Promise.all(alignedFaceTensors.map(function (faceTensor) { return recognitionNet.computeFaceDescriptor(faceTensor); }))];
case 4:
_a = _b.sent();
_b.label = 5;
case 5:
descriptors = _a;
alignedFaceTensors.forEach(function (t) { return t.dispose(); });
return [2 /*return*/, descriptors];
}
});
});
};
}
exports.allFaces = allFacesFactory_1.allFacesFactory(exports.nets.ssdMobilenet, exports.nets.faceLandmark68Net, exports.nets.faceRecognitionNet);
exports.allFacesMtcnn = allFacesFactory_1.allFacesMtcnnFactory(exports.nets.mtcnn, exports.nets.faceRecognitionNet);
//# sourceMappingURL=globalApi.js.map
\ No newline at end of file
{"version":3,"file":"globalApi.js","sourceRoot":"","sources":["../src/globalApi.ts"],"names":[],"m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AC;AAPD,gCAOC;AAED,qBACE,KAAgB,EAChB,aAAsB,EACtB,UAAmB;IAEnB,OAAO,YAAI,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,CAAC,CAAA;AACxE,CAAC;AAND,kCAMC;AAED,yBACE,KAAgB;IAEhB,OAAO,YAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAA;AACtD,CAAC;AAJD,0CAIC;AAED,+BACE,KAAgB;IAEhB,OAAO,YAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAA;AAC7D,CAAC;AAJD,sDAIC;AAED,eACE,KAAgB,EAChB,aAAiC;IAEjC,OAAO,YAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,CAAA;AACjD,CAAC;AALD,sBAKC;AAQY,QAAA,QAAQ,GAAqB,iCAAe,CACvD,YAAI,CAAC,YAAY,EACjB,YAAI,CAAC,iBAAiB,EACtB,YAAI,CAAC,kBAAkB,CACxB,CAAA;AAQY,QAAA,aAAa,GAA0B,sCAAoB,CACtE,YAAI,CAAC,KAAK,EACV,YAAI,CAAC,kBAAkB,CACxB,CAAA"}
\ No newline at end of file
......@@ -4,12 +4,12 @@ import { TNetInput } from '../types';
import { MtcnnForwardParams, MtcnnResult, NetParams } from './types';
export declare class Mtcnn extends NeuralNetwork<NetParams> {
constructor();
forwardInput(input: NetInput, forwardParams: MtcnnForwardParams): Promise<{
forwardInput(input: NetInput, forwardParams?: MtcnnForwardParams): Promise<{
results: MtcnnResult[];
stats: any;
}>;
forward(input: TNetInput, forwardParams: MtcnnForwardParams): Promise<MtcnnResult[]>;
forwardWithStats(input: TNetInput, forwardParams: MtcnnForwardParams): Promise<{
forward(input: TNetInput, forwardParams?: MtcnnForwardParams): Promise<MtcnnResult[]>;
forwardWithStats(input: TNetInput, forwardParams?: MtcnnForwardParams): Promise<{
results: MtcnnResult[];
stats: any;
}>;
......
......@@ -24,6 +24,7 @@ var Mtcnn = /** @class */ (function (_super) {
return _super.call(this, 'Mtcnn') || this;
}
Mtcnn.prototype.forwardInput = function (input, forwardParams) {
if (forwardParams === void 0) { forwardParams = {}; }
return tslib_1.__awaiter(this, void 0, void 0, function () {
var params, inputTensor, inputCanvas, stats, tsTotal, imgTensor, onReturn, _a, height, width, _b, minFaceSize, scaleFactor, maxNumScales, scoreThresholds, scaleSteps, scales, ts, out1, out2, out3, results;
return tslib_1.__generator(this, function (_c) {
......@@ -98,6 +99,7 @@ var Mtcnn = /** @class */ (function (_super) {
});
};
Mtcnn.prototype.forward = function (input, forwardParams) {
if (forwardParams === void 0) { forwardParams = {}; }
return tslib_1.__awaiter(this, void 0, void 0, function () {
var _a;
return tslib_1.__generator(this, function (_b) {
......@@ -113,6 +115,7 @@ var Mtcnn = /** @class */ (function (_super) {
});
};
Mtcnn.prototype.forwardWithStats = function (input, forwardParams) {
if (forwardParams === void 0) { forwardParams = {}; }
return tslib_1.__awaiter(this, void 0, void 0, function () {
var _a;
return tslib_1.__generator(this, function (_b) {
......
{"version":3,"file":"Mtcnn.js","sourceRoot":"","sources":["../../src/mtcnn/Mtcnn.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAE5C,0DAAyD;AACzD,kDAAiD;AAEjD,kCAAiC;AACjC,gCAA+B;AAC/B,4CAA2C;AAE3C,mDAAkD;AAClD,mCAAqC;AACrC,iDAAgD;AAChD,mDAAkD;AAClD,+EAA8E;AAC9E,uDAAsD;AACtD,6DAA4D;AAC5D,6CAA4C;AAC5C,mCAAkC;AAClC,mCAAkC;AAClC,mCAAkC;AAGlC;IAA2B,iCAAwB;IAEjD;eACE,kBAAM,OAAO,CAAC;IAChB,CAAC;IAEY,4BAAY,GAAzB,UACE,KAAe,EACf,aAAiC;;;;;;wBAGzB,MAAM,GAAK,IAAI,OAAT,CAAS;wBAEvB,IAAI,CAAC,MAAM,EAAE;4BACX,MAAM,IAAI,KAAK,CAAC,qCAAqC,C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AAK,EAAE,MAAM,CAAC,CAAC,EAAhC,CAAgC,CAAC,EAC5D,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,CAClB;yBACF,CAAC,EAlB2C,CAkB3C,CAAC,CAAA;wBAEH,sBAAO,QAAQ,CAAC,EAAE,OAAO,SAAA,EAAE,KAAK,OAAA,EAAE,CAAC,EAAA;;;;KACpC;IAEY,uBAAO,GAApB,UACE,KAAgB,EAChB,aAAsC;QAAtC,8BAAA,EAAA,kBAAsC;;;;;;wBAG9B,KAAA,IAAI,CAAC,YAAY,CAAA;wBACrB,qBAAM,uBAAU,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,EAAA;4BADrC,qBAAM,SAAA,IAAI,GACR,SAAmC;4BACnC,aAAa,EACd,EAAA;4BAJH,sBAAO,CACL,SAGC,CACF,CAAC,OAAO,EAAA;;;;KACV;IAEY,gCAAgB,GAA7B,UACE,KAAgB,EAChB,aAAsC;QAAtC,8BAAA,EAAA,kBAAsC;;;;;;wBAE/B,KAAA,IAAI,CAAC,YAAY,CAAA;wBACtB,qBAAM,uBAAU,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,EAAA;4BADrC,sBAAO,SAAA,IAAI,GACT,SAAmC;4BACnC,aAAa,EACd,EAAA;;;;KACF;IAED,8CAA8C;IACpC,mCAAmB,GAA7B,UAA8B,GAAuB;QACnD,OAAO,yCAAmB,CAAC,GAAG,CAAC,CAAA;IACjC,CAAC;IAES,6BAAa,GAAvB,UAAwB,OAAqB;QAC3C,OAAO,6BAAa,CAAC,OAAO,CAAC,CAAA;IAC/B,CAAC;IACH,YAAC;AAAD,CAAC,AA5ID,CAA2B,6BAAa,GA4IvC;AA5IY,sBAAK"}
\ No newline at end of file
......@@ -1095,7 +1095,7 @@
// TODO: pad in case rectangle is out of image bounds
var x = Math.floor(Math.max(0, refPoint.x - (relX * size)));
var y = Math.floor(Math.max(0, refPoint.y - (relY * size)));
return new Rect(x, y, Math.min(size, this._imageWidth - x), Math.min(size, this._imageHeight - y));
return new Rect(x, y, Math.min(size, this._imageWidth + x), Math.min(size, this._imageHeight + y));
};
FaceLandmarks.prototype.getRefPointsForAlignment = function () {
throw new Error('getRefPointsForAlignment not implemented by base class');
......@@ -2443,8 +2443,37 @@
return createFaceRecognitionNet(weights);
}
function allFacesFactory(detectionNet, landmarkNet, computeDescriptors) {
function computeDescriptorsFactory(recognitionNet) {
return function (input, alignedFaceBoxes, useBatchProcessing) {
return __awaiter$1(this, void 0, void 0, function () {
var alignedFaceTensors, descriptors, _a;
return __generator$1(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, extractFaceTensors(input, alignedFaceBoxes)];
case 1:
alignedFaceTensors = _b.sent();
if (!useBatchProcessing) return [3 /*break*/, 3];
return [4 /*yield*/, recognitionNet.computeFaceDescriptor(alignedFaceTensors)];
case 2:
_a = _b.sent();
return [3 /*break*/, 5];
case 3: return [4 /*yield*/, Promise.all(alignedFaceTensors.map(function (faceTensor) { return recognitionNet.computeFaceDescriptor(faceTensor); }))];
case 4:
_a = _b.sent();
_b.label = 5;
case 5:
descriptors = _a;
alignedFaceTensors.forEach(function (t) { return t.dispose(); });
return [2 /*return*/, descriptors];
}
});
});
};
}
function allFacesFactory(detectionNet, landmarkNet, recognitionNet) {
var computeDescriptors = computeDescriptorsFactory(recognitionNet);
return function (input, minConfidence, useBatchProcessing) {
if (minConfidence === void 0) { minConfidence = 0.8; }
if (useBatchProcessing === void 0) { useBatchProcessing = false; }
return __awaiter$1(this, void 0, void 0, function () {
var detections, faceTensors, faceLandmarksByFace, _a, alignedFaceBoxes, descriptors;
......@@ -2480,8 +2509,10 @@
});
};
}
function allFacesMtcnnFactory(mtcnn, computeDescriptors) {
function allFacesMtcnnFactory(mtcnn, recognitionNet) {
var computeDescriptors = computeDescriptorsFactory(recognitionNet);
return function (input, mtcnnForwardParams, useBatchProcessing) {
if (mtcnnForwardParams === void 0) { mtcnnForwardParams = {}; }
if (useBatchProcessing === void 0) { useBatchProcessing = false; }
return __awaiter$1(this, void 0, void 0, function () {
var results, alignedFaceBoxes, descriptors;
......@@ -3167,6 +3198,7 @@
return _super.call(this, 'Mtcnn') || this;
}
Mtcnn.prototype.forwardInput = function (input, forwardParams) {
if (forwardParams === void 0) { forwardParams = {}; }
return __awaiter$1(this, void 0, void 0, function () {
var params, inputTensor, inputCanvas, stats, tsTotal, imgTensor, onReturn, _a, height, width, _b, minFaceSize, scaleFactor, maxNumScales, scoreThresholds, scaleSteps, scales, ts, out1, out2, out3, results;
return __generator$1(this, function (_c) {
......@@ -3241,6 +3273,7 @@
});
};
Mtcnn.prototype.forward = function (input, forwardParams) {
if (forwardParams === void 0) { forwardParams = {}; }
return __awaiter$1(this, void 0, void 0, function () {
var _a;
return __generator$1(this, function (_b) {
......@@ -3256,6 +3289,7 @@
});
};
Mtcnn.prototype.forwardWithStats = function (input, forwardParams) {
if (forwardParams === void 0) { forwardParams = {}; }
return __awaiter$1(this, void 0, void 0, function () {
var _a;
return __generator$1(this, function (_b) {
......@@ -3322,35 +3356,8 @@
function mtcnn(input, forwardParams) {
return nets.mtcnn.forward(input, forwardParams);
}
var allFaces = allFacesFactory(detectionNet, landmarkNet, computeDescriptorsFactory(nets.faceRecognitionNet));
var allFacesMtcnn = allFacesMtcnnFactory(nets.mtcnn, computeDescriptorsFactory(nets.faceRecognitionNet));
function computeDescriptorsFactory(recognitionNet) {
return function (input, alignedFaceBoxes, useBatchProcessing) {
return __awaiter$1(this, void 0, void 0, function () {
var alignedFaceTensors, descriptors, _a;
return __generator$1(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, extractFaceTensors(input, alignedFaceBoxes)];
case 1:
alignedFaceTensors = _b.sent();
if (!useBatchProcessing) return [3 /*break*/, 3];
return [4 /*yield*/, recognitionNet.computeFaceDescriptor(alignedFaceTensors)];
case 2:
_a = _b.sent();
return [3 /*break*/, 5];
case 3: return [4 /*yield*/, Promise.all(alignedFaceTensors.map(function (faceTensor) { return recognitionNet.computeFaceDescriptor(faceTensor); }))];
case 4:
_a = _b.sent();
_b.label = 5;
case 5:
descriptors = _a;
alignedFaceTensors.forEach(function (t) { return t.dispose(); });
return [2 /*return*/, descriptors];
}
});
});
};
}
var allFaces = allFacesFactory(nets.ssdMobilenet, nets.faceLandmark68Net, nets.faceRecognitionNet);
var allFacesMtcnn = allFacesMtcnnFactory(nets.mtcnn, nets.faceRecognitionNet);
function createMtcnn(weights) {
var net = new Mtcnn();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -105,7 +105,7 @@ export class FaceLandmarks {
const x = Math.floor(Math.max(0, refPoint.x - (relX * size)))
const y = Math.floor(Math.max(0, refPoint.y - (relY * size)))
return new Rect(x, y, Math.min(size, this._imageWidth - x), Math.min(size, this._imageHeight - y))
return new Rect(x, y, Math.min(size, this._imageWidth + x), Math.min(size, this._imageHeight + y))
}
protected getRefPointsForAlignment(): Point[] {
......
......@@ -2,25 +2,45 @@ import { extractFaceTensors } from './extractFaceTensors';
import { FaceDetectionNet } from './faceDetectionNet/FaceDetectionNet';
import { FaceLandmarkNet } from './faceLandmarkNet/FaceLandmarkNet';
import { FaceLandmarks68 } from './faceLandmarkNet/FaceLandmarks68';
import { FaceRecognitionNet } from './faceRecognitionNet/FaceRecognitionNet';
import { FullFaceDescription } from './FullFaceDescription';
import { Mtcnn } from './mtcnn/Mtcnn';
import { MtcnnForwardParams } from './mtcnn/types';
import { Rect } from './Rect';
import { TNetInput } from './types';
function computeDescriptorsFactory(
recognitionNet: FaceRecognitionNet
) {
return async function(input: TNetInput, alignedFaceBoxes: Rect[], useBatchProcessing: boolean) {
const alignedFaceTensors = await extractFaceTensors(input, alignedFaceBoxes)
const descriptors = useBatchProcessing
? await recognitionNet.computeFaceDescriptor(alignedFaceTensors) as Float32Array[]
: await Promise.all(alignedFaceTensors.map(
faceTensor => recognitionNet.computeFaceDescriptor(faceTensor)
)) as Float32Array[]
alignedFaceTensors.forEach(t => t.dispose())
return descriptors
}
}
export function allFacesFactory(
detectionNet: FaceDetectionNet,
landmarkNet: FaceLandmarkNet,
computeDescriptors: (input: TNetInput, alignedFaceBoxes: Rect[], useBatchProcessing: boolean) => Promise<Float32Array[]>
recognitionNet: FaceRecognitionNet
) {
const computeDescriptors = computeDescriptorsFactory(recognitionNet)
return async function(
input: TNetInput,
minConfidence: number,
minConfidence: number = 0.8,
useBatchProcessing: boolean = false
): Promise<FullFaceDescription[]> {
const detections = await detectionNet.locateFaces(input, minConfidence)
const faceTensors = await extractFaceTensors(input, detections)
const faceLandmarksByFace = useBatchProcessing
......@@ -50,11 +70,13 @@ export function allFacesFactory(
export function allFacesMtcnnFactory(
mtcnn: Mtcnn,
computeDescriptors: (input: TNetInput, alignedFaceBoxes: Rect[], useBatchProcessing: boolean) => Promise<Float32Array[]>
recognitionNet: FaceRecognitionNet
) {
const computeDescriptors = computeDescriptorsFactory(recognitionNet)
return async function(
input: TNetInput,
mtcnnForwardParams: MtcnnForwardParams,
mtcnnForwardParams: MtcnnForwardParams = {},
useBatchProcessing: boolean = false
): Promise<FullFaceDescription[]> {
......
......@@ -50,7 +50,7 @@ export class FaceDetectionNet extends NeuralNetwork<NetParams> {
public async locateFaces(
input: TNetInput,
minConfidence: number = 0.8,
maxResults: number = 100,
maxResults: number = 100
): Promise<FaceDetection[]> {
const netInput = await toNetInput(input, true)
......
import * as tf from '@tensorflow/tfjs-core';
import { allFacesFactory, allFacesMtcnnFactory } from './allFacesFactory';
import { extractFaceTensors } from './extractFaceTensors';
import { FaceDetection } from './FaceDetection';
import { FaceDetectionNet } from './faceDetectionNet/FaceDetectionNet';
import { FaceLandmarkNet } from './faceLandmarkNet/FaceLandmarkNet';
......@@ -11,7 +10,6 @@ import { FullFaceDescription } from './FullFaceDescription';
import { Mtcnn } from './mtcnn/Mtcnn';
import { MtcnnForwardParams, MtcnnResult } from './mtcnn/types';
import { NetInput } from './NetInput';
import { Rect } from './Rect';
import { TNetInput } from './types';
export const detectionNet = new FaceDetectionNet()
......@@ -79,39 +77,25 @@ export function mtcnn(
return nets.mtcnn.forward(input, forwardParams)
}
export const allFaces: (
export type allFacesFunction = (
input: tf.Tensor | NetInput | TNetInput,
minConfidence: number,
minConfidence?: number,
useBatchProcessing?: boolean
) => Promise<FullFaceDescription[]> = allFacesFactory(
detectionNet,
landmarkNet,
computeDescriptorsFactory(nets.faceRecognitionNet)
) => Promise<FullFaceDescription[]>
export const allFaces: allFacesFunction = allFacesFactory(
nets.ssdMobilenet,
nets.faceLandmark68Net,
nets.faceRecognitionNet
)
export const allFacesMtcnn: (
export type allFacesMtcnnFunction = (
input: tf.Tensor | NetInput | TNetInput,
mtcnnForwardParams: MtcnnForwardParams,
mtcnnForwardParams?: MtcnnForwardParams,
useBatchProcessing?: boolean
) => Promise<FullFaceDescription[]> = allFacesMtcnnFactory(
nets.mtcnn,
computeDescriptorsFactory(nets.faceRecognitionNet)
)
) => Promise<FullFaceDescription[]>
function computeDescriptorsFactory(
recognitionNet: FaceRecognitionNet
) {
return async function(input: TNetInput, alignedFaceBoxes: Rect[], useBatchProcessing: boolean) {
const alignedFaceTensors = await extractFaceTensors(input, alignedFaceBoxes)
const descriptors = useBatchProcessing
? await recognitionNet.computeFaceDescriptor(alignedFaceTensors) as Float32Array[]
: await Promise.all(alignedFaceTensors.map(
faceTensor => recognitionNet.computeFaceDescriptor(faceTensor)
)) as Float32Array[]
alignedFaceTensors.forEach(t => t.dispose())
return descriptors
}
}
\ No newline at end of file
export const allFacesMtcnn: allFacesMtcnnFunction = allFacesMtcnnFactory(
nets.mtcnn,
nets.faceRecognitionNet
)
\ No newline at end of file
......@@ -28,7 +28,7 @@ export class Mtcnn extends NeuralNetwork<NetParams> {
public async forwardInput(
input: NetInput,
forwardParams: MtcnnForwardParams
forwardParams: MtcnnForwardParams = {}
): Promise<{ results: MtcnnResult[], stats: any }> {
const { params } = this
......@@ -132,7 +132,7 @@ export class Mtcnn extends NeuralNetwork<NetParams> {
public async forward(
input: TNetInput,
forwardParams: MtcnnForwardParams
forwardParams: MtcnnForwardParams = {}
): Promise<MtcnnResult[]> {
return (
await this.forwardInput(
......@@ -144,7 +144,7 @@ export class Mtcnn extends NeuralNetwork<NetParams> {
public async forwardWithStats(
input: TNetInput,
forwardParams: MtcnnForwardParams
forwardParams: MtcnnForwardParams = {}
): Promise<{ results: MtcnnResult[], stats: any }> {
return this.forwardInput(
await toNetInput(input, true, true),
......
[[-0.14404241740703583, 0.020420558750629425, 0.12159731984138489, 0.06673850864171982, -0.1845773458480835, -0.006459429860115051, -0.018922673538327217, -0.09011562168598175, 0.1014566421508789, -0.06833116710186005, 0.1313943713903427, -0.059500157833099365, -0.2429366409778595, 0.12969601154327393, -0.03123823180794716, 0.17403516173362732, -0.06976033747196198, -0.08903076499700546, -0.1670686900615692, -0.0905330702662468, 0.026567362248897552, 0.059487584978342056, 0.05232132971286774, 0.10820496082305908, -0.16574358940124512, -0.31992703676223755, -0.021159984171390533, -0.07648815214633942, 0.061189644038677216, 0.01882709003984928, -0.048110153526067734, 0.09231358021497726, -0.16308540105819702, -0.0308229923248291, 0.08153855800628662, 0.050749342888593674, 0.013089634478092194, 0.010833777487277985, 0.22493457794189453, -0.005780760198831558, -0.3017699122428894, 0.009801583364605904, 0.10426986962556839, 0.20322877168655396, 0.18211282789707184, 0.11280057579278946, 0.08282452076673508, -0.10828351974487305, 0.10574567317962646, -0.33380937576293945, 0.017940619960427284, 0.14281710982322693, 0.026437608525156975, 0.02825773134827614, 0.07432245463132858, -0.2295369654893875, -0.036365751177072525, 0.08971801400184631, -0.14061452448368073, 0.10517840832471848, 0.08703923225402832, 0.015264930203557014, -0.028071045875549316, -0.09756545722484589, 0.1787717193365097, 0.0928979441523552, -0.12441863119602203, -0.13970641791820526, 0.16826023161411285, -0.2287701666355133, -0.007024107500910759, 0.17693987488746643, -0.10933536291122437, -0.19572770595550537, -0.29248538613319397, -0.022097650915384293, 0.5018369555473328, 0.1315133422613144, -0.17158204317092896, -0.06210331246256828, -0.03497014939785004, 0.00930861197412014, 0.06882740557193756, 0.06423769891262054, -0.05281900614500046, -0.03944452479481697, -0.040059495717287064, 0.02342894673347473, 0.25209322571754456, -0.018084552139043808, 0.0385407917201519, 0.24800404906272888, 0.10142052918672562, -0.01649537868797779, -0.01963762380182743, 0.18608947098255157, -0.1553012877702713, -0.061059728264808655, -0.17497558891773224, -0.018999110907316208, 0.0031996723264455795, 0.03891829773783684, 0.08639538288116455, 0.0968272015452385, -0.2213348150253296, 0.19600607454776764, -0.12203031778335571, -0.05167662352323532, -0.03981113061308861, 0.05974903330206871, -0.10548581928014755, 0.006194081157445908, 0.18520109355449677, -0.18155987560749054, 0.10244937986135483, 0.20877017080783844, -0.029200386255979538, 0.0688735619187355, 0.035200126469135284, 0.061611589044332504, 0.0020254189148545265, 0.04999671131372452, -0.1587153673171997, -0.12486191838979721, 0.06645583361387253, -0.1836017519235611, -0.01840708777308464, 0.008367311209440231],
[-0.07981500774621964, 0.11756777763366699, 0.02936466969549656, -0.09633475542068481, -0.15267357230186462, -0.011278534308075905, -0.001300307922065258, 0.0360361747443676, 0.17416930198669434, -0.017560135573148727, 0.13196146488189697, -0.06830444186925888, -0.29480257630348206, -0.03122542053461075, -0.06372717022895813, 0.09800832718610764, -0.23692278563976288, -0.10906898230314255, -0.01810368150472641, -0.1275140941143036, 0.0789264440536499, 0.09011727571487427, -0.024859212338924408, 0.09766484051942825, -0.11434200406074524, -0.2884414494037628, -0.025204341858625412, -0.18114201724529266, 0.10241267085075378, -0.1564866155385971, 0.03878610581159592, 0.09216093271970749, -0.08629581332206726, -0.07612591236829758, -0.007761821150779724, 0.05982988327741623, -0.01618112437427044, -0.11326153576374054, 0.1909821480512619, 0.03072071261703968, -0.1123855710029602, 0.008064975962042809, 0.02313450537621975, 0.4029819071292877, 0.13979993760585785, 0.03689645603299141, 0.0571918711066246, 0.006454968824982643, 0.1722615510225296, -0.21643899381160736, 0.04860049486160278, 0.1964837908744812, 0.09936783462762833, 0.013555353507399559, 0.1356257051229477, -0.15182176232337952, 0.014821959659457207, 0.14483428001403809, -0.22364187240600586, 0.1065005213022232, 0.10592366009950638, 0.04265245050191879, 0.010688506066799164, -0.11790886521339417, 0.15378248691558838, 0.02181466668844223, -0.09279246628284454, -0.10258939862251282, 0.13707773387432098, -0.1889384388923645, -0.1254684329032898, 0.06016359105706215, -0.14417685568332672, -0.0884396955370903, -0.19703182578086853, 0.008006387390196323, 0.3649013340473175, 0.17656049132347107, -0.10456853359937668, 0.034014202654361725, -0.02204163931310177, -0.030664954334497452, 0.09979542344808578, 0.05958552658557892, -0.11041656881570816, -0.0012588966637849808, -0.09470727294683456, 0.029211319983005524, 0.1301136016845703, 0.02824041247367859, -0.05213681235909462, 0.16133788228034973, 0.06453216075897217, -0.06588482856750488, 0.03479577228426933, -0.04281643033027649, -0.11604544520378113, 0.017909755930304527, -0.10244867205619812, 0.0026457589119672775, 0.03951391205191612, -0.15675100684165955, -0.03322248160839081, 0.06447272002696991, -0.1749180257320404, 0.1186823770403862, 0.018416468054056168, 0.0057243346236646175, -0.0821719840168953, 0.04123109579086304, -0.1651352494955063, 0.0557333379983902, 0.22582757472991943, -0.2417983114719391, 0.14351877570152283, 0.17512904107570648, 0.0387265682220459, 0.09988535940647125, 0.04966028034687042, 0.030464978888630867, -0.008326411247253418, -0.05624760314822197, -0.1279410421848297, -0.1480567455291748, 0.05000598356127739, -0.020273571833968163, 0.06707905232906342, 0.01750762201845646],
[-0.0737464651465416, 0.10227955877780914, 0.045663461089134216, 0.002152875065803528, 0.009061860851943493, 0.041457511484622955, -0.0363280288875103, -0.029537897557020187, 0.20743197202682495, -0.08834147453308105, 0.24489930272102356, 0.032994892448186874, -0.2592104375362396, -0.020188704133033752, -0.08490309864282608, 0.0849633663892746, -0.11557746678590775, -0.06636104732751846, -0.09154438227415085, -0.050566721707582474, 0.09158705174922943, 0.10730121284723282, 0.07843941450119019, -0.004716010764241219, -0.10810066014528275, -0.39324918389320374, -0.1305016577243805, -0.08330740034580231, -0.0036739520728588104, -0.030765876173973083, 0.019488206133246422, 0.004923966247588396, -0.20298710465431213, -0.03460344672203064, 0.044474586844444275, 0.07522155344486237, -0.07436703890562057, 0.012282747775316238, 0.12453831732273102, 0.04521659389138222, -0.10746897011995316, 0.0348062664270401, 0.06490033864974976, 0.30782240629196167, 0.13561832904815674, 0.04975732043385506, -0.003293197602033615, -0.11471724510192871, 0.03620770573616028, -0.2719414532184601, 0.16933363676071167, 0.14766038954257965, 0.13480553030967712, 0.12729986011981964, 0.19226641952991486, -0.12410514801740646, -0.004798094276338816, 0.1369594782590866, -0.14226339757442474, 0.09994019567966461, 0.050312548875808716, 0.08937902748584747, -0.0024147313088178635, -0.08850325644016266, 0.13694575428962708, 0.1042422354221344, -0.15734383463859558, -0.1722884625196457, 0.01907198503613472, -0.1980213075876236, 0.008401932194828987, 0.1310276836156845, -0.08898252993822098, -0.2503238320350647, -0.2706325948238373, 0.1248704269528389, 0.40481770038604736, 0.20478859543800354, -0.12876024842262268, -0.006813257932662964, -0.04922744259238243, -0.06709268689155579, 0.04355831816792488, -0.003456573933362961, -0.11132106184959412, 0.04055509716272354, -0.08725453913211823, 0.06786619126796722, 0.15359823405742645, 0.004168705083429813, -0.08209235966205597, 0.2625846266746521, -0.06305798888206482, 0.018265152350068092, 0.02244562655687332, 0.05237526446580887, -0.1300857961177826, -0.004572143778204918, -0.20017029345035553, -0.012051284313201904, -0.061292197555303574, -0.09332993626594543, -0.06143403425812721, 0.015400122851133347, -0.13490766286849976, 0.11769682168960571, -0.028142036870121956, -0.06330903619527817, -0.018554333597421646, 0.03908921405673027, -0.25225508213043213, -0.016484694555401802, 0.17153753340244293, -0.2887243330478668, 0.19834962487220764, 0.11764566600322723, 0.0824105441570282, 0.16050225496292114, 0.12200618535280228, 0.06956330686807632, -0.007610949221998453, -0.029755599796772003, -0.11322794109582901, -0.06064249575138092, 0.032834120094776154, -0.017432063817977905, 0.02160019613802433, -0.0409822091460228],
[0.02198081463575363, 0.14465422928333282, 0.07101303339004517, -0.044889725744724274, -0.13926607370376587, 0.04856165871024132, 0.017496149986982346, -0.19866913557052612, 0.18785734474658966, -0.026991918683052063, 0.15308845043182373, -0.17339034378528595, -0.2501252293586731, 0.058495186269283295, -0.03581349924206734, 0.13019725680351257, -0.05490950495004654, -0.26040923595428467, -0.1364300549030304, -0.08451102674007416, 0.025452375411987305, -0.07919269055128098, 0.04486474394798279, 0.1439180076122284, -0.25699424743652344, -0.29463642835617065, -0.07614881545305252, -0.08073395490646362, 0.0010398533195257187, -0.13200102746486664, 0.019853388890624046, 0.10385788977146149, -0.21561194956302643, 0.0026465803384780884, 0.06799249351024628, 0.07691547274589539, -0.044076863676309586, -0.17641012370586395, 0.2100786417722702, 0.007020076736807823, -0.25046873092651367, -0.00371517613530159, 0.09093756973743439, 0.2862309515476227, 0.21583841741085052, -0.017651448026299477, 0.09234227985143661, -0.055896956473588943, 0.06638403236865997, -0.25630074739456177, 0.051851771771907806, 0.2166277915239334, 0.047334928065538406, 0.06653263419866562, 0.06419968605041504, -0.10982727259397507, -0.020135242491960526, 0.16812273859977722, -0.1735689789056778, 0.10705995559692383, 0.1650555431842804, -0.09183922410011292, -0.1027933657169342, -0.19209715723991394, 0.23922601342201233, 0.16908636689186096, -0.1708422303199768, -0.17500729858875275, 0.13317111134529114, -0.18402671813964844, -0.09851723909378052, 0.08667218685150146, -0.18973618745803833, -0.17125304043293, -0.28838276863098145, 0.005678129382431507, 0.4719759225845337, 0.18350759148597717, -0.21023567020893097, 0.018875613808631897, -0.06975957006216049, 0.11724178493022919, -0.021086065098643303, 0.17786994576454163, 0.00879625603556633, 0.0294604804366827, -0.060828305780887604, 0.05347011238336563, 0.21962711215019226, -0.04817062243819237, -0.05765945091843605, 0.23210160434246063, -0.050482627004384995, -0.08786634355783463, -0.06896024942398071, 0.04401649907231331, -0.14302408695220947, -0.020030740648508072, -0.11611396074295044, -0.04479845613241196, -0.05181102827191353, 0.10492114722728729, 0.02000310830771923, 0.13014227151870728, -0.1863778680562973, 0.15746904909610748, -0.054266855120658875, -0.0250262301415205, -0.033258792012929916, -0.011298771016299725, -0.04757513850927353, -0.05224163457751274, 0.15656690299510956, -0.3682935833930969, 0.06213179603219032, 0.16651077568531036, 0.03426094353199005, 0.03080114722251892, 0.02673438750207424, 0.08827059715986252, 0.1152452826499939, 0.04749817028641701, -0.14758148789405823, -0.07230862230062485, 0.024923574179410934, -0.05493896082043648, -0.018974684178829193, 0.0009641367942094803],
[-0.06684798002243042, 0.05922340601682663, 0.03716277703642845, -0.11239336431026459, -0.18310244381427765, -0.010310834273695946, 0.01709100976586342, -0.04950016736984253, 0.23486261069774628, -0.1753203421831131, 0.10588856041431427, -0.11691691726446152, -0.20737314224243164, 0.12660200893878937, -0.15450622141361237, 0.16686448454856873, -0.09791915118694305, -0.23812399804592133, -0.1779497265815735, -0.1746053546667099, -0.01481611281633377, 0.15330976247787476, -0.07816223055124283, 0.0861457884311676, -0.22246965765953064, -0.2708512544631958, -0.02174360305070877, -0.10684919357299805, 0.021600646898150444, -0.1305447816848755, 0.017891542986035347, 0.16137775778770447, -0.12418492138385773, 0.0313592366874218, 0.07718440145254135, 0.055879898369312286, -0.03148127347230911, -0.12486975640058517, 0.189072847366333, 0.07495227456092834, -0.2095707654953003, -0.044153619557619095, 0.09027774631977081, 0.3525503873825073, 0.23498742282390594, -0.04670509696006775, 0.023158598691225052, -0.1177847608923912, 0.19942888617515564, -0.28232964873313904, 0.04704594612121582, 0.12507376074790955, 0.04618150368332863, 0.15522485971450806, 0.06179865822196007, -0.1984272003173828, -0.00590172503143549, 0.18643082678318024, -0.16332827508449554, 0.09756657481193542, 0.08710655570030212, -0.12244651466608047, -0.09849074482917786, -0.11016225069761276, 0.24822495877742767, 0.08270874619483948, -0.1605307161808014, -0.20422376692295074, 0.23375490307807922, -0.1974012851715088, -0.06580758094787598, 0.053780052810907364, -0.12804099917411804, -0.09998556971549988, -0.19582915306091309, 0.06955525279045105, 0.3811401128768921, 0.1432715505361557, -0.0868157297372818, 0.0744328498840332, -0.03472564369440079, 0.03826254606246948, -0.036687128245830536, 0.14493891596794128, -0.08616751432418823, -0.07286832481622696, -0.013981971889734268, 0.07470613718032837, 0.22572174668312073, -0.0338052362203598, -0.028185199946165085, 0.2109299749135971, -0.05843852832913399, -0.05966894328594208, -0.030498074367642403, 0.054557397961616516, -0.2513957619667053, 0.06607527285814285, -0.027195891365408897, 0.014261949807405472, 0.07442091405391693, -0.008841129019856453, 0.037929460406303406, 0.15702521800994873, -0.13151004910469055, 0.24407081305980682, -0.12499392777681351, 0.036869585514068604, 0.006168995052576065, -0.03415437415242195, -0.026657897979021072, -0.02339569479227066, 0.17248684167861938, -0.2094629853963852, 0.153985857963562, 0.08107446879148483, 0.10295483469963074, 0.1670103818178177, 0.06929833441972733, 0.049807313829660416, 0.09714333713054657, 0.055026426911354065, -0.23590205609798431, -0.03289901092648506, 0.08273593336343765, -0.07015003263950348, -0.04177507013082504, 0.05598895624279976],
[-0.08472533524036407, -0.07459762692451477, 0.02486378885805607, 0.04267622157931328, -0.10762648284435272, -0.018162181600928307, -0.017197387292981148, -0.008626183494925499, 0.1363646239042282, 0.02008953131735325, 0.2114802598953247, -0.009057514369487762, -0.22394396364688873, 0.015354037284851074, -0.07964403927326202, 0.07980112731456757, -0.09115736186504364, -0.09144072234630585, -0.10522830486297607, -0.06722363084554672, 0.014975335448980331, 0.1418062299489975, 0.0029802080243825912, 0.07494466006755829, -0.09335871040821075, -0.2960969805717468, -0.07542618364095688, -0.14996489882469177, 0.03338634967803955, -0.1633545607328415, -0.029880113899707794, 0.15029563009738922, -0.16898927092552185, -0.09774809330701828, 0.0788545161485672, 0.034175511449575424, -0.05005204305052757, -0.04270431026816368, 0.22953447699546814, 0.1380377858877182, -0.14177939295768738, 0.021587608382105827, -0.00894791167229414, 0.39631208777427673, 0.14080992341041565, 0.023825256153941154, 0.016406040638685226, -0.06129332631826401, 0.13194742798805237, -0.3377301096916199, 0.1386328637599945, 0.16220861673355103, 0.17769357562065125, 0.03535967692732811, 0.0856858417391777, -0.20303654670715332, 0.0032975226640701294, 0.16135014593601227, -0.21643751859664917, 0.2512819170951843, 0.05723767727613449, -0.06505630910396576, -0.022172819823026657, -0.0987735390663147, 0.1570340096950531, 0.07361240684986115, -0.09804873913526535, -0.1041354089975357, 0.15816734731197357, -0.10689423233270645, -0.03592795878648758, 0.156087726354599, -0.141366645693779, -0.27767252922058105, -0.24497196078300476, 0.06890939176082611, 0.4552178680896759, 0.12109412252902985, -0.22622929513454437, 0.023518376052379608, -0.048931121826171875, -0.03883190080523491, 0.040007587522268295, 0.08146515488624573, -0.05167054384946823, 0.002223951742053032, -0.08394366502761841, 0.045353055000305176, 0.1902400106191635, 0.03459157049655914, -0.06566184014081955, 0.25482630729675293, -0.012820836156606674, -0.012055132538080215, 0.09240768849849701, 0.05135868862271309, -0.03279019147157669, -0.05750930681824684, -0.12544241547584534, -0.01694473810493946, -0.010068877600133419, -0.13741612434387207, -0.01865634135901928, 0.03838706389069557, -0.16031154990196228, 0.18955636024475098, -0.022180922329425812, -0.027361523360013962, -0.04520798474550247, -0.08959363400936127, -0.09608935564756393, 0.08018374443054199, 0.22481490671634674, -0.31406888365745544, 0.2105807214975357, 0.11666230857372284, 0.10967878252267838, 0.1732422262430191, -0.041490040719509125, 0.025021061301231384, -0.024598080664873123, -0.061457376927137375, -0.20317186415195465, -0.06095671281218529, 0.058688051998615265, -0.04292350634932518, -0.008037589490413666, 0.04240957275032997]]
\ No newline at end of file
[[-0.12167462706565857, 0.1573014110326767, 0.04441952705383301, -0.06329992413520813, -0.13990068435668945, -0.015591192059218884, 0.012788704596459866, -0.008481698110699654, 0.1696063131093979, -0.014996049925684929, 0.12257716059684753, -0.03980429470539093, -0.29841849207878113, 0.03535076230764389, -0.15113383531570435, 0.11026836931705475, -0.2229827493429184, -0.10611432790756226, -0.05942731350660324, -0.16390231251716614, 0.046904243528842926, 0.14842212200164795, -0.025903970003128052, 0.04469270259141922, -0.12351308763027191, -0.25148382782936096, -0.005807774141430855, -0.1652514785528183, 0.05275378376245499, -0.15742221474647522, 0.08188007771968842, 0.11311312764883041, -0.09362713247537613, -0.04295402765274048, 0.008263520896434784, 0.03907023370265961, -0.009292371571063995, -0.05819075182080269, 0.21716953814029694, 0.0575837567448616, -0.13047903776168823, 0.006304113194346428, 0.06138543412089348, 0.4273340702056885, 0.13800019025802612, -0.0001382799819111824, 0.0032735206186771393, -0.04304564744234085, 0.14757899940013885, -0.20370358228683472, 0.018630407750606537, 0.19079533219337463, 0.040192872285842896, 0.05428604409098625, 0.12165690213441849, -0.17821815609931946, 0.013662583194673061, 0.11021769046783447, -0.20762072503566742, 0.08905413001775742, 0.12038201838731766, 0.010113406926393509, 0.0077995555475354195, -0.09915349632501602, 0.10829996317625046, -0.014124175533652306, -0.08572334796190262, -0.11928706616163254, 0.13431409001350403, -0.1893075704574585, -0.10338127613067627, 0.09048596024513245, -0.10543692857027054, -0.11666816473007202, -0.21868345141410828, 0.0248338021337986, 0.3980242908000946, 0.19333718717098236, -0.05901395529508591, 0.028305314481258392, -0.029147764667868614, -0.07272812724113464, 0.0961914211511612, 0.025258097797632217, -0.1411222219467163, 0.017706695944070816, -0.06849132478237152, 0.05856060981750488, 0.14139112830162048, 0.06593677401542664, -0.09715200215578079, 0.16674935817718506, 0.0324891097843647, -0.06945095956325531, 0.02925178036093712, 0.0032800473272800446, -0.1456555873155594, 0.029739035293459892, -0.14144563674926758, -0.004989258944988251, 0.025253115221858025, -0.1740659773349762, -0.005913650617003441, 0.08276288956403732, -0.16652812063694, 0.12548843026161194, 0.02236875519156456, -0.005242745392024517, -0.11953147500753403, 0.0622311532497406, -0.1847297102212906, 0.09291570633649826, 0.2522027790546417, -0.22897060215473175, 0.18871718645095825, 0.16927888989448547, 0.04851491004228592, 0.10886490345001221, 0.10575688630342484, -0.004544427618384361, -0.02665218710899353, -0.044908855110406876, -0.11539579927921295, -0.1501932591199875, 0.056034334003925323, -0.022210951894521713, 0.10771076381206512, 0.03321328014135361],
[0.026710156351327896, 0.15993016958236694, 0.051298901438713074, -0.027689505368471146, -0.12765391170978546, 0.02057567425072193, 0.011408006772398949, -0.18867585062980652, 0.16971813142299652, -0.005916532129049301, 0.15141794085502625, -0.19089892506599426, -0.273203045129776, 0.04969186335802078, -0.03790351748466492, 0.1444900929927826, -0.05998031422495842, -0.2574175000190735, -0.13791732490062714, -0.07319991290569305, 0.04399561882019043, -0.07099040597677231, 0.049827899783849716, 0.15421688556671143, -0.23268118500709534, -0.320607990026474, -0.0635177418589592, -0.06433478742837906, -0.015135949477553368, -0.13927613198757172, 0.018019521608948708, 0.10932328552007675, -0.19695666432380676, 0.004285890609025955, 0.06306490302085876, 0.05544339492917061, -0.03674605116248131, -0.20572978258132935, 0.20981091260910034, 0.0071816034615039825, -0.24177101254463196, -0.028906401246786118, 0.09331867843866348, 0.29296544194221497, 0.21729028224945068, -0.017189648002386093, 0.11124007403850555, -0.0544382706284523, 0.03655306622385979, -0.25462275743484497, 0.04961680993437767, 0.2129996418952942, 0.04493676871061325, 0.07651542872190475, 0.04555081948637962, -0.11880011111497879, -0.03169477358460426, 0.17005720734596252, -0.18072761595249176, 0.08804536610841751, 0.15383599698543549, -0.06883589923381805, -0.08853815495967865, -0.19247302412986755, 0.26905274391174316, 0.1888093203306198, -0.17963823676109314, -0.17243841290473938, 0.12784215807914734, -0.18660622835159302, -0.12157630920410156, 0.051542166620492935, -0.18182675540447235, -0.16536642611026764, -0.2853504717350006, -0.012397468090057373, 0.45266157388687134, 0.17653466761112213, -0.2122398316860199, 0.012532774358987808, -0.09284307807683945, 0.10068180412054062, -0.031197573989629745, 0.17022091150283813, 0.0000429004430770874, 0.019613215699791908, -0.07911663502454758, 0.052209511399269104, 0.2233724296092987, -0.03784641623497009, -0.07938466966152191, 0.236005499958992, -0.04834647849202156, -0.09712183475494385, -0.06872403621673584, 0.05285634100437164, -0.14739540219306946, 0.010996431112289429, -0.09157370030879974, -0.0498482920229435, -0.0364869050681591, 0.10078536719083786, 0.027532480657100677, 0.1480652093887329, -0.17821556329727173, 0.16438715159893036, -0.04734153300523758, 0.006744745187461376, -0.0089455246925354, 0.003287798725068569, -0.05073399096727371, -0.06098368018865585, 0.139216810464859, -0.35419943928718567, 0.06192156672477722, 0.15003375709056854, 0.0546683706343174, 0.03925054520368576, 0.01514084730297327, 0.10351229459047318, 0.12202562391757965, 0.034057874232530594, -0.1624462753534317, -0.06088358908891678, 0.025108247995376587, -0.026649266481399536, -0.010498914867639542, 0.031228138133883476],
[-0.08668005466461182, -0.03483007103204727, -0.0003673918545246124, 0.008645879104733467, -0.09362030774354935, -0.025139985606074333, -0.007545042783021927, -0.028350263833999634, 0.15249204635620117, 0.014242732897400856, 0.21090523898601532, 0.008390436880290508, -0.23901423811912537, 0.0009689182043075562, -0.060625866055488586, 0.07270534336566925, -0.10198824852705002, -0.08482334762811661, -0.07779358327388763, -0.10252971947193146, 0.05460023507475853, 0.11731529235839844, 0.02852252684533596, 0.09077048301696777, -0.12390488386154175, -0.2868882119655609, -0.1304321587085724, -0.16742777824401855, 0.014583868905901909, -0.1479465663433075, -0.014099230989813805, 0.15778455138206482, -0.13920526206493378, -0.08188515901565552, 0.06384599953889847, 0.031834639608860016, -0.030622778460383415, -0.025880059227347374, 0.18735939264297485, 0.14199277758598328, -0.10691522061824799, 0.004796179011464119, -0.011263035237789154, 0.42503073811531067, 0.1619957834482193, 0.029321935027837753, 0.035238925367593765, -0.049069225788116455, 0.11016182601451874, -0.30699604749679565, 0.13611817359924316, 0.15381795167922974, 0.15551342070102692, 0.026638466864824295, 0.10271516442298889, -0.15697214007377625, 0.011516798287630081, 0.13340604305267334, -0.18056459724903107, 0.2431061863899231, 0.09686680138111115, -0.09295038878917694, -0.04036598652601242, -0.11260301619768143, 0.15670207142829895, 0.07631193846464157, -0.11658167839050293, -0.07479780167341232, 0.1658235639333725, -0.10525454580783844, -0.07321809232234955, 0.11354232579469681, -0.18063338100910187, -0.24993789196014404, -0.26583242416381836, 0.07639464735984802, 0.5029336214065552, 0.1548779010772705, -0.21183547377586365, 0.003467526286840439, -0.06831696629524231, 0.0013287980109453201, 0.05430014058947563, 0.06840413808822632, -0.08649691939353943, -0.01732945814728737, -0.12664976716041565, 0.07448068261146545, 0.19064179062843323, 0.01050578523427248, -0.07535020262002945, 0.23970095813274384, -0.01862136647105217, 0.018674911931157112, 0.084925077855587, 0.06750399619340897, -0.05313561484217644, -0.061520203948020935, -0.14313256740570068, -0.014466727152466774, -0.011937311850488186, -0.1633354276418686, -0.03539048507809639, 0.0666762962937355, -0.14286108314990997, 0.17977604269981384, 0.0038571711629629135, -0.03993326798081398, -0.07229620218276978, -0.04254306107759476, -0.1374536007642746, 0.06556740403175354, 0.21137236058712006, -0.2630103528499603, 0.17165997624397278, 0.1454516053199768, 0.1140887439250946, 0.1566239446401596, -0.025141002610325813, 0.058362193405628204, -0.0580839179456234, -0.07689760625362396, -0.18478064239025116, -0.06852684915065765, 0.053309667855501175, -0.0068711647763848305, -0.009051743894815445, 0.03138190135359764],
[-0.10812772810459137, 0.0960509404540062, 0.05075833201408386, -0.006992556154727936, -0.02430100180208683, 0.06688249111175537, -0.0361909419298172, -0.05283684283494949, 0.20916198194026947, -0.12132113426923752, 0.2426092028617859, 0.002393195405602455, -0.2717067003250122, -0.009222805500030518, -0.09324157238006592, 0.0888652354478836, -0.09238552302122116, -0.06716188043355942, -0.07962961494922638, -0.015433302149176598, 0.10823999345302582, 0.07980607450008392, 0.05156152695417404, 0.004107831045985222, -0.09902802109718323, -0.4029299020767212, -0.14082002639770508, -0.07390984892845154, -0.018068937584757805, -0.03710474818944931, 0.018614336848258972, -0.016432739794254303, -0.19106215238571167, -0.0028982944786548615, 0.015964776277542114, 0.06579974293708801, -0.07434473931789398, 0.018355894833803177, 0.14858579635620117, 0.012171495705842972, -0.1377386599779129, 0.026052771136164665, 0.03385549783706665, 0.2836731970310211, 0.10040508210659027, 0.04004503786563873, -0.001651376485824585, -0.10324104875326157, 0.03719945624470711, -0.2629179060459137, 0.16452158987522125, 0.14986106753349304, 0.13023321330547333, 0.09661436080932617, 0.18918710947036743, -0.10880888998508453, -0.031791239976882935, 0.15386438369750977, -0.14458853006362915, 0.11291952431201935, 0.06003924086689949, 0.06476171314716339, -0.009830544702708721, -0.10745155066251755, 0.1405407190322876, 0.1305859088897705, -0.16277149319648743, -0.18458272516727448, 0.05099692940711975, -0.19503474235534668, 0.010700453072786331, 0.11001631617546082, -0.08623851835727692, -0.2591833472251892, -0.26403212547302246, 0.12243489921092987, 0.4310947358608246, 0.20690849423408508, -0.15607987344264984, -0.026859350502490997, -0.052227526903152466, -0.0684361532330513, 0.06496615707874298, -0.0058087073266506195, -0.08738603442907333, 0.026622235774993896, -0.08068346232175827, 0.05664081126451492, 0.16467420756816864, -0.0009840866550803185, -0.07553625106811523, 0.25617775321006775, -0.05051515996456146, 0.009972795844078064, 0.007534991949796677, 0.03971076011657715, -0.11119121313095093, -0.011049863882362843, -0.1832604557275772, 0.021426139399409294, -0.076441191136837, -0.09806857258081436, -0.05703507363796234, 0.019011031836271286, -0.12956354022026062, 0.13923075795173645, -0.021157534793019295, -0.06298907101154327, -0.03315307945013046, 0.06146591901779175, -0.2764729857444763, -0.0066480981186032295, 0.1774473339319229, -0.2960206866264343, 0.2048717439174652, 0.0974058285355568, 0.08322597295045853, 0.16235607862472534, 0.11903765797615051, 0.07892667502164841, 0.012258721515536308, -0.022171374410390854, -0.1235252171754837, -0.08490340411663055, 0.04904255270957947, -0.021960634738206863, 0.03359823301434517, -0.02790735848248005],
[-0.0861644521355629, 0.0407138466835022, 0.016660915687680244, -0.11184008419513702, -0.17109225690364838, -0.008054183796048164, 0.0043458398431539536, -0.04717544466257095, 0.2360997051000595, -0.1792946606874466, 0.09372667968273163, -0.10778637230396271, -0.18022964894771576, 0.1057591438293457, -0.14819777011871338, 0.18456174433231354, -0.10886520892381668, -0.22280070185661316, -0.18811620771884918, -0.17934660613536835, -0.005707431584596634, 0.17547455430030823, -0.07589425891637802, 0.08822266757488251, -0.22329366207122803, -0.2647639811038971, 0.0006838683038949966, -0.12440066039562225, 0.014281416311860085, -0.1364075094461441, 0.009437749162316322, 0.17108798027038574, -0.0995604544878006, 0.059015583246946335, 0.08069150149822235, 0.06387726962566376, -0.03294640779495239, -0.10197870433330536, 0.1799873262643814, 0.08741294592618942, -0.2174263745546341, -0.04494243860244751, 0.06684452295303345, 0.34167376160621643, 0.23325026035308838, -0.04154399782419205, 0.011788692325353622, -0.11752628535032272, 0.20273643732070923, -0.29470184445381165, 0.028117917478084564, 0.12952283024787903, 0.011183657683432102, 0.1467585265636444, 0.09572306275367737, -0.19623562693595886, -0.006620150525122881, 0.1656893491744995, -0.15442757308483124, 0.101564422249794, 0.07097303867340088, -0.13614526391029358, -0.09262663125991821, -0.12386314570903778, 0.2525855004787445, 0.08339422941207886, -0.16481442749500275, -0.1946205347776413, 0.22902803122997284, -0.190300852060318, -0.07371577620506287, 0.06296952813863754, -0.11559777706861496, -0.11654040217399597, -0.19363869726657867, 0.05155988410115242, 0.34051868319511414, 0.14739015698432922, -0.10211460292339325, 0.07169584929943085, -0.01736035943031311, 0.032930076122283936, -0.012714214622974396, 0.15314114093780518, -0.06861979514360428, -0.07193847000598907, -0.004278216511011124, 0.04735196381807327, 0.22340130805969238, -0.034403908997774124, -0.014668408781290054, 0.22658497095108032, -0.06898515671491623, -0.06174619868397713, -0.041788697242736816, 0.04460466653108597, -0.24244919419288635, 0.057573556900024414, -0.008640434592962265, 0.012258822098374367, 0.08495114743709564, -0.02127320133149624, 0.03654727339744568, 0.14537471532821655, -0.11938325315713882, 0.2437717467546463, -0.13897383213043213, 0.04482175409793854, -0.0048943255096673965, -0.04026113823056221, -0.02975938469171524, -0.0013266131281852722, 0.1767640858888626, -0.20145171880722046, 0.18534420430660248, 0.0919744148850441, 0.11030878126621246, 0.1636233627796173, 0.05860510841012001, 0.04500507190823555, 0.07213535904884338, 0.0592627227306366, -0.23625873029232025, -0.031807538121938705, 0.08182771503925323, -0.08432832360267639, -0.06450914591550827, 0.0522795170545578],
[-0.1205408126115799, 0.05365414917469025, 0.11673855781555176, 0.0674002468585968, -0.2250651717185974, 0.009286951273679733, -0.03329429030418396, -0.0772957131266594, 0.13294319808483124, -0.07603689283132553, 0.13200519979000092, -0.07264070957899094, -0.2603042423725128, 0.13752751052379608, -0.03672562539577484, 0.19355109333992004, -0.06353013217449188, -0.09449752420186996, -0.13549655675888062, -0.07581540942192078, 0.022267043590545654, 0.03609134256839752, 0.046052027493715286, 0.12285836040973663, -0.17200231552124023, -0.32074880599975586, -0.031141264364123344, -0.05714007467031479, 0.036559414118528366, -0.005135348066687584, -0.07657670974731445, 0.09152858704328537, -0.1677236557006836, -0.02720966935157776, 0.039436280727386475, 0.023101013153791428, -0.006022093817591667, -0.020834414288401604, 0.21509629487991333, 0.007696652784943581, -0.29771655797958374, 0.012345774099230766, 0.09222178161144257, 0.19552744925022125, 0.17507854104042053, 0.08492477238178253, 0.10386379063129425, -0.08650008589029312, 0.09163841605186462, -0.35064804553985596, 0.011814825236797333, 0.15323927998542786, 0.038098711520433426, 0.012076972052454948, 0.05250523239374161, -0.22108733654022217, -0.05843188613653183, 0.11331582814455032, -0.15032993257045746, 0.12622590363025665, 0.10020335763692856, 0.03399747610092163, -0.05323035269975662, -0.09618151187896729, 0.19968774914741516, 0.13584056496620178, -0.12660281360149384, -0.14359796047210693, 0.15991385281085968, -0.21421459317207336, -0.006963425315916538, 0.16878095269203186, -0.11460451036691666, -0.23956090211868286, -0.27385738492012024, 0.019329074770212173, 0.5151724219322205, 0.15237875282764435, -0.17116820812225342, -0.054046861827373505, -0.03608296066522598, 0.01658475771546364, 0.05548166111111641, 0.060410335659980774, -0.05113377422094345, -0.04840084910392761, -0.0635150596499443, 0.0436171293258667, 0.24931558966636658, -0.035200394690036774, 0.03071688301861286, 0.26128140091896057, 0.11349756270647049, -0.017748894169926643, -0.03869530186057091, 0.18593837320804596, -0.14041811227798462, -0.04605704918503761, -0.16739949584007263, -0.0076591856777668, 0.01983969286084175, 0.0296650193631649, 0.06249948590993881, 0.07530646026134491, -0.19937050342559814, 0.1863221675157547, -0.1099039688706398, -0.06129539757966995, -0.05316010117530823, 0.06181564927101135, -0.13108719885349274, 0.006346769630908966, 0.18396040797233582, -0.19444288313388824, 0.09514211863279343, 0.1821029782295227, -0.029052872210741043, 0.08303431421518326, 0.044375088065862656, 0.07726173102855682, 0.03303125873208046, 0.026226479560136795, -0.12336263060569763, -0.12966996431350708, 0.08518747240304947, -0.17891094088554382, -0.004896830767393112, 0.01702316664159298]]
\ No newline at end of file
[[{"x": 54.4841331243515, "y": 279.8494456708431}, {"x": 52.762970216572285, "y": 295.0540763139725}, {"x": 51.44473014399409, "y": 308.63857716321945}, {"x": 52.77811277657747, "y": 322.50638687610626}, {"x": 56.076875776052475, "y": 335.40019261837006}, {"x": 62.24221035838127, "y": 348.28095012903214}, {"x": 71.04102492332458, "y": 360.55759835243225}, {"x": 81.31345927715302, "y": 370.8286249637604}, {"x": 93.04248213768005, "y": 375.1568164229393}, {"x": 104.32137668132782, "y": 374.03898203372955}, {"x": 114.66587007045746, "y": 366.7231530547142}, {"x": 124.12134230136871, "y": 359.58974558115005}, {"x": 134.0518993139267, "y": 351.187184214592}, {"x": 141.96835577487946, "y": 340.5877373814583}, {"x": 148.3436268568039, "y": 330.19438648223877}, {"x": 152.50264823436737, "y": 318.137512922287}, {"x": 156.57829463481903, "y": 306.21622332930565}, {"x": 65.60247659683228, "y": 287.6319411545992}, {"x": 73.90902906656265, "y": 286.56817772984505}, {"x": 83.04267644882202, "y": 288.6181264221668}, {"x": 92.16026186943054, "y": 292.26203539967537}, {"x": 100.0861269235611, "y": 297.7609884738922}, {"x": 119.06923472881317, "y": 301.443696141243}, {"x": 128.6662083864212, "y": 299.58680284023285}, {"x": 137.31286346912384, "y": 299.6509060263634}, {"x": 145.62582194805145, "y": 300.87507927417755}, {"x": 151.1600774526596, "y": 304.18568167090416}, {"x": 109.00326192378998, "y": 309.371550232172}, {"x": 106.5176647901535, "y": 319.28606486320496}, {"x": 105.35275757312775, "y": 328.463223695755}, {"x": 103.40745270252228, "y": 338.57382702827454}, {"x": 89.8807567358017, "y": 336.06577545404434}, {"x": 95.45948922634125, "y": 339.7772246003151}, {"x": 100.78338205814362, "y": 343.8431135416031}, {"x": 107.51278221607208, "y": 342.2273164987564}, {"x": 112.08169281482697, "y": 340.5178443789482}, {"x": 74.90537881851196, "y": 300.0762922167778}, {"x": 80.60373783111572, "y": 300.8516201376915}, {"x": 86.9048935174942, "y": 302.5063696503639}, {"x": 92.43779003620148, "y": 305.77344846725464}, {"x": 85.71294963359833, "y": 305.35038819909096}, {"x": 78.96711945533752, "y": 304.2834280729294}, {"x": 120.14831721782684, "y": 311.1841279864311}, {"x": 127.07818567752838, "y": 311.38264256715775}, {"x": 132.99132406711578, "y": 312.0929676890373}, {"x": 138.38761270046234, "y": 313.43911921977997}, {"x": 132.19313442707062, "y": 315.49242800474167}, {"x": 125.66980540752411, "y": 314.0371503531933}, {"x": 75.24729639291763, "y": 340.96445989608765}, {"x": 85.09969830513, "y": 344.38711792230606}, {"x": 93.9101380109787, "y": 347.62620878219604}, {"x": 97.92843282222748, "y": 349.9168846607208}, {"x": 104.11339223384857, "y": 348.53212666511536}, {"x": 111.40903055667877, "y": 348.52134668827057}, {"x": 118.41414988040924, "y": 347.4458556175232}, {"x": 110.3457373380661, "y": 356.35120064020157}, {"x": 101.84181749820709, "y": 359.49979197978973}, {"x": 95.72099566459656, "y": 359.8314492702484}, {"x": 89.90900933742523, "y": 357.86295783519745}, {"x": 82.39305138587952, "y": 352.26175260543823}, {"x": 78.12815725803375, "y": 342.695430457592}, {"x": 92.45323956012726, "y": 349.17965573072433}, {"x": 98.11183631420135, "y": 351.18774551153183}, {"x": 103.44208896160126, "y": 351.51249808073044}, {"x": 115.9059625864029, "y": 348.7764061689377}, {"x": 102.82863199710846, "y": 353.25923877954483}, {"x": 96.64927542209625, "y": 353.5822151899338}, {"x": 92.54582345485687, "y": 351.4128255844116}],
[{"x": 252.2517795562744, "y": 275.9289174377918}, {"x": 254.25690640509129, "y": 287.53185617923737}, {"x": 256.414415076375, "y": 297.4512948989868}, {"x": 259.92505625262856, "y": 307.5814243555069}, {"x": 264.258636072278, "y": 316.37451285123825}, {"x": 269.8492708206177, "y": 324.35249626636505}, {"x": 278.0556249022484, "y": 331.55529230833054}, {"x": 287.1583237051964, "y": 336.27545660734177}, {"x": 296.8990079164505, "y": 337.73418939113617}, {"x": 307.03963631391525, "y": 337.4403018951416}, {"x": 316.4400250315666, "y": 332.53693038225174}, {"x": 324.1076574921608, "y": 327.09237545728683}, {"x": 331.0278232693672, "y": 319.25563126802444}, {"x": 336.4769398570061, "y": 309.700075507164}, {"x": 340.1471373438835, "y": 300.1988312602043}, {"x": 342.4503394961357, "y": 290.12727427482605}, {"x": 345.31944888830185, "y": 280.28039038181305}, {"x": 256.71826735138893, "y": 265.7339949309826}, {"x": 262.03788154013455, "y": 259.11585661768913}, {"x": 270.9166807234287, "y": 257.50668972730637}, {"x": 280.2627809047699, "y": 258.66556200385094}, {"x": 289.1088626384735, "y": 261.9270911514759}, {"x": 301.11069256067276, "y": 262.1025609970093}, {"x": 311.6360414624214, "y": 259.07854360342026}, {"x": 321.5185950398445, "y": 259.56887099146843}, {"x": 330.6103066802025, "y": 262.17411509156227}, {"x": 335.8322302699089, "y": 269.03523257374763}, {"x": 295.83379566669464, "y": 271.5867927968502}, {"x": 295.19629764556885, "y": 281.26413801312447}, {"x": 294.8906948566437, "y": 290.08939987421036}, {"x": 294.68082946538925, "y": 299.63570845127106}, {"x": 283.9866814017296, "y": 300.46018624305725}, {"x": 289.1035366654396, "y": 303.70147758722305}, {"x": 294.6041773557663, "y": 306.9468694925308}, {"x": 300.2074119448662, "y": 304.7393867969513}, {"x": 305.01778668165207, "y": 303.0569154024124}, {"x": 267.1455246210098, "y": 273.36186504364014}, {"x": 271.29351702332497, "y": 269.5836756527424}, {"x": 276.98266848921776, "y": 269.2756244838238}, {"x": 282.18263429403305, "y": 273.6405881345272}, {"x": 276.73509895801544, "y": 274.3932607769966}, {"x": 271.15120989084244, "y": 274.9724545776844}, {"x": 306.2907273173332, "y": 273.96472772955894}, {"x": 312.3908343911171, "y": 270.7982785999775}, {"x": 317.99342280626297, "y": 271.1382451057434}, {"x": 322.57845264673233, "y": 275.3475582897663}, {"x": 318.4561406970024, "y": 277.04529172182083}, {"x": 311.7086290717125, "y": 276.4759971499443}, {"x": 278.4617110490799, "y": 313.9066096544266}, {"x": 284.0348202586174, "y": 313.8949286341667}, {"x": 289.79565292596817, "y": 314.03017741441727}, {"x": 294.1672314405441, "y": 315.7231233716011}, {"x": 299.386224091053, "y": 313.8113762140274}, {"x": 305.8218873143196, "y": 314.7099709510803}, {"x": 312.32251197099686, "y": 316.4275133013725}, {"x": 306.2943838238716, "y": 320.4392428994179}, {"x": 299.8657733798027, "y": 320.83152294158936}, {"x": 294.2846277952194, "y": 321.36408680677414}, {"x": 289.42114770412445, "y": 320.2233706712723}, {"x": 283.6190547347069, "y": 318.2715523838997}, {"x": 280.26574271917343, "y": 314.58500146865845}, {"x": 289.5005741715431, "y": 316.2997612953186}, {"x": 294.63025587797165, "y": 317.5675250887871}, {"x": 299.24741357564926, "y": 317.34421187639236}, {"x": 310.01027661561966, "y": 316.67098063230515}, {"x": 299.4706104397774, "y": 315.8766991496086}, {"x": 293.81820046901703, "y": 316.3997856974602}, {"x": 289.89974427223206, "y": 315.2797955274582}],
[{"x": 459.09935719519854, "y": 218.13032889366147}, {"x": 460.54768696054816, "y": 230.47838592529294}, {"x": 462.1836343817413, "y": 241.2056384682655}, {"x": 465.3896450996399, "y": 252.3832450509071}, {"x": 469.65624682605267, "y": 262.5285752415657}, {"x": 475.84583942592144, "y": 271.76317942142487}, {"x": 485.1275852024555, "y": 279.5509850382805}, {"x": 495.1621728539467, "y": 284.797351539135}, {"x": 505.5629862546921, "y": 286.8822603225708}, {"x": 517.4467390179634, "y": 285.96916061639786}, {"x": 529.4473886489868, "y": 281.45866310596466}, {"x": 538.869506418705, "y": 275.2687605023384}, {"x": 546.4981092214584, "y": 266.4664577841759}, {"x": 551.2324748039246, "y": 255.01710993051526}, {"x": 554.7127612829208, "y": 243.48108315467832}, {"x": 555.3402676582336, "y": 230.76776593923566}, {"x": 556.7988897562027, "y": 218.4927234649658}, {"x": 465.4299607281573, "y": 212.9801985621452}, {"x": 471.11858792975545, "y": 209.44992011785504}, {"x": 479.1034842133522, "y": 208.53261959552762}, {"x": 487.1113453656435, "y": 209.60203573107717}, {"x": 494.11751186847687, "y": 212.7387219071388}, {"x": 509.9350489974022, "y": 213.1643395423889}, {"x": 519.1484966278076, "y": 209.53720027208325}, {"x": 527.979111790657, "y": 209.10110011696813}, {"x": 536.5856410264969, "y": 209.8031400442123}, {"x": 543.1041161417961, "y": 212.92910945415494}, {"x": 503.02139446139336, "y": 221.04303660988805}, {"x": 501.8637197315693, "y": 229.62805640697476}, {"x": 501.6442012488842, "y": 237.6451110243797}, {"x": 500.7066152691841, "y": 246.5652552247047}, {"x": 493.0849750339985, "y": 248.23481416702268}, {"x": 497.4453990161419, "y": 250.85656070709226}, {"x": 501.78884494304657, "y": 253.37974423170087}, {"x": 506.8887307345867, "y": 251.58306765556333}, {"x": 511.9318815469742, "y": 249.9717735648155}, {"x": 474.91831866651773, "y": 223.4097787737846}, {"x": 478.91311833262444, "y": 221.78881421685216}, {"x": 485.4242661744356, "y": 221.74642735719678}, {"x": 490.9208631515503, "y": 224.01877999305722}, {"x": 485.0950839370489, "y": 225.26164376735684}, {"x": 479.2658910751343, "y": 225.63468092679975}, {"x": 515.9201887845993, "y": 223.75643199682233}, {"x": 521.5161144137383, "y": 222.7518747448921}, {"x": 527.4093854427338, "y": 222.81509780883786}, {"x": 533.0874189734459, "y": 224.11863917112348}, {"x": 528.3067688941956, "y": 226.18071675300595}, {"x": 521.1155691742897, "y": 226.13475763797757}, {"x": 488.6783328652382, "y": 261.41800594329834}, {"x": 493.67272448539734, "y": 260.5540979504585}, {"x": 499.263761729002, "y": 259.745807826519}, {"x": 503.3115651011467, "y": 261.4932536482811}, {"x": 507.9067933857441, "y": 259.28411626815796}, {"x": 515.3690929412842, "y": 260.15914314985275}, {"x": 522.2341315150261, "y": 262.72098511457443}, {"x": 515.8608915805817, "y": 267.2595453262329}, {"x": 509.24180537462234, "y": 268.3049160838127}, {"x": 503.9985676109791, "y": 268.8232405781746}, {"x": 499.3739930987358, "y": 267.47048407793045}, {"x": 493.8684720993042, "y": 265.5463541150093}, {"x": 491.0431921482086, "y": 261.91566210985184}, {"x": 499.28222247958183, "y": 262.4607531428337}, {"x": 504.12661519646645, "y": 263.96868216991425}, {"x": 508.22424668073654, "y": 263.86631655693054}, {"x": 519.7851538062096, "y": 262.86537450551987}, {"x": 508.41710847616196, "y": 263.2046567797661}, {"x": 503.3691011071205, "y": 263.3891100883484}, {"x": 500.2570376396179, "y": 262.4323624968529}],
[{"x": 234.3194352723658, "y": 74.57558505237103}, {"x": 234.25971424020827, "y": 87.65778727829456}, {"x": 234.4752733167261, "y": 99.06290532648563}, {"x": 237.1816885098815, "y": 110.96489562094212}, {"x": 241.94283635169268, "y": 121.28872080147266}, {"x": 248.6071757376194, "y": 131.3841907531023}, {"x": 256.9602437019348, "y": 141.17377139627934}, {"x": 266.1121906042099, "y": 148.39108677208424}, {"x": 276.5760519504547, "y": 150.81767751276493}, {"x": 286.06898361444473, "y": 148.72532434761524}, {"x": 294.6526671051979, "y": 141.04826493561268}, {"x": 301.33340084552765, "y": 133.15681870281696}, {"x": 308.6333589553833, "y": 123.89443911612034}, {"x": 314.2338796854019, "y": 113.46245117485523}, {"x": 317.77701437473297, "y": 103.2364257723093}, {"x": 319.5086579322815, "y": 92.14938713610172}, {"x": 320.94791293144226, "y": 81.37062980234623}, {"x": 243.06732543557882, "y": 74.08600734174252}, {"x": 248.8067600429058, "y": 70.98361553251743}, {"x": 256.3999947309494, "y": 70.81113044917583}, {"x": 264.76877000927925, "y": 72.02850545942783}, {"x": 272.0709395110607, "y": 75.7467415779829}, {"x": 287.7707560658455, "y": 76.91189719736576}, {"x": 296.2243087887764, "y": 73.96356584131718}, {"x": 304.44421088695526, "y": 73.51134298741817}, {"x": 311.53458148241043, "y": 75.23528026044369}, {"x": 316.1166696548462, "y": 78.9747758358717}, {"x": 280.17183458805084, "y": 84.96656738221645}, {"x": 279.3937808275223, "y": 94.36238606274128}, {"x": 279.35660767555237, "y": 103.06436260044575}, {"x": 278.7231848835945, "y": 112.29577179253101}, {"x": 266.31418666243553, "y": 112.0883796364069}, {"x": 272.27140441536903, "y": 115.1364913135767}, {"x": 277.6347743868828, "y": 117.94008959829807}, {"x": 283.3616907596588, "y": 115.64554668962955}, {"x": 287.8933918476105, "y": 113.81301428377628}, {"x": 251.0667580664158, "y": 82.9913242906332}, {"x": 255.89165657758713, "y": 81.49192760884762}, {"x": 261.7473086118698, "y": 81.9099268168211}, {"x": 267.2386226952076, "y": 85.10501013696194}, {"x": 261.30779322981834, "y": 85.19847224652767}, {"x": 255.44378045201302, "y": 85.36310140788555}, {"x": 289.71536606550217, "y": 86.42285586893559}, {"x": 296.3602277636528, "y": 84.84875993430614}, {"x": 301.8530383706093, "y": 84.7902014106512}, {"x": 306.5372512936592, "y": 86.6484913378954}, {"x": 301.7564742565155, "y": 88.82455034554005}, {"x": 295.51999282836914, "y": 88.34888525307178}, {"x": 254.46332001686096, "y": 119.8893206268549}, {"x": 262.4870464205742, "y": 120.17709912359715}, {"x": 270.87596663832664, "y": 121.66138370335102}, {"x": 275.98605555295944, "y": 123.45295931398869}, {"x": 282.2421624660492, "y": 121.90349115431309}, {"x": 290.1554627418518, "y": 121.4969637542963}, {"x": 297.10897439718246, "y": 122.38941462337971}, {"x": 290.4657106399536, "y": 131.62555201351643}, {"x": 281.68320965766907, "y": 135.24335576593876}, {"x": 275.27662420272827, "y": 136.08381040394306}, {"x": 269.31407338380814, "y": 134.49461282789707}, {"x": 261.1233943104744, "y": 129.75777430832386}, {"x": 256.483723372221, "y": 121.03552509844303}, {"x": 269.97673404216766, "y": 123.28837896883488}, {"x": 276.3295534849167, "y": 124.6335234194994}, {"x": 282.1039479970932, "y": 124.4526105672121}, {"x": 295.37730115652084, "y": 123.08822555840015}, {"x": 281.56651544570923, "y": 130.71057595312595}, {"x": 275.4741504788399, "y": 131.3456677943468}, {"x": 270.4244840145111, "y": 129.8541026264429}],
[{"x": 576.1535308398306, "y": 97.49992448091507}, {"x": 576.7155177183449, "y": 110.38267150521278}, {"x": 577.5447585117072, "y": 121.69842475652695}, {"x": 580.0351948738098, "y": 133.4102616906166}, {"x": 584.0166524648666, "y": 143.69573944807053}, {"x": 590.4294921457767, "y": 153.09628623723984}, {"x": 599.9136656522751, "y": 161.59112352132797}, {"x": 610.0823851823807, "y": 167.7023411989212}, {"x": 620.7162899971008, "y": 169.81312930583954}, {"x": 630.8302686214447, "y": 168.10430830717087}, {"x": 639.7988377809525, "y": 161.90262937545776}, {"x": 647.1597594022751, "y": 155.3944255709648}, {"x": 653.6100611686707, "y": 147.24894577264786}, {"x": 657.8869388103485, "y": 137.40559548139572}, {"x": 660.9833337068558, "y": 128.15908282995224}, {"x": 662.643195271492, "y": 118.08342492580414}, {"x": 664.5361260175705, "y": 108.1498429775238}, {"x": 586.8617853820324, "y": 97.57175967097282}, {"x": 594.0036285221577, "y": 95.91249337792397}, {"x": 602.0432872772217, "y": 96.55522811412811}, {"x": 610.2376074194908, "y": 98.67479193210602}, {"x": 617.003839969635, "y": 102.86477941274643}, {"x": 633.1619135141373, "y": 103.65319031476974}, {"x": 640.9453811645508, "y": 100.97537392377853}, {"x": 648.2738443613052, "y": 100.39352387189865}, {"x": 655.0860079526901, "y": 101.07310575246811}, {"x": 660.0833687782288, "y": 103.48732554912567}, {"x": 625.6144524812698, "y": 109.68697956204414}, {"x": 624.7979527711868, "y": 118.26480025053024}, {"x": 624.7070682048798, "y": 126.18410778045654}, {"x": 624.2883296012878, "y": 134.75663179159164}, {"x": 613.2230737805367, "y": 135.47273236513138}, {"x": 618.1410920619965, "y": 137.91179966926575}, {"x": 622.635379076004, "y": 140.55282950401306}, {"x": 627.3352084159851, "y": 139.2602106332779}, {"x": 630.9798530340195, "y": 137.74868369102478}, {"x": 595.8744234144688, "y": 108.09254574775696}, {"x": 600.7668833136559, "y": 106.68771129846573}, {"x": 606.626432955265, "y": 107.28530788421631}, {"x": 611.143786907196, "y": 110.6366218328476}, {"x": 605.9760230183601, "y": 111.01029747724533}, {"x": 600.2359576225281, "y": 110.95684599876404}, {"x": 635.414272069931, "y": 112.45622023940086}, {"x": 641.2012264728546, "y": 110.93172106146812}, {"x": 646.3275607824326, "y": 110.93707194924355}, {"x": 650.84887611866, "y": 113.17889940738678}, {"x": 646.4744521379471, "y": 115.17933741211891}, {"x": 640.3822878599167, "y": 114.80342638492584}, {"x": 602.286383330822, "y": 142.86055451631546}, {"x": 610.3222481012344, "y": 144.2252094745636}, {"x": 617.2720557451248, "y": 145.19179409742355}, {"x": 621.1298673152924, "y": 146.59095239639282}, {"x": 626.0349799394608, "y": 145.22645050287247}, {"x": 631.8482588529587, "y": 145.41272389888763}, {"x": 637.8517721891403, "y": 145.64175975322723}, {"x": 631.8961962461472, "y": 151.41622865200043}, {"x": 625.3036365509033, "y": 153.1305536031723}, {"x": 620.4127076864243, "y": 153.72984665632248}, {"x": 615.9534670710564, "y": 152.43784004449844}, {"x": 609.1786397099495, "y": 149.49363362789154}, {"x": 604.3942674398422, "y": 143.80317175388336}, {"x": 616.5883467197418, "y": 146.54858535528183}, {"x": 621.544314622879, "y": 147.8731118440628}, {"x": 625.545786857605, "y": 148.11420154571533}, {"x": 636.0422431230545, "y": 146.50075900554657}, {"x": 625.2157969474792, "y": 148.7349683046341}, {"x": 620.6214025020599, "y": 148.93819361925125}, {"x": 617.2931456565857, "y": 147.784716963768}],
[{"x": 78.23273684829473, "y": 51.60377091169357}, {"x": 76.88033521175385, "y": 66.98003154993057}, {"x": 75.81947349011898, "y": 80.6108932197094}, {"x": 77.60156836360693, "y": 94.52300694584846}, {"x": 82.98783158883452, "y": 106.64588287472725}, {"x": 91.29216834902763, "y": 117.48094370961189}, {"x": 102.34191060066223, "y": 127.35485658049583}, {"x": 114.33153130114079, "y": 134.41015151143074}, {"x": 126.54285334050655, "y": 137.1719016134739}, {"x": 137.02404104173183, "y": 134.17398390173912}, {"x": 144.87608276307583, "y": 125.8565858900547}, {"x": 150.99320016801357, "y": 117.1223518550396}, {"x": 156.92030988633633, "y": 108.0576830804348}, {"x": 161.7889528721571, "y": 96.96261104941368}, {"x": 165.50497464835644, "y": 88.02793249487877}, {"x": 167.33607403934002, "y": 77.9478391110897}, {"x": 168.52052859961987, "y": 68.2689423263073}, {"x": 101.93711385130882, "y": 49.88659825921059}, {"x": 110.3638557344675, "y": 48.155562341213226}, {"x": 119.74964939057827, "y": 47.33247035741806}, {"x": 129.26901035010815, "y": 49.19584932923317}, {"x": 136.74703143537045, "y": 53.64960214495659}, {"x": 150.53537838160992, "y": 56.168887346982956}, {"x": 156.60274527966976, "y": 53.865505397319794}, {"x": 162.9648243635893, "y": 53.695709228515625}, {"x": 167.64181904494762, "y": 55.2644918859005}, {"x": 170.2478265017271, "y": 57.97207298874855}, {"x": 143.26418243348598, "y": 65.35158225893974}, {"x": 142.97341756522655, "y": 73.4936634004116}, {"x": 143.46804820001125, "y": 80.94419595599174}, {"x": 143.31419222056866, "y": 89.40759268403053}, {"x": 127.23943196237087, "y": 91.14958158135414}, {"x": 133.96387301385403, "y": 93.79053750634193}, {"x": 139.21318851411343, "y": 96.51258161664009}, {"x": 144.33787517249584, "y": 94.92185071110725}, {"x": 148.012380823493, "y": 93.06354263424873}, {"x": 110.23061253130436, "y": 61.62617373466492}, {"x": 116.00698433816433, "y": 61.24231967329979}, {"x": 121.71143271028996, "y": 62.20304474234581}, {"x": 126.237358674407, "y": 64.05169928073883}, {"x": 120.87435774505138, "y": 64.04682829976082}, {"x": 115.38067065179348, "y": 63.669275373220444}, {"x": 150.21302603185177, "y": 66.67289063334465}, {"x": 155.51250331103802, "y": 66.83099183440208}, {"x": 159.8145430535078, "y": 67.2261371910572}, {"x": 163.32536689937115, "y": 68.20647689700127}, {"x": 159.1250678151846, "y": 69.86667791008949}, {"x": 154.3889170140028, "y": 68.73301187157631}, {"x": 109.60967443883419, "y": 99.71434238553047}, {"x": 120.61101846396923, "y": 99.09809216856956}, {"x": 130.8056702464819, "y": 100.23262706398964}, {"x": 135.622381195426, "y": 101.86354067921638}, {"x": 141.09942518174648, "y": 100.71261283755302}, {"x": 145.90711049735546, "y": 101.11367872357368}, {"x": 148.4175955504179, "y": 103.14160612225533}, {"x": 144.75522689521313, "y": 111.54441353678703}, {"x": 138.66864643990993, "y": 115.6854547560215}, {"x": 132.96517930924892, "y": 116.56978961825371}, {"x": 126.65391467511654, "y": 115.17637380957603}, {"x": 117.94208191335201, "y": 110.3444068133831}, {"x": 112.67831824719906, "y": 100.54041001200676}, {"x": 129.04413394629955, "y": 102.71197560429573}, {"x": 135.24945132434368, "y": 104.3828412592411}, {"x": 140.17994605004787, "y": 104.53136196732521}, {"x": 147.12589286267757, "y": 103.85854378342628}, {"x": 139.35607872903347, "y": 109.56546506285667}, {"x": 133.77587251365185, "y": 110.46680799126625}, {"x": 128.98411504924297, "y": 109.03905311226845}]]
\ No newline at end of file
import * as faceapi from '../../../src';
import { describeWithNets, expectAllTensorsReleased, expectRectClose, expectPointClose } from '../../utils';
import { expectedSsdBoxes } from './expectedResults';
import { NetInput } from '../../../src/NetInput';
import { toNetInput } from '../../../src';
import * as tf from '@tensorflow/tfjs-core';
import { Point } from '../../../src/Point';
describe('allFaces', () => {
let imgEl: HTMLImageElement
let facesFaceLandmarkPositions: Point[][]
let facesFaceDescriptors: number[][]
beforeAll(async () => {
const img = await (await fetch('base/test/images/faces.jpg')).blob()
imgEl = await faceapi.bufferToImage(img)
facesFaceLandmarkPositions = await (await fetch('base/test/data/facesFaceLandmarkPositions.json')).json()
facesFaceDescriptors = await (await fetch('base/test/data/facesFaceDescriptorsSsd.json')).json()
})
describeWithNets('computes full face descriptions', { withAllFaces: true }, ({ allFaces }) => {
const expectedScores = [0.97, 0.88, 0.83, 0.82, 0.59, 0.52]
const maxBoxDelta = 5
const maxLandmarkPointsDelta = 1
it('scores > 0.8', async () => {
const results = await allFaces(imgEl, 0.8)
expect(results.length).toEqual(4)
results.forEach(({ detection, landmarks, descriptor }, i) => {
expect(detection.getImageWidth()).toEqual(imgEl.width)
expect(detection.getImageHeight()).toEqual(imgEl.height)
expect(detection.getScore()).toBeCloseTo(expectedScores[i], 2)
expectRectClose(detection.getBox(), expectedSsdBoxes[i], maxBoxDelta)
landmarks.getPositions().forEach((pt, j) => expectPointClose(pt, facesFaceLandmarkPositions[i][j], maxLandmarkPointsDelta))
expect(descriptor).toEqual(new Float32Array(facesFaceDescriptors[i]))
})
})
it('scores > 0.5', async () => {
const results = await allFaces(imgEl, 0.5)
expect(results.length).toEqual(6)
results.forEach(({ detection, landmarks, descriptor }, i) => {
expect(detection.getImageWidth()).toEqual(imgEl.width)
expect(detection.getImageHeight()).toEqual(imgEl.height)
expect(detection.getScore()).toBeCloseTo(expectedScores[i], 2)
expectRectClose(detection.getBox(), expectedSsdBoxes[i], maxBoxDelta)
landmarks.getPositions().forEach((pt, j) => expectPointClose(pt, facesFaceLandmarkPositions[i][j], maxLandmarkPointsDelta))
expect(descriptor).toEqual(new Float32Array(facesFaceDescriptors[i]))
})
})
})
describeWithNets('no memory leaks', { withAllFaces: true }, ({ allFaces }) => {
it('single image element', async () => {
await expectAllTensorsReleased(async () => {
await allFaces(imgEl)
})
})
it('single tf.Tensor3D', async () => {
const tensor = tf.fromPixels(imgEl)
await expectAllTensorsReleased(async () => {
const netInput = (new NetInput([tensor])).managed()
await allFaces(netInput)
})
tensor.dispose()
})
it('single batch size 1 tf.Tensor4Ds', async () => {
const tensor = tf.tidy(() => tf.fromPixels(imgEl).expandDims()) as tf.Tensor4D
await expectAllTensorsReleased(async () => {
await allFaces(await toNetInput(tensor, true))
})
tensor.dispose()
})
})
})
\ No newline at end of file
import * as faceapi from '../../../src';
import { FaceLandmarks5 } from '../../../src/mtcnn/FaceLandmarks5';
import { NetInput } from '../../../src/NetInput';
import { describeWithNets, expectAllTensorsReleased } from '../../utils';
import { expectMtcnnResults } from './expectedResults';
describe('allFacesMtcnn', () => {
let imgEl: HTMLImageElement
let facesFaceDescriptors: number[][]
beforeAll(async () => {
const img = await (await fetch('base/test/images/faces.jpg')).blob()
imgEl = await faceapi.bufferToImage(img)
facesFaceDescriptors = await (await fetch('base/test/data/facesFaceDescriptorsMtcnn.json')).json()
})
describeWithNets('computes full face descriptions', { withAllFacesMtcnn: true }, ({ allFacesMtcnn }) => {
it('minFaceSize = 20', async () => {
const forwardParams = {
minFaceSize: 20
}
const results = await allFacesMtcnn(imgEl, forwardParams)
expect(results.length).toEqual(6)
const mtcnnResult = results.map(res => ({
faceDetection: res.detection,
faceLandmarks: res.landmarks as FaceLandmarks5
}))
expectMtcnnResults(mtcnnResult, [0, 1, 2, 3, 4, 5], 1, 1)
results.forEach(({ descriptor }, i) => {
expect(descriptor).toEqual(new Float32Array(facesFaceDescriptors[i]))
})
})
})
describeWithNets('no memory leaks', { withAllFacesMtcnn: true }, ({ allFacesMtcnn }) => {
it('single image element', async () => {
await expectAllTensorsReleased(async () => {
await allFacesMtcnn(imgEl)
})
})
})
})
\ No newline at end of file
import * as faceapi from '../../../src';
import { FaceLandmarks5 } from '../../../src/mtcnn/FaceLandmarks5';
import { Point } from '../../../src/Point';
import { expectMaxDelta, expectPointClose, expectRectClose } from '../../utils';
export const expectedSsdBoxes = [
{ x: 48, y: 253, width: 104, height: 129 },
{ x: 260, y: 227, width: 76, height: 117 },
{ x: 466, y: 165, width: 88, height: 130 },
{ x: 234, y: 36, width: 84, height: 119 },
{ x: 577, y: 65, width: 84, height: 105 },
{ x: 84, y: 14, width: 79, height: 132 }
]
export const expectedMtcnnBoxes = [
{ x: 70, y: 21, width: 112, height: 112 },
{ x: 36, y: 250, width: 133, height: 132 },
{ x: 221, y: 43, width: 112, height: 111 },
{ x: 247, y: 231, width: 106, height: 107 },
{ x: 566, y: 67, width: 104, height: 104 },
{ x: 451, y: 176, width: 122, height: 122 }
]
export const expectedMtcnnFaceLandmarks = [
[new Point(117, 58), new Point(156, 63), new Point(141, 86), new Point(109, 98), new Point(147, 104)],
[new Point(82, 292), new Point(134, 304), new Point(104, 330), new Point(72, 342), new Point(120, 353)],
[new Point(261, 82), new Point(306, 83), new Point(282, 113), new Point(257, 124), new Point(306, 126)],
[new Point(277, 273), new Point(318, 273), new Point(295, 300), new Point(279, 311), new Point(316, 313)],
[new Point(607, 110), new Point(645, 115), new Point(626, 138), new Point(601, 144), new Point(639, 150)],
[new Point(489, 224), new Point(534, 223), new Point(507, 250), new Point(493, 271), new Point(530, 270)]
]
export function expectMtcnnResults(
results: { faceDetection: faceapi.FaceDetection, faceLandmarks: faceapi.FaceLandmarks5 }[],
boxOrder: number[],
maxBoxDelta: number,
maxLandmarkPointsDelta: number
) {
results.forEach((result, i) => {
const { faceDetection, faceLandmarks } = result
expect(faceDetection instanceof faceapi.FaceDetection).toBe(true)
expect(faceLandmarks instanceof faceapi.FaceLandmarks5).toBe(true)
expectRectClose(faceDetection.getBox(), expectedMtcnnBoxes[boxOrder[i]], maxBoxDelta)
faceLandmarks.getPositions().forEach((pt, j) => expectPointClose(pt, expectedMtcnnFaceLandmarks[boxOrder[i]][j], maxLandmarkPointsDelta))
expectMaxDelta(faceDetection.getScore(), 0.99, 0.01)
})
}
\ No newline at end of file
import * as faceapi from '../../../src';
import { describeWithNets, expectAllTensorsReleased, expectRectClose } from '../../utils';
const expectedBoxes = [
{ x: 48, y: 253, width: 104, height: 129 },
{ x: 260, y: 227, width: 76, height: 117 },
{ x: 466, y: 165, width: 88, height: 130 },
{ x: 234, y: 36, width: 84, height: 119 },
{ x: 577, y: 65, width: 84, height: 105 },
{ x: 84, y: 14, width: 79, height: 132 }
]
import { expectedSsdBoxes } from './expectedResults';
describe('faceDetectionNet', () => {
......@@ -32,7 +24,7 @@ describe('faceDetectionNet', () => {
expect(det.getImageWidth()).toEqual(imgEl.width)
expect(det.getImageHeight()).toEqual(imgEl.height)
expect(det.getScore()).toBeCloseTo(expectedScores[i], 2)
expectRectClose(det.getBox(), expectedBoxes[i], maxBoxDelta)
expectRectClose(det.getBox(), expectedSsdBoxes[i], maxBoxDelta)
})
})
......@@ -44,7 +36,7 @@ describe('faceDetectionNet', () => {
expect(det.getImageWidth()).toEqual(imgEl.width)
expect(det.getImageHeight()).toEqual(imgEl.height)
expect(det.getScore()).toBeCloseTo(expectedScores[i], 2)
expectRectClose(det.getBox(), expectedBoxes[i], maxBoxDelta)
expectRectClose(det.getBox(), expectedSsdBoxes[i], maxBoxDelta)
})
})
......@@ -63,7 +55,7 @@ describe('faceDetectionNet', () => {
expect(det.getImageWidth()).toEqual(imgEl.width)
expect(det.getImageHeight()).toEqual(imgEl.height)
expect(det.getScore()).toBeCloseTo(expectedScores[i], 2)
expectRectClose(det.getBox(), expectedBoxes[i], maxBoxDelta)
expectRectClose(det.getBox(), expectedSsdBoxes[i], maxBoxDelta)
})
})
......@@ -75,7 +67,7 @@ describe('faceDetectionNet', () => {
expect(det.getImageWidth()).toEqual(imgEl.width)
expect(det.getImageHeight()).toEqual(imgEl.height)
expect(det.getScore()).toBeCloseTo(expectedScores[i], 2)
expectRectClose(det.getBox(), expectedBoxes[i], maxBoxDelta)
expectRectClose(det.getBox(), expectedSsdBoxes[i], maxBoxDelta)
})
})
......
......@@ -4,7 +4,7 @@ import * as faceapi from '../../../src';
import { isTensor3D } from '../../../src/commons/isTensor';
import { Point } from '../../../src/Point';
import { Dimensions, TMediaElement } from '../../../src/types';
import { expectMaxDelta, expectAllTensorsReleased, tensor3D, describeWithNets } from '../../utils';
import { expectMaxDelta, expectAllTensorsReleased, describeWithNets } from '../../utils';
import { NetInput } from '../../../src/NetInput';
import { toNetInput } from '../../../src';
......
import * as faceapi from '../../../src';
import { MtcnnResult } from '../../../src/mtcnn/types';
import { Point } from '../../../src/Point';
import { describeWithNets, expectAllTensorsReleased, expectPointClose, expectRectClose, expectMaxDelta } from '../../utils';
const expectedBoxes = [
{ x: 70, y: 21, width: 112, height: 112 },
{ x: 36, y: 250, width: 133, height: 132 },
{ x: 221, y: 43, width: 112, height: 111 },
{ x: 247, y: 231, width: 106, height: 107 },
{ x: 566, y: 67, width: 104, height: 104 },
{ x: 451, y: 176, width: 122, height: 122 }
]
const expectedFaceLandmarks = [
[new Point(117, 58), new Point(156, 63), new Point(141, 86), new Point(109, 98), new Point(147, 104)],
[new Point(82, 292), new Point(134, 304), new Point(104, 330), new Point(72, 342), new Point(120, 353)],
[new Point(261, 82), new Point(306, 83), new Point(282, 113), new Point(257, 124), new Point(306, 126)],
[new Point(277, 273), new Point(318, 273), new Point(295, 300), new Point(279, 311), new Point(316, 313)],
[new Point(607, 110), new Point(645, 115), new Point(626, 138), new Point(601, 144), new Point(639, 150)],
[new Point(489, 224), new Point(534, 223), new Point(507, 250), new Point(493, 271), new Point(530, 270)]
]
import { describeWithNets, expectAllTensorsReleased } from '../../utils';
import { expectMtcnnResults } from './expectedResults';
describe('mtcnn', () => {
......@@ -32,21 +14,6 @@ describe('mtcnn', () => {
describeWithNets('uncompressed weights', { withMtcnn: { quantized: false } }, ({ mtcnn }) => {
function expectResults(
results: MtcnnResult[],
boxOrder: number[],
maxBoxDelta: number,
maxLandmarkPointsDelta: number
) {
results.forEach((result, i) => {
const { faceDetection, faceLandmarks } = result
expect(faceDetection instanceof faceapi.FaceDetection).toBe(true)
expect(faceLandmarks instanceof faceapi.FaceLandmarks5).toBe(true)
expectRectClose(faceDetection.getBox(), expectedBoxes[boxOrder[i]], maxBoxDelta)
faceLandmarks.getPositions().forEach((pt, j) => expectPointClose(pt, expectedFaceLandmarks[boxOrder[i]][j], maxLandmarkPointsDelta))
expectMaxDelta(faceDetection.getScore(), 0.99, 0.01)
})
}
it('minFaceSize = 20, finds all faces', async () => {
const forwardParams = {
......@@ -55,7 +22,7 @@ describe('mtcnn', () => {
const results = await mtcnn.forward(imgEl, forwardParams)
expect(results.length).toEqual(6)
expectResults(results, [0, 1, 2, 3, 4, 5], 1, 1)
expectMtcnnResults(results, [0, 1, 2, 3, 4, 5], 1, 1)
})
it('minFaceSize = 80, finds all faces', async () => {
......@@ -66,7 +33,7 @@ describe('mtcnn', () => {
const results = await mtcnn.forward(imgEl, forwardParams)
expect(results.length).toEqual(6)
expectResults(results, [0, 5, 3, 1, 2, 4], 12, 12)
expectMtcnnResults(results, [0, 5, 3, 1, 2, 4], 12, 12)
})
it('all optional params passed, finds all faces', async () => {
......@@ -79,7 +46,7 @@ describe('mtcnn', () => {
const results = await mtcnn.forward(imgEl, forwardParams)
expect(results.length).toEqual(6)
expectResults(results, [5, 1, 4, 3, 2, 0], 6, 10)
expectMtcnnResults(results, [5, 1, 4, 3, 2, 0], 6, 10)
})
it('scale steps passed, finds all faces', async () => {
......@@ -89,7 +56,7 @@ describe('mtcnn', () => {
const results = await mtcnn.forward(imgEl, forwardParams)
expect(results.length).toEqual(6)
expectResults(results, [5, 1, 3, 0, 2, 4], 7, 15)
expectMtcnnResults(results, [5, 1, 3, 0, 2, 4], 7, 15)
})
})
......
......@@ -4,6 +4,8 @@ import { IRect } from '../build/Rect';
import * as faceapi from '../src/';
import { NeuralNetwork } from '../src/commons/NeuralNetwork';
import { IPoint } from '../src/';
import { allFacesFactory, allFacesMtcnnFactory } from '../src/allFacesFactory';
import { allFacesMtcnnFunction, allFacesFunction } from '../src/globalApi';
export function zeros(length: number): Float32Array {
return new Float32Array(length)
......@@ -57,9 +59,14 @@ export type InjectNetArgs = {
faceLandmarkNet: faceapi.FaceLandmarkNet
faceRecognitionNet: faceapi.FaceRecognitionNet
mtcnn: faceapi.Mtcnn
allFaces: allFacesFunction
allFacesMtcnn: allFacesMtcnnFunction
}
export type DescribeWithNetsOptions = {
withAllFaces?: boolean
withAllFacesMtcnn?: boolean
withFaceDetectionNet?: WithNetOptions
withFaceLandmarkNet?: WithNetOptions
withFaceRecognitionNet?: WithNetOptions
......@@ -92,37 +99,43 @@ export function describeWithNets(
let faceLandmarkNet: faceapi.FaceLandmarkNet = new faceapi.FaceLandmarkNet()
let faceRecognitionNet: faceapi.FaceRecognitionNet = new faceapi.FaceRecognitionNet()
let mtcnn: faceapi.Mtcnn = new faceapi.Mtcnn()
let allFaces = allFacesFactory(faceDetectionNet, faceLandmarkNet, faceRecognitionNet)
let allFacesMtcnn = allFacesMtcnnFactory(mtcnn, faceRecognitionNet)
beforeAll(async () => {
const {
withFaceDetectionNet,
withFaceLandmarkNet,
withFaceRecognitionNet,
withMtcnn
withMtcnn,
withAllFaces,
withAllFacesMtcnn
} = options
if (withFaceDetectionNet) {
if (withFaceDetectionNet || withAllFaces) {
await initNet<faceapi.FaceDetectionNet>(
faceDetectionNet,
!withFaceDetectionNet.quantized && 'face_detection_model.weights'
!!withFaceDetectionNet && !withFaceDetectionNet.quantized && 'face_detection_model.weights'
)
}
if (withFaceLandmarkNet) {
if (withFaceLandmarkNet || withAllFaces) {
await initNet<faceapi.FaceLandmarkNet>(
faceLandmarkNet,
!withFaceLandmarkNet.quantized && 'face_landmark_68_model.weights'
!!withFaceLandmarkNet && !withFaceLandmarkNet.quantized && 'face_landmark_68_model.weights'
)
}
if (withFaceRecognitionNet) {
if (withFaceRecognitionNet || withAllFaces || withAllFacesMtcnn) {
await initNet<faceapi.FaceRecognitionNet>(
faceRecognitionNet,
!withFaceRecognitionNet.quantized && 'face_recognition_model.weights'
// TODO: figure out why quantized weights results in NaNs in testcases
'face_recognition_model.weights'
)
}
if (withMtcnn) {
if (withMtcnn || withAllFacesMtcnn) {
await initNet<faceapi.Mtcnn>(
mtcnn,
!withMtcnn.quantized && 'mtcnn_model.weights'
!!withMtcnn && !withMtcnn.quantized && 'mtcnn_model.weights'
)
}
})
......@@ -134,7 +147,7 @@ export function describeWithNets(
mtcnn && mtcnn.dispose()
})
specDefinitions({ faceDetectionNet, faceLandmarkNet, faceRecognitionNet, mtcnn })
specDefinitions({ faceDetectionNet, faceLandmarkNet, faceRecognitionNet, mtcnn, allFaces, allFacesMtcnn })
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment