Commit 87085653 by vincent

check in latest build

parent 68ff8530
...@@ -368,7 +368,7 @@ const result = await faceapi.detectSingleFace(input).withFaceLandmarks().withFac ...@@ -368,7 +368,7 @@ const result = await faceapi.detectSingleFace(input).withFaceLandmarks().withFac
### Recognizing Face Expressions ### Recognizing Face Expressions
**Face expressions recognition can be performed for detected faces as follows:** **Face expression recognition can be performed for detected faces as follows:**
Detect all faces in an image + recognize face expressions. Returns **Array<[WithFaceExpressions<WithFaceDetection<{}>>](#usage-utility-classes)>**: Detect all faces in an image + recognize face expressions. Returns **Array<[WithFaceExpressions<WithFaceDetection<{}>>](#usage-utility-classes)>**:
......
...@@ -5,4 +5,5 @@ export interface IFaceDetecion { ...@@ -5,4 +5,5 @@ export interface IFaceDetecion {
} }
export declare class FaceDetection extends ObjectDetection implements IFaceDetecion { export declare class FaceDetection extends ObjectDetection implements IFaceDetecion {
constructor(score: number, relativeBox: Rect, imageDims: IDimensions); constructor(score: number, relativeBox: Rect, imageDims: IDimensions);
forSize(width: number, height: number): FaceDetection;
} }
...@@ -7,6 +7,9 @@ var FaceDetection = /** @class */ (function (_super) { ...@@ -7,6 +7,9 @@ var FaceDetection = /** @class */ (function (_super) {
function FaceDetection(score, relativeBox, imageDims) { function FaceDetection(score, relativeBox, imageDims) {
return _super.call(this, score, score, '', relativeBox, imageDims) || this; return _super.call(this, score, score, '', relativeBox, imageDims) || this;
} }
FaceDetection.prototype.forSize = function (width, height) {
return _super.prototype.forSize.call(this, width, height);
};
return FaceDetection; return FaceDetection;
}(tfjs_image_recognition_base_1.ObjectDetection)); }(tfjs_image_recognition_base_1.ObjectDetection));
exports.FaceDetection = FaceDetection; exports.FaceDetection = FaceDetection;
......
{"version":3,"file":"FaceDetection.js","sourceRoot":"","sources":["../../../src/classes/FaceDetection.ts"],"names":[],"mappings":";;;AAAA,2EAAsF;AAOtF;IAAmC,yCAAe;IAChD,uBACE,KAAa,EACb,WAAiB,EACjB,SAAsB;eAEtB,kBAAM,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC;IACjD,CAAC;IACH,oBAAC;AAAD,CAAC,AARD,CAAmC,6CAAe,GAQjD;AARY,sCAAa"} {"version":3,"file":"FaceDetection.js","sourceRoot":"","sources":["../../../src/classes/FaceDetection.ts"],"names":[],"mappings":";;;AAAA,2EAAsF;AAOtF;IAAmC,yCAAe;IAChD,uBACE,KAAa,EACb,WAAiB,EACjB,SAAsB;eAEtB,kBAAM,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,SAAS,CAAC;IACjD,CAAC;IAEM,+BAAO,GAAd,UAAe,KAAa,EAAE,MAAc;QAC1C,OAAO,iBAAM,OAAO,YAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IACrC,CAAC;IACH,oBAAC;AAAD,CAAC,AAZD,CAAmC,6CAAe,GAYjD;AAZY,sCAAa"}
\ No newline at end of file \ No newline at end of file
import { FaceDetection } from './FaceDetection';
import { FaceLandmarks } from './FaceLandmarks';
import { FaceLandmarks68 } from './FaceLandmarks68';
export interface IFaceDetectionWithLandmarks<TFaceLandmarks extends FaceLandmarks = FaceLandmarks68> {
detection: FaceDetection;
landmarks: TFaceLandmarks;
}
export declare class FaceDetectionWithLandmarks<TFaceLandmarks extends FaceLandmarks = FaceLandmarks68> implements IFaceDetectionWithLandmarks<TFaceLandmarks> {
private _detection;
private _unshiftedLandmarks;
constructor(detection: FaceDetection, unshiftedLandmarks: TFaceLandmarks);
readonly detection: FaceDetection;
readonly unshiftedLandmarks: TFaceLandmarks;
readonly alignedRect: FaceDetection;
readonly landmarks: TFaceLandmarks;
readonly faceDetection: FaceDetection;
readonly faceLandmarks: TFaceLandmarks;
forSize(width: number, height: number): FaceDetectionWithLandmarks<TFaceLandmarks>;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var FaceDetection_1 = require("./FaceDetection");
var FaceDetectionWithLandmarks = /** @class */ (function () {
function FaceDetectionWithLandmarks(detection, unshiftedLandmarks) {
this._detection = detection;
this._unshiftedLandmarks = unshiftedLandmarks;
}
Object.defineProperty(FaceDetectionWithLandmarks.prototype, "detection", {
get: function () { return this._detection; },
enumerable: true,
configurable: true
});
Object.defineProperty(FaceDetectionWithLandmarks.prototype, "unshiftedLandmarks", {
get: function () { return this._unshiftedLandmarks; },
enumerable: true,
configurable: true
});
Object.defineProperty(FaceDetectionWithLandmarks.prototype, "alignedRect", {
get: function () {
var rect = this.landmarks.align();
var imageDims = this.detection.imageDims;
return new FaceDetection_1.FaceDetection(this._detection.score, rect.rescale(imageDims.reverse()), imageDims);
},
enumerable: true,
configurable: true
});
Object.defineProperty(FaceDetectionWithLandmarks.prototype, "landmarks", {
get: function () {
var _a = this.detection.box, x = _a.x, y = _a.y;
return this._unshiftedLandmarks.shiftBy(x, y);
},
enumerable: true,
configurable: true
});
Object.defineProperty(FaceDetectionWithLandmarks.prototype, "faceDetection", {
// aliases for backward compatibily
get: function () { return this.detection; },
enumerable: true,
configurable: true
});
Object.defineProperty(FaceDetectionWithLandmarks.prototype, "faceLandmarks", {
get: function () { return this.landmarks; },
enumerable: true,
configurable: true
});
FaceDetectionWithLandmarks.prototype.forSize = function (width, height) {
var resizedDetection = this._detection.forSize(width, height);
var resizedLandmarks = this._unshiftedLandmarks.forSize(resizedDetection.box.width, resizedDetection.box.height);
return new FaceDetectionWithLandmarks(resizedDetection, resizedLandmarks);
};
return FaceDetectionWithLandmarks;
}());
exports.FaceDetectionWithLandmarks = FaceDetectionWithLandmarks;
//# sourceMappingURL=FaceDetectionWithLandmarks.js.map
\ No newline at end of file
{"version":3,"file":"FaceDetectionWithLandmarks.js","sourceRoot":"","sources":["../../../src/classes/FaceDetectionWithLandmarks.ts"],"names":[],"mappings":";;AAAA,iDAAgD;AAShD;IAME,oCACE,SAAwB,EACxB,kBAAkC;QAElC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;QAC3B,IAAI,CAAC,mBAAmB,GAAG,kBAAkB,CAAA;IAC/C,CAAC;IAED,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CY,gEAA0B"}
\ No newline at end of file
import { FaceDetection } from './FaceDetection';
import { FaceDetectionWithLandmarks, IFaceDetectionWithLandmarks } from './FaceDetectionWithLandmarks';
import { FaceLandmarks } from './FaceLandmarks';
import { FaceLandmarks68 } from './FaceLandmarks68';
export interface IFullFaceDescription<TFaceLandmarks extends FaceLandmarks = FaceLandmarks68> extends IFaceDetectionWithLandmarks<TFaceLandmarks> {
detection: FaceDetection;
landmarks: TFaceLandmarks;
descriptor: Float32Array;
}
export declare class FullFaceDescription<TFaceLandmarks extends FaceLandmarks = FaceLandmarks68> extends FaceDetectionWithLandmarks<TFaceLandmarks> implements IFullFaceDescription<TFaceLandmarks> {
private _descriptor;
constructor(detection: FaceDetection, unshiftedLandmarks: TFaceLandmarks, descriptor: Float32Array);
readonly descriptor: Float32Array;
forSize(width: number, height: number): FullFaceDescription<TFaceLandmarks>;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var FaceDetectionWithLandmarks_1 = require("./FaceDetectionWithLandmarks");
var FullFaceDescription = /** @class */ (function (_super) {
tslib_1.__extends(FullFaceDescription, _super);
function FullFaceDescription(detection, unshiftedLandmarks, descriptor) {
var _this = _super.call(this, detection, unshiftedLandmarks) || this;
_this._descriptor = descriptor;
return _this;
}
Object.defineProperty(FullFaceDescription.prototype, "descriptor", {
get: function () {
return this._descriptor;
},
enumerable: true,
configurable: true
});
FullFaceDescription.prototype.forSize = function (width, height) {
var _a = _super.prototype.forSize.call(this, width, height), detection = _a.detection, landmarks = _a.landmarks;
return new FullFaceDescription(detection, landmarks, this.descriptor);
};
return FullFaceDescription;
}(FaceDetectionWithLandmarks_1.FaceDetectionWithLandmarks));
exports.FullFaceDescription = FullFaceDescription;
//# sourceMappingURL=FullFaceDescription.js.map
\ No newline at end of file
{"version":3,"file":"FullFaceDescription.js","sourceRoot":"","sources":["../../../src/classes/FullFaceDescription.ts"],"names":[],"mappings":";;;AACA,2EAAuG;AAYvG;IACU,+CAA0C;IAKlD,6BACE,SAAwB,EACxB,kBAAkC,EAClC,UAAwB;QAH1B,YAKE,kBAAM,SAAS,EAAE,kBAAkB,CAAC,SAErC;QADC,KAAI,CAAC,WAAW,GAAG,UAAU,CAAA;;IAC/B,CAAC;IAED,sBAAW,2CAAU;aAArB;YACE,OAAO,IAAI,CAAC,WAAW,CAAA;QACzB,CAAC;;;OAAA;IAEM,qCAAO,GAAd,UAAe,KAAa,EAAE,MAAc;QACpC,IAAA,uDAAuD,EAArD,wBAAS,EAAE,wBAAS,CAAiC;QAC7D,OAAO,IAAI,mBAAmB,CAAiB,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;IACvF,CAAC;IACH,0BAAC;AAAD,CAAC,AAvBD,CACU,uDAA0B,GAsBnC;AAvBY,kDAAmB"}
\ No newline at end of file
export * from './FaceDetection'; export * from './FaceDetection';
export * from './FaceDetectionWithLandmarks';
export * from './FaceLandmarks'; export * from './FaceLandmarks';
export * from './FaceLandmarks5'; export * from './FaceLandmarks5';
export * from './FaceLandmarks68'; export * from './FaceLandmarks68';
export * from './FaceMatch'; export * from './FaceMatch';
export * from './FullFaceDescription';
export * from './LabeledFaceDescriptors'; export * from './LabeledFaceDescriptors';
...@@ -2,11 +2,9 @@ ...@@ -2,11 +2,9 @@
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib"); var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./FaceDetection"), exports); tslib_1.__exportStar(require("./FaceDetection"), exports);
tslib_1.__exportStar(require("./FaceDetectionWithLandmarks"), exports);
tslib_1.__exportStar(require("./FaceLandmarks"), exports); tslib_1.__exportStar(require("./FaceLandmarks"), exports);
tslib_1.__exportStar(require("./FaceLandmarks5"), exports); tslib_1.__exportStar(require("./FaceLandmarks5"), exports);
tslib_1.__exportStar(require("./FaceLandmarks68"), exports); tslib_1.__exportStar(require("./FaceLandmarks68"), exports);
tslib_1.__exportStar(require("./FaceMatch"), exports); tslib_1.__exportStar(require("./FaceMatch"), exports);
tslib_1.__exportStar(require("./FullFaceDescription"), exports);
tslib_1.__exportStar(require("./LabeledFaceDescriptors"), exports); tslib_1.__exportStar(require("./LabeledFaceDescriptors"), exports);
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/classes/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,uEAA6C;AAC7C,0DAAgC;AAChC,2DAAiC;AACjC,4DAAkC;AAClC,sDAA4B;AAC5B,gEAAsC;AACtC,mEAAyC"} {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/classes/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,0DAAgC;AAChC,2DAAiC;AACjC,4DAAkC;AAClC,sDAA4B;AAC5B,mEAAyC"}
\ No newline at end of file \ No newline at end of file
{"version":3,"file":"fullyConnectedLayer.js","sourceRoot":"","sources":["../../../src/common/fullyConnectedLayer.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAG5C,6BACE,CAAc,EACd,MAAgB;IAEhB,OAAO,EAAE,CAAC,IAAI,CAAC;QACb,OAAA,EAAE,CAAC,GAAG,CACJ,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,EAC5B,MAAM,CAAC,IAAI,CACZ;IAHD,CAGC,CACF,CAAA;AACH,CAAC;AAVD,kDAUC"}
\ No newline at end of file
import { DrawFaceExpressionsInput, DrawFaceExpressionsOptions } from './types';
export declare function drawFaceExpressions(canvasArg: string | HTMLCanvasElement, faceExpressions: DrawFaceExpressionsInput | DrawFaceExpressionsInput[], options?: DrawFaceExpressionsOptions): void;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
function drawFaceExpressions(canvasArg, faceExpressions, options) {
var canvas = tfjs_image_recognition_base_1.resolveInput(canvasArg);
if (!(canvas instanceof tfjs_image_recognition_base_1.env.getEnv().Canvas)) {
throw new Error('drawFaceExpressions - expected canvas to be of type: HTMLCanvasElement');
}
var drawOptions = Object.assign(tfjs_image_recognition_base_1.getDefaultDrawOptions(options), (options || {}));
var ctx = tfjs_image_recognition_base_1.getContext2dOrThrow(canvas);
var _a = drawOptions.primaryColor, primaryColor = _a === void 0 ? 'red' : _a, _b = drawOptions.secondaryColor, secondaryColor = _b === void 0 ? 'blue' : _b, _c = drawOptions.primaryFontSize, primaryFontSize = _c === void 0 ? 22 : _c, _d = drawOptions.secondaryFontSize, secondaryFontSize = _d === void 0 ? 16 : _d, _e = drawOptions.minConfidence, minConfidence = _e === void 0 ? 0.2 : _e;
var faceExpressionsArray = Array.isArray(faceExpressions)
? faceExpressions
: [faceExpressions];
faceExpressionsArray.forEach(function (_a) {
var position = _a.position, expressions = _a.expressions;
var x = position.x, y = position.y;
var height = position.height || 0;
var sorted = expressions.sort(function (a, b) { return b.probability - a.probability; });
var resultsToDisplay = sorted.filter(function (expr) { return expr.probability > minConfidence; });
var offset = (y + height + resultsToDisplay.length * primaryFontSize) > canvas.height
? -(resultsToDisplay.length * primaryFontSize)
: 0;
resultsToDisplay.forEach(function (expr, i) {
var text = expr.expression + " (" + tfjs_image_recognition_base_1.round(expr.probability) + ")";
tfjs_image_recognition_base_1.drawText(ctx, x, y + height + (i * primaryFontSize) + offset, text, {
textColor: i === 0 ? primaryColor : secondaryColor,
fontSize: i === 0 ? primaryFontSize : secondaryFontSize
});
});
});
}
exports.drawFaceExpressions = drawFaceExpressions;
//# sourceMappingURL=drawFaceExpressions.js.map
\ No newline at end of file
{"version":3,"file":"drawFaceExpressions.js","sourceRoot":"","sources":["../../../src/dom/drawFaceExpressions.ts"],"names":[],"mappings":";;AAAA,2EAA6H;AAK7H,6BACE,SAAqC,EACrC,eAAsE,EACtE,OAAoC;IAEpC,IAAM,MAAM,GAAG,0CAAY,CAAC,SAAS,CAAC,CAAA;IACtC,IAAI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,eAAe,CAAC;YAC9C,CAAC,CAAC,CAAC,CAAA;QACL,gBAAgB,CAAC,OAAO,CAAC,UAAC,IAAI,EAAE,CAAC;YAC/B,IAAM,IAAI,GAAM,IAAI,CAAC,UAAU,UAAK,mCAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAG,CAAA;YAC9D,sCAAQ,CACN,GAAG,EACH,CAAC,EACD,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,eAAe,CAAC,GAAG,MAAM,EAC3C,IAAI,EACJ;gBACE,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc;gBAClD,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,iBAAiB;aACxD,CACF,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AAGJ,CAAC;AArDD,kDAqDC"}
\ No newline at end of file
export * from './drawContour'; export * from './drawContour';
export * from './drawLandmarks'; export * from './drawLandmarks';
export * from './drawFaceExpressions';
export * from './extractFaces'; export * from './extractFaces';
export * from './extractFaceTensors'; export * from './extractFaceTensors';
export * from './types'; export * from './types';
...@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); ...@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib"); var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./drawContour"), exports); tslib_1.__exportStar(require("./drawContour"), exports);
tslib_1.__exportStar(require("./drawLandmarks"), exports); tslib_1.__exportStar(require("./drawLandmarks"), exports);
tslib_1.__exportStar(require("./drawFaceExpressions"), exports);
tslib_1.__exportStar(require("./extractFaces"), exports); tslib_1.__exportStar(require("./extractFaces"), exports);
tslib_1.__exportStar(require("./extractFaceTensors"), exports); tslib_1.__exportStar(require("./extractFaceTensors"), exports);
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dom/index.ts"],"names":[],"mappings":";;;AAAA,wDAA6B;AAC7B,0DAA+B;AAC/B,yDAA8B;AAC9B,+DAAoC"} {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dom/index.ts"],"names":[],"mappings":";;;AAAA,wDAA6B;AAC7B,0DAA+B;AAC/B,gEAAqC;AACrC,yDAA8B;AAC9B,+DAAoC"}
\ No newline at end of file \ No newline at end of file
import { IPoint, IRect } from 'tfjs-tiny-yolov2';
import { WithFaceExpressions } from '../factories/WithFaceExpressions';
export declare type DrawLandmarksOptions = { export declare type DrawLandmarksOptions = {
lineWidth?: number; lineWidth?: number;
color?: string; color?: string;
drawLines?: boolean; drawLines?: boolean;
}; };
export declare type DrawFaceExpressionsOptions = {
primaryColor?: string;
secondaryColor?: string;
primaryFontSize?: number;
secondaryFontSize?: number;
minConfidence?: number;
};
export declare type DrawFaceExpressionsInput = WithFaceExpressions<{
position: IPoint | IRect;
}>;
import * as tf from '@tensorflow/tfjs-core';
import { NetInput, TNetInput } from 'tfjs-image-recognition-base';
import { FaceFeatureExtractor } from '../faceFeatureExtractor/FaceFeatureExtractor';
import { FaceFeatureExtractorParams } from '../faceFeatureExtractor/types';
import { FaceProcessor } from '../faceProcessor/FaceProcessor';
import { FaceExpressionPrediction } from './types';
export declare class FaceExpressionNet extends FaceProcessor<FaceFeatureExtractorParams> {
static getFaceExpressionLabel(faceExpression: string): number;
static decodeProbabilites(probabilities: number[] | Float32Array): FaceExpressionPrediction[];
constructor(faceFeatureExtractor?: FaceFeatureExtractor);
forwardInput(input: NetInput | tf.Tensor4D): tf.Tensor2D;
forward(input: TNetInput): Promise<tf.Tensor2D>;
predictExpressions(input: TNetInput): Promise<FaceExpressionPrediction[] | FaceExpressionPrediction[][]>;
protected getDefaultModelName(): string;
protected getClassifierChannelsIn(): number;
protected getClassifierChannelsOut(): number;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var tf = require("@tensorflow/tfjs-core");
var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
var FaceFeatureExtractor_1 = require("../faceFeatureExtractor/FaceFeatureExtractor");
var FaceProcessor_1 = require("../faceProcessor/FaceProcessor");
var types_1 = require("./types");
var FaceExpressionNet = /** @class */ (function (_super) {
tslib_1.__extends(FaceExpressionNet, _super);
function FaceExpressionNet(faceFeatureExtractor) {
if (faceFeatureExtractor === void 0) { faceFeatureExtractor = new FaceFeatureExtractor_1.FaceFeatureExtractor(); }
return _super.call(this, 'FaceExpressionNet', faceFeatureExtractor) || this;
}
FaceExpressionNet.getFaceExpressionLabel = function (faceExpression) {
var label = types_1.faceExpressionLabels[faceExpression];
if (typeof label !== 'number') {
throw new Error("getFaceExpressionLabel - no label for faceExpression: " + faceExpression);
}
return label;
};
FaceExpressionNet.decodeProbabilites = function (probabilities) {
if (probabilities.length !== 7) {
throw new Error("decodeProbabilites - expected probabilities.length to be 7, have: " + probabilities.length);
}
return Object.keys(types_1.faceExpressionLabels)
.map(function (expression) { return ({ expression: expression, probability: probabilities[types_1.faceExpressionLabels[expression]] }); });
};
FaceExpressionNet.prototype.forwardInput = function (input) {
var _this = this;
return tf.tidy(function () { return tf.softmax(_this.runNet(input)); });
};
FaceExpressionNet.prototype.forward = function (input) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var _a;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = this.forwardInput;
return [4 /*yield*/, tfjs_image_recognition_base_1.toNetInput(input)];
case 1: return [2 /*return*/, _a.apply(this, [_b.sent()])];
}
});
});
};
FaceExpressionNet.prototype.predictExpressions = function (input) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var _this = this;
var netInput, out, probabilitesByBatch, predictionsByBatch;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, tfjs_image_recognition_base_1.toNetInput(input)];
case 1:
netInput = _a.sent();
return [4 /*yield*/, this.forwardInput(netInput)];
case 2:
out = _a.sent();
return [4 /*yield*/, Promise.all(tf.unstack(out).map(function (t) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var data;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, t.data()];
case 1:
data = _a.sent();
t.dispose();
return [2 /*return*/, data];
}
});
}); }))];
case 3:
probabilitesByBatch = _a.sent();
out.dispose();
predictionsByBatch = probabilitesByBatch
.map(function (propablities) { return FaceExpressionNet.decodeProbabilites(propablities); });
return [2 /*return*/, netInput.isBatchInput
? predictionsByBatch
: predictionsByBatch[0]];
}
});
});
};
FaceExpressionNet.prototype.getDefaultModelName = function () {
return 'face_expression_model';
};
FaceExpressionNet.prototype.getClassifierChannelsIn = function () {
return 256;
};
FaceExpressionNet.prototype.getClassifierChannelsOut = function () {
return 7;
};
return FaceExpressionNet;
}(FaceProcessor_1.FaceProcessor));
exports.FaceExpressionNet = FaceExpressionNet;
//# sourceMappingURL=FaceExpressionNet.js.map
\ No newline at end of file
{"version":3,"file":"FaceExpressionNet.js","sourceRoot":"","sources":["../../../src/faceExpressionNet/FaceExpressionNet.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAC5C,2EAA8E;AAE9E,qFAAoF;AAEpF,gEAA+D;AAC/D,iCAAyF;AAEzF;IAAuC,6CAAyC;IAqB9E,2BAAY,oBAAuE;QAAvE,qCAAA,EAAA,2BAAiD,2CAAoB,EAAE;eACjF,kBAAM,mBAAmB,EAAE,oBAAoB,CAAC;IAClD,CAAC;IArBa,wCAAsB,GAApC,UAAqC,cAAsB;QACzD,IAAM,KAAK,GAAG,4BAAoB,CAAC,cAAc,CAAC,CAAA;QAElD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,MAAM,IAAI,KAAK,CAAC,2DAAyD,cAAgB,CAAC,CAAA;SAC3F;QAED,OAAO,KAAK,CAAA;IACd,CAAC;IAEa,oCAAkB,GAAhC,UAAiC,aAAsC;QACrE,IAAI,aAA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SAIzB;wBACH,GAAG,CAAC,OAAO,EAAE,CAAA;wBAEP,kBAAkB,GAAG,mBAAmB;6BAC3C,GAAG,CAAC,UAAA,YAAY,IAAI,OAAA,iBAAiB,CAAC,kBAAkB,CAAC,YAA4B,CAAC,EAAlE,CAAkE,CAAC,CAAA;wBAE1F,sBAAO,QAAQ,CAAC,YAAY;gCAC1B,CAAC,CAAC,kBAAkB;gCACpB,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAAA;;;;KAC1B;IAES,+CAAmB,GAA7B;QACE,OAAO,uBAAuB,CAAA;IAChC,CAAC;IAES,mDAAuB,GAAjC;QACE,OAAO,GAAG,CAAA;IACZ,CAAC;IAES,oDAAwB,GAAlC;QACE,OAAO,CAAC,CAAA;IACV,CAAC;IACH,wBAAC;AAAD,CAAC,AA9DD,CAAuC,6BAAa,GA8DnD;AA9DY,8CAAiB"}
\ No newline at end of file
export * from './FaceExpressionNet';
export * from './types';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./FaceExpressionNet"), exports);
tslib_1.__exportStar(require("./types"), exports);
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/faceExpressionNet/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,kDAAwB"}
\ No newline at end of file
export declare const faceExpressionLabels: {
neutral: number;
happy: number;
sad: number;
angry: number;
fearful: number;
disgusted: number;
surprised: number;
};
export declare type FaceExpression = 'neutral' | 'happy' | 'sad' | 'angry' | 'fearful' | 'disgusted' | 'surprised';
export declare type FaceExpressionPrediction = {
expression: FaceExpression;
probability: number;
};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.faceExpressionLabels = {
neutral: 0,
happy: 1,
sad: 2,
angry: 3,
fearful: 4,
disgusted: 5,
surprised: 6
};
//# sourceMappingURL=types.js.map
\ No newline at end of file
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/faceExpressionNet/types.ts"],"names":[],"mappings":";;AAAa,QAAA,oBAAoB,GAAG;IAClC,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;IACN,KAAK,EAAE,CAAC;IACR,OAAO,EAAE,CAAC;IACV,SAAS,EAAE,CAAC;IACZ,SAAS,EAAC,CAAC;CACZ,CAAA"}
\ No newline at end of file
import * as tf from '@tensorflow/tfjs-core';
import { NetInput, NeuralNetwork, TNetInput } from 'tfjs-image-recognition-base';
import { FaceFeatureExtractorParams, IFaceFeatureExtractor } from './types';
export declare class FaceFeatureExtractor extends NeuralNetwork<FaceFeatureExtractorParams> implements IFaceFeatureExtractor<FaceFeatureExtractorParams> {
constructor();
forwardInput(input: NetInput): tf.Tensor4D;
forward(input: TNetInput): Promise<tf.Tensor4D>;
protected getDefaultModelName(): string;
protected extractParamsFromWeigthMap(weightMap: tf.NamedTensorMap): {
params: FaceFeatureExtractorParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
protected extractParams(weights: Float32Array): {
params: FaceFeatureExtractorParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var tf = require("@tensorflow/tfjs-core");
var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
var denseBlock_1 = require("./denseBlock");
var extractParams_1 = require("./extractParams");
var extractParamsFromWeigthMap_1 = require("./extractParamsFromWeigthMap");
var FaceFeatureExtractor = /** @class */ (function (_super) {
tslib_1.__extends(FaceFeatureExtractor, _super);
function FaceFeatureExtractor() {
return _super.call(this, 'FaceFeatureExtractor') || this;
}
FaceFeatureExtractor.prototype.forwardInput = function (input) {
var params = this.params;
if (!params) {
throw new Error('FaceFeatureExtractor - load model before inference');
}
return tf.tidy(function () {
var batchTensor = input.toBatchTensor(112, true);
var meanRgb = [122.782, 117.001, 104.298];
var normalized = tfjs_image_recognition_base_1.normalize(batchTensor, meanRgb).div(tf.scalar(255));
var out = denseBlock_1.denseBlock4(normalized, params.dense0, true);
out = denseBlock_1.denseBlock4(out, params.dense1);
out = denseBlock_1.denseBlock4(out, params.dense2);
out = denseBlock_1.denseBlock4(out, params.dense3);
out = tf.avgPool(out, [7, 7], [2, 2], 'valid');
return out;
});
};
FaceFeatureExtractor.prototype.forward = function (input) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var _a;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = this.forwardInput;
return [4 /*yield*/, tfjs_image_recognition_base_1.toNetInput(input)];
case 1: return [2 /*return*/, _a.apply(this, [_b.sent()])];
}
});
});
};
FaceFeatureExtractor.prototype.getDefaultModelName = function () {
return 'face_feature_extractor_model';
};
FaceFeatureExtractor.prototype.extractParamsFromWeigthMap = function (weightMap) {
return extractParamsFromWeigthMap_1.extractParamsFromWeigthMap(weightMap);
};
FaceFeatureExtractor.prototype.extractParams = function (weights) {
return extractParams_1.extractParams(weights);
};
return FaceFeatureExtractor;
}(tfjs_image_recognition_base_1.NeuralNetwork));
exports.FaceFeatureExtractor = FaceFeatureExtractor;
//# sourceMappingURL=FaceFeatureExtractor.js.map
\ No newline at end of file
{"version":3,"file":"FaceFeatureExtractor.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/FaceFeatureExtractor.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAC5C,2EAAwG;AAExG,2CAA2C;AAC3C,iDAAgD;AAChD,2EAA0E;AAG1E;IAA0C,gDAAyC;IAEjF;eACE,kBAAM,sBAAsB,CAAC;IAC/B,CAAC;IAEM,2CAAY,GAAnB,UAAoB,KAAe;QAEzB,IAAA,oBAAM,CAAS;QAEvB,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAA;SACtE;QAED,OAAO,EAAE,CAAC,IAAI,CAAC;YACb,IAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,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AA5CY,oDAAoB"}
\ No newline at end of file
import * as tf from '@tensorflow/tfjs-core';
import { NetInput, NeuralNetwork, TNetInput } from 'tfjs-image-recognition-base';
import { IFaceFeatureExtractor, TinyFaceFeatureExtractorParams } from './types';
export declare class TinyFaceFeatureExtractor extends NeuralNetwork<TinyFaceFeatureExtractorParams> implements IFaceFeatureExtractor<TinyFaceFeatureExtractorParams> {
constructor();
forwardInput(input: NetInput): tf.Tensor4D;
forward(input: TNetInput): Promise<tf.Tensor4D>;
protected getDefaultModelName(): string;
protected extractParamsFromWeigthMap(weightMap: tf.NamedTensorMap): {
params: TinyFaceFeatureExtractorParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
protected extractParams(weights: Float32Array): {
params: TinyFaceFeatureExtractorParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var tf = require("@tensorflow/tfjs-core");
var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
var denseBlock_1 = require("./denseBlock");
var extractParamsFromWeigthMapTiny_1 = require("./extractParamsFromWeigthMapTiny");
var extractParamsTiny_1 = require("./extractParamsTiny");
var TinyFaceFeatureExtractor = /** @class */ (function (_super) {
tslib_1.__extends(TinyFaceFeatureExtractor, _super);
function TinyFaceFeatureExtractor() {
return _super.call(this, 'TinyFaceFeatureExtractor') || this;
}
TinyFaceFeatureExtractor.prototype.forwardInput = function (input) {
var params = this.params;
if (!params) {
throw new Error('TinyFaceFeatureExtractor - load model before inference');
}
return tf.tidy(function () {
var batchTensor = input.toBatchTensor(112, true);
var meanRgb = [122.782, 117.001, 104.298];
var normalized = tfjs_image_recognition_base_1.normalize(batchTensor, meanRgb).div(tf.scalar(255));
var out = denseBlock_1.denseBlock3(normalized, params.dense0, true);
out = denseBlock_1.denseBlock3(out, params.dense1);
out = denseBlock_1.denseBlock3(out, params.dense2);
out = tf.avgPool(out, [14, 14], [2, 2], 'valid');
return out;
});
};
TinyFaceFeatureExtractor.prototype.forward = function (input) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var _a;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = this.forwardInput;
return [4 /*yield*/, tfjs_image_recognition_base_1.toNetInput(input)];
case 1: return [2 /*return*/, _a.apply(this, [_b.sent()])];
}
});
});
};
TinyFaceFeatureExtractor.prototype.getDefaultModelName = function () {
return 'face_feature_extractor_tiny_model';
};
TinyFaceFeatureExtractor.prototype.extractParamsFromWeigthMap = function (weightMap) {
return extractParamsFromWeigthMapTiny_1.extractParamsFromWeigthMapTiny(weightMap);
};
TinyFaceFeatureExtractor.prototype.extractParams = function (weights) {
return extractParamsTiny_1.extractParamsTiny(weights);
};
return TinyFaceFeatureExtractor;
}(tfjs_image_recognition_base_1.NeuralNetwork));
exports.TinyFaceFeatureExtractor = TinyFaceFeatureExtractor;
//# sourceMappingURL=TinyFaceFeatureExtractor.js.map
\ No newline at end of file
{"version":3,"file":"TinyFaceFeatureExtractor.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/TinyFaceFeatureExtractor.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAC5C,2EAAwG;AAExG,2CAA2C;AAC3C,mFAAkF;AAClF,yDAAwD;AAGxD;IAA8C,oDAA6C;IAEzF;eACE,kBAAM,0BAA0B,CAAC;IACnC,CAAC;IAEM,+CAAY,GAAnB,UAAoB,KAAe;QAEzB,IAAA,oBAAM,CAAS;QAEvB,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;SAC1E;QAED,OAAO,EAAE,CAAC,IAAI,CAAC;YACb,IAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;YAClD,IAAM,OAAO,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;YAC3C,IAAM,UAAU,GAAG,uCAAS,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAgB,CAAA;YAErF,IAAI,GAAG,GAAG,wBAAW,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;YACtD,GAAG,GAAG,wBAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;YACrC,GAAG,GAAG,wBAAW,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;YACrC,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;YAEhD,OAAO,GAAG,CAAA;QACZ,CAAC,CAAC,CAAA;IACJ,CAAC;IAEY,0CAAO,GAApB,UAAqB,KAAgB;;;;;;wBAC5B,KAAA,IAAI,CAAC,YAAY,CAAA;wBAAC,qBAAM,wCAAU,CAAC,KAAK,CAAC,EAAA;4BAAhD,sBAAO,SAAA,IAAI,GAAc,SAAuB,EAAC,EAAA;;;;KAClD;IAES,sDAAmB,GAA7B;QACE,OAAO,mCAAmC,CAAA;IAC5C,CAAC;IAES,6DAA0B,GAApC,UAAqC,SAA4B;QAC/D,OAAO,+DAA8B,CAAC,SAAS,CAAC,CAAA;IAClD,CAAC;IAES,gDAAa,GAAvB,UAAwB,OAAqB;QAC3C,OAAO,qCAAiB,CAAC,OAAO,CAAC,CAAA;IACnC,CAAC;IACH,+BAAC;AAAD,CAAC,AA3CD,CAA8C,2CAAa,GA2C1D;AA3CY,4DAAwB"}
\ No newline at end of file
import * as tf from '@tensorflow/tfjs-core';
import { DenseBlock3Params, DenseBlock4Params } from './types';
export declare function denseBlock3(x: tf.Tensor4D, denseBlockParams: DenseBlock3Params, isFirstLayer?: boolean): tf.Tensor4D;
export declare function denseBlock4(x: tf.Tensor4D, denseBlockParams: DenseBlock4Params, isFirstLayer?: boolean, isScaleDown?: boolean): tf.Tensor4D;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tf = require("@tensorflow/tfjs-core");
var depthwiseSeparableConv_1 = require("./depthwiseSeparableConv");
function denseBlock3(x, denseBlockParams, isFirstLayer) {
if (isFirstLayer === void 0) { isFirstLayer = false; }
return tf.tidy(function () {
var out1 = tf.relu(isFirstLayer
? tf.add(tf.conv2d(x, denseBlockParams.conv0.filters, [2, 2], 'same'), denseBlockParams.conv0.bias)
: depthwiseSeparableConv_1.depthwiseSeparableConv(x, denseBlockParams.conv0, [2, 2]));
var out2 = depthwiseSeparableConv_1.depthwiseSeparableConv(out1, denseBlockParams.conv1, [1, 1]);
var in3 = tf.relu(tf.add(out1, out2));
var out3 = depthwiseSeparableConv_1.depthwiseSeparableConv(in3, denseBlockParams.conv2, [1, 1]);
return tf.relu(tf.add(out1, tf.add(out2, out3)));
});
}
exports.denseBlock3 = denseBlock3;
function denseBlock4(x, denseBlockParams, isFirstLayer, isScaleDown) {
if (isFirstLayer === void 0) { isFirstLayer = false; }
if (isScaleDown === void 0) { isScaleDown = true; }
return tf.tidy(function () {
var out1 = tf.relu(isFirstLayer
? tf.add(tf.conv2d(x, denseBlockParams.conv0.filters, isScaleDown ? [2, 2] : [1, 1], 'same'), denseBlockParams.conv0.bias)
: depthwiseSeparableConv_1.depthwiseSeparableConv(x, denseBlockParams.conv0, isScaleDown ? [2, 2] : [1, 1]));
var out2 = depthwiseSeparableConv_1.depthwiseSeparableConv(out1, denseBlockParams.conv1, [1, 1]);
var in3 = tf.relu(tf.add(out1, out2));
var out3 = depthwiseSeparableConv_1.depthwiseSeparableConv(in3, denseBlockParams.conv2, [1, 1]);
var in4 = tf.relu(tf.add(out1, tf.add(out2, out3)));
var out4 = depthwiseSeparableConv_1.depthwiseSeparableConv(in4, denseBlockParams.conv3, [1, 1]);
return tf.relu(tf.add(out1, tf.add(out2, tf.add(out3, out4))));
});
}
exports.denseBlock4 = denseBlock4;
//# sourceMappingURL=denseBlock.js.map
\ No newline at end of file
{"version":3,"file":"denseBlock.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/denseBlock.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAG5C,mEAAkE;AAGlE,qBACE,CAAc,EACd,gBAAmC,EACnC,YAA6B;IAA7B,6BAAA,EAAA,oBAA6B;IAE7B,OAAO,EAAE,CAAC,IAAI,CAAC;QACb,IAAM,IAAI,GAAG,EAAE,CAAC,IAAI,CAClB,YAAY;YACV,CAAC,CAAC,EAAE,CAAC,GAAG,CACN,EAAE,CAAC,MAAM,CAAC,CAAC,EAAG,gBAAgB,CAAC,KAAoB,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,EAC5E,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAC5B;YACD,CAAC,CAAC,+CAAsB,CAAC,CAAC,EAAE,gBAAgB,CAAC,KAA4B,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CACtE,CAAA;QAChB,IAAM,IAAI,GAAG,+CAAsB,CAAC,IAAI,EAAE,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QAEzE,IAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAgB,CAAA;QACtD,IAAM,IAAI,GAAG,+CAAsB,CAAC,GAAG,EAAE,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QAExE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAgB,CAAA;IACjE,CAAC,CAAC,CAAA;AACJ,CAAC;AArBD,kCAqBC;AAED,qBACE,CAAc,EACd,gBAAmC,EACnC,YAA6B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,CAAC,CAAC,CAAC,CAAA;QAExE,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAgB,CAAA;IAC/E,CAAC,CAAC,CAAA;AACJ,CAAC;AAzBD,kCAyBC"}
\ No newline at end of file
{"version":3,"file":"depthwiseSeparableConv.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/depthwiseSeparableConv.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAG5C,gCACE,CAAc,EACd,MAA2B,EAC3B,MAAwB;IAExB,OAAO,EAAE,CAAC,IAAI,CAAC;QACb,IAAI,GAAG,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;QACjG,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;QAC9B,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;AACJ,CAAC;AAVD,wDAUC"}
\ No newline at end of file
import { ParamMapping } from 'tfjs-image-recognition-base';
import { FaceFeatureExtractorParams } from './types';
export declare function extractParams(weights: Float32Array): {
params: FaceFeatureExtractorParams;
paramMappings: ParamMapping[];
};
...@@ -5,18 +5,17 @@ var extractorsFactory_1 = require("./extractorsFactory"); ...@@ -5,18 +5,17 @@ var extractorsFactory_1 = require("./extractorsFactory");
function extractParams(weights) { function extractParams(weights) {
var paramMappings = []; var paramMappings = [];
var _a = tfjs_image_recognition_base_1.extractWeightsFactory(weights), extractWeights = _a.extractWeights, getRemainingWeights = _a.getRemainingWeights; var _a = tfjs_image_recognition_base_1.extractWeightsFactory(weights), extractWeights = _a.extractWeights, getRemainingWeights = _a.getRemainingWeights;
var _b = extractorsFactory_1.extractorsFactory(extractWeights, paramMappings), extractDenseBlock4Params = _b.extractDenseBlock4Params, extractFCParams = _b.extractFCParams; var extractDenseBlock4Params = extractorsFactory_1.extractorsFactory(extractWeights, paramMappings).extractDenseBlock4Params;
var dense0 = extractDenseBlock4Params(3, 32, 'dense0', true); var dense0 = extractDenseBlock4Params(3, 32, 'dense0', true);
var dense1 = extractDenseBlock4Params(32, 64, 'dense1'); var dense1 = extractDenseBlock4Params(32, 64, 'dense1');
var dense2 = extractDenseBlock4Params(64, 128, 'dense2'); var dense2 = extractDenseBlock4Params(64, 128, 'dense2');
var dense3 = extractDenseBlock4Params(128, 256, 'dense3'); var dense3 = extractDenseBlock4Params(128, 256, 'dense3');
var fc = extractFCParams(256, 136, 'fc');
if (getRemainingWeights().length !== 0) { if (getRemainingWeights().length !== 0) {
throw new Error("weights remaing after extract: " + getRemainingWeights().length); throw new Error("weights remaing after extract: " + getRemainingWeights().length);
} }
return { return {
paramMappings: paramMappings, paramMappings: paramMappings,
params: { dense0: dense0, dense1: dense1, dense2: dense2, dense3: dense3, fc: fc } params: { dense0: dense0, dense1: dense1, dense2: dense2, dense3: dense3 }
}; };
} }
exports.extractParams = extractParams; exports.extractParams = extractParams;
......
{"version":3,"file":"extractParams.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/extractParams.ts"],"names":[],"mappings":";;AAAA,2EAAkF;AAElF,yDAAwD;AAGxD,uBAA8B,OAAqB;IAEjD,IAAM,aAAa,GAAmB,EAAE,CAAA;IAElC,IAAA,iEAG4B,EAFhC,kCAAc,EACd,4CAAmB,CACa;IAGhC,IAAA,wHAAwB,CAC0B;IAEpD,IAAM,MAAM,GAAG,wBAAwB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC9D,IAAM,MAAM,GAAG,wBAAwB,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;IACzD,IAAM,MAAM,GAAG,wBAAwB,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;IAC1D,IAAM,MAAM,GAAG,wBAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;IAE3D,IAAI,mBAAmB,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,oCAAkC,mBAAmB,EAAE,CAAC,MAAQ,CAAC,CAAA;KAClF;IAED,OAAO;QACL,aAAa,eAAA;QACb,MAAM,EAAE,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE;KAC3C,CAAA;AACH,CAAC;AA1BD,sCA0BC"}
\ No newline at end of file
import * as tf from '@tensorflow/tfjs-core';
import { ParamMapping } from 'tfjs-image-recognition-base';
import { FaceFeatureExtractorParams } from './types';
export declare function extractParamsFromWeigthMap(weightMap: tf.NamedTensorMap): {
params: FaceFeatureExtractorParams;
paramMappings: ParamMapping[];
};
...@@ -4,13 +4,12 @@ var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base"); ...@@ -4,13 +4,12 @@ var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
var loadParamsFactory_1 = require("./loadParamsFactory"); var loadParamsFactory_1 = require("./loadParamsFactory");
function extractParamsFromWeigthMap(weightMap) { function extractParamsFromWeigthMap(weightMap) {
var paramMappings = []; var paramMappings = [];
var _a = loadParamsFactory_1.loadParamsFactory(weightMap, paramMappings), extractDenseBlock4Params = _a.extractDenseBlock4Params, extractFcParams = _a.extractFcParams; var extractDenseBlock4Params = loadParamsFactory_1.loadParamsFactory(weightMap, paramMappings).extractDenseBlock4Params;
var params = { var params = {
dense0: extractDenseBlock4Params('dense0', true), dense0: extractDenseBlock4Params('dense0', true),
dense1: extractDenseBlock4Params('dense1'), dense1: extractDenseBlock4Params('dense1'),
dense2: extractDenseBlock4Params('dense2'), dense2: extractDenseBlock4Params('dense2'),
dense3: extractDenseBlock4Params('dense3'), dense3: extractDenseBlock4Params('dense3')
fc: extractFcParams('fc')
}; };
tfjs_image_recognition_base_1.disposeUnusedWeightTensors(weightMap, paramMappings); tfjs_image_recognition_base_1.disposeUnusedWeightTensors(weightMap, paramMappings);
return { params: params, paramMappings: paramMappings }; return { params: params, paramMappings: paramMappings };
......
{"version":3,"file":"extractParamsFromWeigthMap.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/extractParamsFromWeigthMap.ts"],"names":[],"mappings":";;AACA,2EAAuF;AAEvF,yDAAwD;AAGxD,oCACE,SAA4B;IAG5B,IAAM,aAAa,GAAmB,EAAE,CAAA;IAGtC,IAAA,mHAAwB,CACqB;IAE/C,IAAM,MAAM,GAAG;QACb,MAAM,EAAE,wBAAwB,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChD,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC;QAC1C,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC;QAC1C,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC;KAC3C,CAAA;IAED,wDAA0B,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;IAEpD,OAAO,EAAE,MAAM,QAAA,EAAE,aAAa,eAAA,EAAE,CAAA;AAClC,CAAC;AApBD,gEAoBC"}
\ No newline at end of file
import * as tf from '@tensorflow/tfjs-core'; import * as tf from '@tensorflow/tfjs-core';
import { ParamMapping } from 'tfjs-image-recognition-base'; import { ParamMapping } from 'tfjs-image-recognition-base';
import { TinyNetParams } from './types'; import { TinyFaceFeatureExtractorParams } from './types';
export declare function extractParamsFromWeigthMapTiny(weightMap: tf.NamedTensorMap): { export declare function extractParamsFromWeigthMapTiny(weightMap: tf.NamedTensorMap): {
params: TinyNetParams; params: TinyFaceFeatureExtractorParams;
paramMappings: ParamMapping[]; paramMappings: ParamMapping[];
}; };
...@@ -4,12 +4,11 @@ var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base"); ...@@ -4,12 +4,11 @@ var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
var loadParamsFactory_1 = require("./loadParamsFactory"); var loadParamsFactory_1 = require("./loadParamsFactory");
function extractParamsFromWeigthMapTiny(weightMap) { function extractParamsFromWeigthMapTiny(weightMap) {
var paramMappings = []; var paramMappings = [];
var _a = loadParamsFactory_1.loadParamsFactory(weightMap, paramMappings), extractDenseBlock3Params = _a.extractDenseBlock3Params, extractFcParams = _a.extractFcParams; var extractDenseBlock3Params = loadParamsFactory_1.loadParamsFactory(weightMap, paramMappings).extractDenseBlock3Params;
var params = { var params = {
dense0: extractDenseBlock3Params('dense0', true), dense0: extractDenseBlock3Params('dense0', true),
dense1: extractDenseBlock3Params('dense1'), dense1: extractDenseBlock3Params('dense1'),
dense2: extractDenseBlock3Params('dense2'), dense2: extractDenseBlock3Params('dense2')
fc: extractFcParams('fc')
}; };
tfjs_image_recognition_base_1.disposeUnusedWeightTensors(weightMap, paramMappings); tfjs_image_recognition_base_1.disposeUnusedWeightTensors(weightMap, paramMappings);
return { params: params, paramMappings: paramMappings }; return { params: params, paramMappings: paramMappings };
......
{"version":3,"file":"extractParamsFromWeigthMapTiny.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/extractParamsFromWeigthMapTiny.ts"],"names":[],"mappings":";;AACA,2EAAuF;AAEvF,yDAAwD;AAGxD,wCACE,SAA4B;IAG5B,IAAM,aAAa,GAAmB,EAAE,CAAA;IAGtC,IAAA,mHAAwB,CACqB;IAE/C,IAAM,MAAM,GAAG;QACb,MAAM,EAAE,wBAAwB,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChD,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC;QAC1C,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC;KAC3C,CAAA;IAED,wDAA0B,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;IAEpD,OAAO,EAAE,MAAM,QAAA,EAAE,aAAa,eAAA,EAAE,CAAA;AAClC,CAAC;AAnBD,wEAmBC"}
\ No newline at end of file
import { ParamMapping } from 'tfjs-image-recognition-base'; import { ParamMapping } from 'tfjs-image-recognition-base';
import { TinyNetParams } from './types'; import { TinyFaceFeatureExtractorParams } from './types';
export declare function extractParamsTiny(weights: Float32Array): { export declare function extractParamsTiny(weights: Float32Array): {
params: TinyNetParams; params: TinyFaceFeatureExtractorParams;
paramMappings: ParamMapping[]; paramMappings: ParamMapping[];
}; };
...@@ -5,17 +5,16 @@ var extractorsFactory_1 = require("./extractorsFactory"); ...@@ -5,17 +5,16 @@ var extractorsFactory_1 = require("./extractorsFactory");
function extractParamsTiny(weights) { function extractParamsTiny(weights) {
var paramMappings = []; var paramMappings = [];
var _a = tfjs_image_recognition_base_1.extractWeightsFactory(weights), extractWeights = _a.extractWeights, getRemainingWeights = _a.getRemainingWeights; var _a = tfjs_image_recognition_base_1.extractWeightsFactory(weights), extractWeights = _a.extractWeights, getRemainingWeights = _a.getRemainingWeights;
var _b = extractorsFactory_1.extractorsFactory(extractWeights, paramMappings), extractDenseBlock3Params = _b.extractDenseBlock3Params, extractFCParams = _b.extractFCParams; var extractDenseBlock3Params = extractorsFactory_1.extractorsFactory(extractWeights, paramMappings).extractDenseBlock3Params;
var dense0 = extractDenseBlock3Params(3, 32, 'dense0', true); var dense0 = extractDenseBlock3Params(3, 32, 'dense0', true);
var dense1 = extractDenseBlock3Params(32, 64, 'dense1'); var dense1 = extractDenseBlock3Params(32, 64, 'dense1');
var dense2 = extractDenseBlock3Params(64, 128, 'dense2'); var dense2 = extractDenseBlock3Params(64, 128, 'dense2');
var fc = extractFCParams(128, 136, 'fc');
if (getRemainingWeights().length !== 0) { if (getRemainingWeights().length !== 0) {
throw new Error("weights remaing after extract: " + getRemainingWeights().length); throw new Error("weights remaing after extract: " + getRemainingWeights().length);
} }
return { return {
paramMappings: paramMappings, paramMappings: paramMappings,
params: { dense0: dense0, dense1: dense1, dense2: dense2, fc: fc } params: { dense0: dense0, dense1: dense1, dense2: dense2 }
}; };
} }
exports.extractParamsTiny = extractParamsTiny; exports.extractParamsTiny = extractParamsTiny;
......
{"version":3,"file":"extractParamsTiny.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/extractParamsTiny.ts"],"names":[],"mappings":";;AAAA,2EAAkF;AAElF,yDAAwD;AAGxD,2BAAkC,OAAqB;IAErD,IAAM,aAAa,GAAmB,EAAE,CAAA;IAElC,IAAA,iEAG4B,EAFhC,kCAAc,EACd,4CAAmB,CACa;IAGhC,IAAA,wHAAwB,CAC0B;IAEpD,IAAM,MAAM,GAAG,wBAAwB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC9D,IAAM,MAAM,GAAG,wBAAwB,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;IACzD,IAAM,MAAM,GAAG,wBAAwB,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;IAE1D,IAAI,mBAAmB,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,oCAAkC,mBAAmB,EAAE,CAAC,MAAQ,CAAC,CAAA;KAClF;IAED,OAAO;QACL,aAAa,eAAA;QACb,MAAM,EAAE,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE;KACnC,CAAA;AACH,CAAC;AAzBD,8CAyBC"}
\ No newline at end of file
import { ExtractWeightsFunction, ParamMapping } from 'tfjs-image-recognition-base'; import { ExtractWeightsFunction, ParamMapping } from 'tfjs-image-recognition-base';
import { FCParams } from 'tfjs-tiny-yolov2';
import { DenseBlock3Params, DenseBlock4Params } from './types'; import { DenseBlock3Params, DenseBlock4Params } from './types';
export declare function extractorsFactory(extractWeights: ExtractWeightsFunction, paramMappings: ParamMapping[]): { export declare function extractorsFactory(extractWeights: ExtractWeightsFunction, paramMappings: ParamMapping[]): {
extractDenseBlock3Params: (channelsIn: number, channelsOut: number, mappedPrefix: string, isFirstLayer?: boolean) => DenseBlock3Params; extractDenseBlock3Params: (channelsIn: number, channelsOut: number, mappedPrefix: string, isFirstLayer?: boolean) => DenseBlock3Params;
extractDenseBlock4Params: (channelsIn: number, channelsOut: number, mappedPrefix: string, isFirstLayer?: boolean) => DenseBlock4Params; extractDenseBlock4Params: (channelsIn: number, channelsOut: number, mappedPrefix: string, isFirstLayer?: boolean) => DenseBlock4Params;
extractFCParams: (channelsIn: number, channelsOut: number, mappedPrefix: string) => FCParams;
}; };
...@@ -10,15 +10,6 @@ function extractorsFactory(extractWeights, paramMappings) { ...@@ -10,15 +10,6 @@ function extractorsFactory(extractWeights, paramMappings) {
paramMappings.push({ paramPath: mappedPrefix + "/depthwise_filter" }, { paramPath: mappedPrefix + "/pointwise_filter" }, { paramPath: mappedPrefix + "/bias" }); paramMappings.push({ paramPath: mappedPrefix + "/depthwise_filter" }, { paramPath: mappedPrefix + "/pointwise_filter" }, { paramPath: mappedPrefix + "/bias" });
return new tfjs_tiny_yolov2_1.SeparableConvParams(depthwise_filter, pointwise_filter, bias); return new tfjs_tiny_yolov2_1.SeparableConvParams(depthwise_filter, pointwise_filter, bias);
} }
function extractFCParams(channelsIn, channelsOut, mappedPrefix) {
var weights = tf.tensor2d(extractWeights(channelsIn * channelsOut), [channelsIn, channelsOut]);
var bias = tf.tensor1d(extractWeights(channelsOut));
paramMappings.push({ paramPath: mappedPrefix + "/weights" }, { paramPath: mappedPrefix + "/bias" });
return {
weights: weights,
bias: bias
};
}
var extractConvParams = tfjs_tiny_yolov2_1.extractConvParamsFactory(extractWeights, paramMappings); var extractConvParams = tfjs_tiny_yolov2_1.extractConvParamsFactory(extractWeights, paramMappings);
function extractDenseBlock3Params(channelsIn, channelsOut, mappedPrefix, isFirstLayer) { function extractDenseBlock3Params(channelsIn, channelsOut, mappedPrefix, isFirstLayer) {
if (isFirstLayer === void 0) { isFirstLayer = false; } if (isFirstLayer === void 0) { isFirstLayer = false; }
...@@ -37,8 +28,7 @@ function extractorsFactory(extractWeights, paramMappings) { ...@@ -37,8 +28,7 @@ function extractorsFactory(extractWeights, paramMappings) {
} }
return { return {
extractDenseBlock3Params: extractDenseBlock3Params, extractDenseBlock3Params: extractDenseBlock3Params,
extractDenseBlock4Params: extractDenseBlock4Params, extractDenseBlock4Params: extractDenseBlock4Params
extractFCParams: extractFCParams
}; };
} }
exports.extractorsFactory = extractorsFactory; exports.extractorsFactory = extractorsFactory;
......
{"version":3,"file":"extractorsFactory.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/extractorsFactory.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAE5C,qDAA2F;AAI3F,2BAAkC,cAAsC,EAAE,aAA6B;IAErG,oCAAoC,UAAkB,EAAE,WAAmB,EAAE,YAAoB;QAC/F,IAAM,gBAAgB,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAA;QAC/F,IAAM,gBAAgB,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,UAAU,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAA;QAC/G,IAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAA;QAErD,aAAa,CAAC,IAAI,CAChB,EAAE,SAAS,EAAK,YAAY,sBAAmB,EAAE,EACjD,EAAE,SAAS,EAAK,YAAY,sBAAmB,EAAE,EACjD,EAAE,SAAS,EAAK,YAAY,UAAO,EAAE,CACtC,CAAA;QAED,OAAO,IAAI,sCAAmB,CAC5B,gBAAgB,EAChB,gBAAgB,EAChB,IAAI,CACL,CAAA;IACH,CAAC;IAED,IAAM,iBAAiB,GAAG,2CAAwB,CAAC,cAAc,EAAE,aAAa,CAAC,CAAA;IAEjF,kCAAkC,UAAkB,EAAE,WAAmB,EAAE,YAAoB,EAAE,YAA6B;QAA7B,6BAAA,EAAA,oBAA6B;QAE5H,IAAM,KAAK,GAAG,YAAY;YACxB,CAAC,CAAC,iBAAiB,CAAC,UAAU,EAAE,WAAW,EAAE,CAAC,EAAK,YAAY,WAAQ,CAAC;YACxE,CAAC,CAAC,0BAA0B,CAAC,UAAU,EAAE,WAAW,EAAK,YAAY,WAAQ,CAAC,CAAA;QAChF,IAAM,KAAK,GAAG,0BAA0B,CAAC,WAAW,EAAE,WAAW,EAAK,YAAY,WAAQ,CAAC,CAAA;QAC3F,IAAM,KAAK,GAAG,0BAA0B,CAAC,WAAW,EAAE,WAAW,EAAK,YAAY,WAAQ,CAAC,CAAA;QAE3F,OAAO,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,CAAA;IAChC,CAAC;IAED,kCAAkC,UAAkB,EAAE,WAAmB,EAAE,YAAoB,EAAE,YAA6B;QAA7B,6BAAA,EAAA,oBAA6B;QAEtH,IAAA,kFAAuG,EAArG,gBAAK,EAAE,gBAAK,EAAE,gBAAK,CAAkF;QAC7G,IAAM,KAAK,GAAG,0BAA0B,CAAC,WAAW,EAAE,WAAW,EAAK,YAAY,WAAQ,CAAC,CAAA;QAE3F,OAAO,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,CAAA;IACvC,CAAC;IAED,OAAO;QACL,wBAAwB,0BAAA;QACxB,wBAAwB,0BAAA;KACzB,CAAA;AAEH,CAAC;AA9CD,8CA8CC"}
\ No newline at end of file
export * from './FaceFeatureExtractor';
export * from './TinyFaceFeatureExtractor';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./FaceFeatureExtractor"), exports);
tslib_1.__exportStar(require("./TinyFaceFeatureExtractor"), exports);
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC;AACvC,qEAA2C"}
\ No newline at end of file
import { ParamMapping } from 'tfjs-image-recognition-base'; import { ParamMapping } from 'tfjs-image-recognition-base';
import { FCParams } from 'tfjs-tiny-yolov2';
import { DenseBlock3Params, DenseBlock4Params } from './types'; import { DenseBlock3Params, DenseBlock4Params } from './types';
export declare function loadParamsFactory(weightMap: any, paramMappings: ParamMapping[]): { export declare function loadParamsFactory(weightMap: any, paramMappings: ParamMapping[]): {
extractDenseBlock3Params: (prefix: string, isFirstLayer?: boolean) => DenseBlock3Params; extractDenseBlock3Params: (prefix: string, isFirstLayer?: boolean) => DenseBlock3Params;
extractDenseBlock4Params: (prefix: string, isFirstLayer?: boolean) => DenseBlock4Params; extractDenseBlock4Params: (prefix: string, isFirstLayer?: boolean) => DenseBlock4Params;
extractFcParams: (prefix: string) => FCParams;
}; };
...@@ -34,15 +34,9 @@ function loadParamsFactory(weightMap, paramMappings) { ...@@ -34,15 +34,9 @@ function loadParamsFactory(weightMap, paramMappings) {
var conv3 = extractSeparableConvParams(prefix + "/conv3"); var conv3 = extractSeparableConvParams(prefix + "/conv3");
return { conv0: conv0, conv1: conv1, conv2: conv2, conv3: conv3 }; return { conv0: conv0, conv1: conv1, conv2: conv2, conv3: conv3 };
} }
function extractFcParams(prefix) {
var weights = extractWeightEntry(prefix + "/weights", 2);
var bias = extractWeightEntry(prefix + "/bias", 1);
return { weights: weights, bias: bias };
}
return { return {
extractDenseBlock3Params: extractDenseBlock3Params, extractDenseBlock3Params: extractDenseBlock3Params,
extractDenseBlock4Params: extractDenseBlock4Params, extractDenseBlock4Params: extractDenseBlock4Params
extractFcParams: extractFcParams
}; };
} }
exports.loadParamsFactory = loadParamsFactory; exports.loadParamsFactory = loadParamsFactory;
......
{"version":3,"file":"loadParamsFactory.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/loadParamsFactory.ts"],"names":[],"mappings":";;AACA,2EAAsF;AACtF,qDAAmE;AAInE,2BAA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CAAI,MAAM,WAAQ,CAAC;YACtC,CAAC,CAAC,0BAA0B,CAAI,MAAM,WAAQ,CAAC,CAAA;QACjD,IAAM,KAAK,GAAG,0BAA0B,CAAI,MAAM,WAAQ,CAAC,CAAA;QAC3D,IAAM,KAAK,GAAG,0BAA0B,CAAI,MAAM,WAAQ,CAAC,CAAA;QAC3D,IAAM,KAAK,GAAG,0BAA0B,CAAI,MAAM,WAAQ,CAAC,CAAA;QAE3D,OAAO,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,CAAA;IACvC,CAAC;IAED,OAAO;QACL,wBAAwB,0BAAA;QACxB,wBAAwB,0BAAA;KACzB,CAAA;AACH,CAAC;AAhDD,8CAgDC"}
\ No newline at end of file
import * as tf from '@tensorflow/tfjs-core'; import * as tf from '@tensorflow/tfjs-core';
import { ConvParams, FCParams, SeparableConvParams } from 'tfjs-tiny-yolov2'; import { NetInput, NeuralNetwork, TNetInput } from 'tfjs-image-recognition-base';
import { ConvParams, SeparableConvParams } from 'tfjs-tiny-yolov2';
export declare type ConvWithBatchNormParams = BatchNormParams & { export declare type ConvWithBatchNormParams = BatchNormParams & {
filter: tf.Tensor4D; filter: tf.Tensor4D;
}; };
...@@ -13,9 +14,6 @@ export declare type SeparableConvWithBatchNormParams = { ...@@ -13,9 +14,6 @@ export declare type SeparableConvWithBatchNormParams = {
depthwise: ConvWithBatchNormParams; depthwise: ConvWithBatchNormParams;
pointwise: ConvWithBatchNormParams; pointwise: ConvWithBatchNormParams;
}; };
export declare type FCWithBatchNormParams = BatchNormParams & {
weights: tf.Tensor2D;
};
export declare type DenseBlock3Params = { export declare type DenseBlock3Params = {
conv0: SeparableConvParams | ConvParams; conv0: SeparableConvParams | ConvParams;
conv1: SeparableConvParams; conv1: SeparableConvParams;
...@@ -24,16 +22,18 @@ export declare type DenseBlock3Params = { ...@@ -24,16 +22,18 @@ export declare type DenseBlock3Params = {
export declare type DenseBlock4Params = DenseBlock3Params & { export declare type DenseBlock4Params = DenseBlock3Params & {
conv3: SeparableConvParams; conv3: SeparableConvParams;
}; };
export declare type TinyNetParams = { export declare type TinyFaceFeatureExtractorParams = {
dense0: DenseBlock3Params; dense0: DenseBlock3Params;
dense1: DenseBlock3Params; dense1: DenseBlock3Params;
dense2: DenseBlock3Params; dense2: DenseBlock3Params;
fc: FCParams;
}; };
export declare type NetParams = { export declare type FaceFeatureExtractorParams = {
dense0: DenseBlock4Params; dense0: DenseBlock4Params;
dense1: DenseBlock4Params; dense1: DenseBlock4Params;
dense2: DenseBlock4Params; dense2: DenseBlock4Params;
dense3: DenseBlock4Params; dense3: DenseBlock4Params;
fc: FCParams;
}; };
export interface IFaceFeatureExtractor<TNetParams extends TinyFaceFeatureExtractorParams | FaceFeatureExtractorParams> extends NeuralNetwork<TNetParams> {
forwardInput(input: NetInput): tf.Tensor4D;
forward(input: TNetInput): Promise<tf.Tensor4D>;
}
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/faceFeatureExtractor/types.ts"],"names":[],"mappings":""}
\ No newline at end of file
import * as tf from '@tensorflow/tfjs-core'; import { FaceFeatureExtractor } from '../faceFeatureExtractor/FaceFeatureExtractor';
import { NetInput } from 'tfjs-image-recognition-base'; import { FaceFeatureExtractorParams } from '../faceFeatureExtractor/types';
import { FaceLandmark68NetBase } from './FaceLandmark68NetBase'; import { FaceLandmark68NetBase } from './FaceLandmark68NetBase';
import { NetParams } from './types'; export declare class FaceLandmark68Net extends FaceLandmark68NetBase<FaceFeatureExtractorParams> {
export declare class FaceLandmark68Net extends FaceLandmark68NetBase<NetParams> { constructor(faceFeatureExtractor?: FaceFeatureExtractor);
constructor();
runNet(input: NetInput): tf.Tensor2D;
protected getDefaultModelName(): string; protected getDefaultModelName(): string;
protected extractParamsFromWeigthMap(weightMap: tf.NamedTensorMap): { protected getClassifierChannelsIn(): number;
params: NetParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
protected extractParams(weights: Float32Array): {
params: NetParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
} }
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib"); var tslib_1 = require("tslib");
var tf = require("@tensorflow/tfjs-core"); var FaceFeatureExtractor_1 = require("../faceFeatureExtractor/FaceFeatureExtractor");
var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
var depthwiseSeparableConv_1 = require("./depthwiseSeparableConv");
var extractParams_1 = require("./extractParams");
var extractParamsFromWeigthMap_1 = require("./extractParamsFromWeigthMap");
var FaceLandmark68NetBase_1 = require("./FaceLandmark68NetBase"); var FaceLandmark68NetBase_1 = require("./FaceLandmark68NetBase");
var fullyConnectedLayer_1 = require("./fullyConnectedLayer");
function denseBlock(x, denseBlockParams, isFirstLayer) {
if (isFirstLayer === void 0) { isFirstLayer = false; }
return tf.tidy(function () {
var out1 = tf.relu(isFirstLayer
? tf.add(tf.conv2d(x, denseBlockParams.conv0.filters, [2, 2], 'same'), denseBlockParams.conv0.bias)
: depthwiseSeparableConv_1.depthwiseSeparableConv(x, denseBlockParams.conv0, [2, 2]));
var out2 = depthwiseSeparableConv_1.depthwiseSeparableConv(out1, denseBlockParams.conv1, [1, 1]);
var in3 = tf.relu(tf.add(out1, out2));
var out3 = depthwiseSeparableConv_1.depthwiseSeparableConv(in3, denseBlockParams.conv2, [1, 1]);
var in4 = tf.relu(tf.add(out1, tf.add(out2, out3)));
var out4 = depthwiseSeparableConv_1.depthwiseSeparableConv(in4, denseBlockParams.conv3, [1, 1]);
return tf.relu(tf.add(out1, tf.add(out2, tf.add(out3, out4))));
});
}
var FaceLandmark68Net = /** @class */ (function (_super) { var FaceLandmark68Net = /** @class */ (function (_super) {
tslib_1.__extends(FaceLandmark68Net, _super); tslib_1.__extends(FaceLandmark68Net, _super);
function FaceLandmark68Net() { function FaceLandmark68Net(faceFeatureExtractor) {
return _super.call(this, 'FaceLandmark68Net') || this; if (faceFeatureExtractor === void 0) { faceFeatureExtractor = new FaceFeatureExtractor_1.FaceFeatureExtractor(); }
return _super.call(this, 'FaceLandmark68Net', faceFeatureExtractor) || this;
} }
FaceLandmark68Net.prototype.runNet = function (input) {
var params = this.params;
if (!params) {
throw new Error('FaceLandmark68Net - load model before inference');
}
return tf.tidy(function () {
var batchTensor = input.toBatchTensor(112, true);
var meanRgb = [122.782, 117.001, 104.298];
var normalized = tfjs_image_recognition_base_1.normalize(batchTensor, meanRgb).div(tf.scalar(255));
var out = denseBlock(normalized, params.dense0, true);
out = denseBlock(out, params.dense1);
out = denseBlock(out, params.dense2);
out = denseBlock(out, params.dense3);
out = tf.avgPool(out, [7, 7], [2, 2], 'valid');
return fullyConnectedLayer_1.fullyConnectedLayer(out.as2D(out.shape[0], -1), params.fc);
});
};
FaceLandmark68Net.prototype.getDefaultModelName = function () { FaceLandmark68Net.prototype.getDefaultModelName = function () {
return 'face_landmark_68_model'; return 'face_landmark_68_model';
}; };
FaceLandmark68Net.prototype.extractParamsFromWeigthMap = function (weightMap) { FaceLandmark68Net.prototype.getClassifierChannelsIn = function () {
return extractParamsFromWeigthMap_1.extractParamsFromWeigthMap(weightMap); return 256;
};
FaceLandmark68Net.prototype.extractParams = function (weights) {
return extractParams_1.extractParams(weights);
}; };
return FaceLandmark68Net; return FaceLandmark68Net;
}(FaceLandmark68NetBase_1.FaceLandmark68NetBase)); }(FaceLandmark68NetBase_1.FaceLandmark68NetBase));
......
{"version":3,"file":"FaceLandmark68Net.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/FaceLandmark68Net.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAC5C,2EAAkE;AAGlE,mEAAkE;AAClE,iDAAgD;AAChD,2EAA0E;AAC1E,iEAAgE;AAChE,6DAA4D;AAG5D,oBACE,CAAc,EACd,gBAAmC,EACnC,YAA6B;IAA7B,6BAAA,EAAA,oBAA6B;IAE7B,OAAO,EAAE,CAAC,IA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ApC,UAAqC,SAA4B;QAC/D,OAAO,uDAA0B,CAAC,SAAS,CAAC,CAAA;IAC9C,CAAC;IAES,yCAAa,GAAvB,UAAwB,OAAqB;QAC3C,OAAO,6BAAa,CAAC,OAAO,CAAC,CAAA;IAC/B,CAAC;IACH,wBAAC;AAAD,CAAC,AAxCD,CAAuC,6CAAqB,GAwC3D;AAxCY,8CAAiB"} {"version":3,"file":"FaceLandmark68Net.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/FaceLandmark68Net.ts"],"names":[],"mappings":";;;AAAA,qFAAoF;AAEpF,iEAAgE;AAEhE;IAAuC,6CAAiD;IAEtF,2BAAY,oBAAuE;QAAvE,qCAAA,EAAA,2BAAiD,2CAAoB,EAAE;eACjF,kBAAM,mBAAmB,EAAE,oBAAoB,CAAC;IAClD,CAAC;IAES,+CAAmB,GAA7B;QACE,OAAO,wBAAwB,CAAA;IACjC,CAAC;IAES,mDAAuB,GAAjC;QACE,OAAO,GAAG,CAAA;IACZ,CAAC;IACH,wBAAC;AAAD,CAAC,AAbD,CAAuC,6CAAqB,GAa3D;AAbY,8CAAiB"}
\ No newline at end of file \ No newline at end of file
import * as tf from '@tensorflow/tfjs-core'; import * as tf from '@tensorflow/tfjs-core';
import { IDimensions, NetInput, NeuralNetwork, TNetInput } from 'tfjs-image-recognition-base'; import { IDimensions, NetInput, TNetInput } from 'tfjs-image-recognition-base';
import { FaceLandmarks68 } from '../classes/FaceLandmarks68'; import { FaceLandmarks68 } from '../classes/FaceLandmarks68';
export declare abstract class FaceLandmark68NetBase<NetParams> extends NeuralNetwork<NetParams> { import { FaceFeatureExtractorParams, TinyFaceFeatureExtractorParams } from '../faceFeatureExtractor/types';
private __name; import { FaceProcessor } from '../faceProcessor/FaceProcessor';
constructor(_name: string); export declare abstract class FaceLandmark68NetBase<TExtractorParams extends FaceFeatureExtractorParams | TinyFaceFeatureExtractorParams> extends FaceProcessor<TExtractorParams> {
abstract runNet(netInput: NetInput): tf.Tensor2D;
postProcess(output: tf.Tensor2D, inputSize: number, originalDimensions: IDimensions[]): tf.Tensor2D; postProcess(output: tf.Tensor2D, inputSize: number, originalDimensions: IDimensions[]): tf.Tensor2D;
forwardInput(input: NetInput): tf.Tensor2D; forwardInput(input: NetInput): tf.Tensor2D;
forward(input: TNetInput): Promise<tf.Tensor2D>; forward(input: TNetInput): Promise<tf.Tensor2D>;
detectLandmarks(input: TNetInput): Promise<FaceLandmarks68 | FaceLandmarks68[]>; detectLandmarks(input: TNetInput): Promise<FaceLandmarks68 | FaceLandmarks68[]>;
protected getClassifierChannelsOut(): number;
} }
...@@ -4,12 +4,11 @@ var tslib_1 = require("tslib"); ...@@ -4,12 +4,11 @@ var tslib_1 = require("tslib");
var tf = require("@tensorflow/tfjs-core"); var tf = require("@tensorflow/tfjs-core");
var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base"); var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
var FaceLandmarks68_1 = require("../classes/FaceLandmarks68"); var FaceLandmarks68_1 = require("../classes/FaceLandmarks68");
var FaceProcessor_1 = require("../faceProcessor/FaceProcessor");
var FaceLandmark68NetBase = /** @class */ (function (_super) { var FaceLandmark68NetBase = /** @class */ (function (_super) {
tslib_1.__extends(FaceLandmark68NetBase, _super); tslib_1.__extends(FaceLandmark68NetBase, _super);
function FaceLandmark68NetBase(_name) { function FaceLandmark68NetBase() {
var _this = _super.call(this, _name) || this; return _super !== null && _super.apply(this, arguments) || this;
_this.__name = _name;
return _this;
} }
FaceLandmark68NetBase.prototype.postProcess = function (output, inputSize, originalDimensions) { FaceLandmark68NetBase.prototype.postProcess = function (output, inputSize, originalDimensions) {
var inputDimensions = originalDimensions.map(function (_a) { var inputDimensions = originalDimensions.map(function (_a) {
...@@ -106,7 +105,10 @@ var FaceLandmark68NetBase = /** @class */ (function (_super) { ...@@ -106,7 +105,10 @@ var FaceLandmark68NetBase = /** @class */ (function (_super) {
}); });
}); });
}; };
FaceLandmark68NetBase.prototype.getClassifierChannelsOut = function () {
return 136;
};
return FaceLandmark68NetBase; return FaceLandmark68NetBase;
}(tfjs_image_recognition_base_1.NeuralNetwork)); }(FaceProcessor_1.FaceProcessor));
exports.FaceLandmark68NetBase = FaceLandmark68NetBase; exports.FaceLandmark68NetBase = FaceLandmark68NetBase;
//# sourceMappingURL=FaceLandmark68NetBase.js.map //# sourceMappingURL=FaceLandmark68NetBase.js.map
\ No newline at end of file
{"version":3,"file":"FaceLandmark68NetBase.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/FaceLandmark68NetBase.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAC5C,2EAAyH;AAEzH,8DAA6D;AAE7D;IAA+D,iDAAwB;IAKrF,+BAAY,KAAa;QAAzB,YACE,kBAAM,KAAK,CAAC,SAEb;QADC,KAAI,CAAC,MAAM,GAAG,KAAK,CAAA;;IACrB,CAAC;IAIM,2CAAW,GAAlB,UAAmB,MAAmB,EAAE,SAAiB,EAAE,kBAAiC;QAE1F,IAAM,eAAe,GAAG,kBAAkB,CAAC,GAAG,CAAC,UAAC,EAAiB;gBAAf,gBAAK,EAAE,kBAAM;YAC7D,IAAM,KAAK,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;YACjD,OAAO;gBACL,KAAK,EAAE,KAAK,GAAG,KAAK;gBACpB,MAAM,EAAE,MAAM,GAAG,KAAK;aACvB,CAAA;QACH,CAAC,CAAC,CAAA;QAEF,IAAM,SAAS,GAAG,eAAe,CAAC,MAAM,CAAA;QAExC,OAAO,EAAE,CAAC,IAAI,CAAC;YACb,IAAM,uBAAuB,GAAG,UAAC,KAAa,EAAE,KAAa;gBAC3D,OAAA,EAAE,CAAC,KAAK,CAAC;oBACP,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC;oBACpB,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC;iBACrB,EAAE,CAAC,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AAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAjC,CAAiC,CAAC,EAClE;oDACE,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC;oDACzC,KAAK,EAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;iDACzC,CACF,EAAA;;;iCACF,CACF,CAAC,EAAA;;wBAdI,iBAAiB,GAAG,SAcxB;wBAEF,eAAe,CAAC,OAAO,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,OAAO,EAAE,EAAX,CAAW,CAAC,CAAA;wBAEzC,sBAAO,QAAQ,CAAC,YAAY;gCAC1B,CAAC,CAAC,iBAAiB;gCACnB,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAA;;;;KACzB;IAES,wDAAwB,GAAlC;QACE,OAAO,GAAG,CAAA;IACZ,CAAC;IACH,4BAAC;AAAD,CAAC,AAjGD,CAGU,6BAAa,GA8FtB;AAjGqB,sDAAqB"}
\ No newline at end of file \ No newline at end of file
import * as tf from '@tensorflow/tfjs-core'; import { TinyFaceFeatureExtractorParams } from 'src/faceFeatureExtractor/types';
import { NetInput } from 'tfjs-image-recognition-base'; import { TinyFaceFeatureExtractor } from '../faceFeatureExtractor/TinyFaceFeatureExtractor';
import { FaceLandmark68NetBase } from './FaceLandmark68NetBase'; import { FaceLandmark68NetBase } from './FaceLandmark68NetBase';
import { TinyNetParams } from './types'; export declare class FaceLandmark68TinyNet extends FaceLandmark68NetBase<TinyFaceFeatureExtractorParams> {
export declare class FaceLandmark68TinyNet extends FaceLandmark68NetBase<TinyNetParams> { constructor(faceFeatureExtractor?: TinyFaceFeatureExtractor);
constructor();
runNet(input: NetInput): tf.Tensor2D;
protected getDefaultModelName(): string; protected getDefaultModelName(): string;
protected extractParamsFromWeigthMap(weightMap: tf.NamedTensorMap): { protected getClassifierChannelsIn(): number;
params: TinyNetParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
protected extractParams(weights: Float32Array): {
params: TinyNetParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
} }
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib"); var tslib_1 = require("tslib");
var tf = require("@tensorflow/tfjs-core"); var TinyFaceFeatureExtractor_1 = require("../faceFeatureExtractor/TinyFaceFeatureExtractor");
var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
var depthwiseSeparableConv_1 = require("./depthwiseSeparableConv");
var extractParamsTiny_1 = require("./extractParamsTiny");
var FaceLandmark68NetBase_1 = require("./FaceLandmark68NetBase"); var FaceLandmark68NetBase_1 = require("./FaceLandmark68NetBase");
var fullyConnectedLayer_1 = require("./fullyConnectedLayer");
var extractParamsFromWeigthMapTiny_1 = require("./extractParamsFromWeigthMapTiny");
function denseBlock(x, denseBlockParams, isFirstLayer) {
if (isFirstLayer === void 0) { isFirstLayer = false; }
return tf.tidy(function () {
var out1 = tf.relu(isFirstLayer
? tf.add(tf.conv2d(x, denseBlockParams.conv0.filters, [2, 2], 'same'), denseBlockParams.conv0.bias)
: depthwiseSeparableConv_1.depthwiseSeparableConv(x, denseBlockParams.conv0, [2, 2]));
var out2 = depthwiseSeparableConv_1.depthwiseSeparableConv(out1, denseBlockParams.conv1, [1, 1]);
var in3 = tf.relu(tf.add(out1, out2));
var out3 = depthwiseSeparableConv_1.depthwiseSeparableConv(in3, denseBlockParams.conv2, [1, 1]);
return tf.relu(tf.add(out1, tf.add(out2, out3)));
});
}
var FaceLandmark68TinyNet = /** @class */ (function (_super) { var FaceLandmark68TinyNet = /** @class */ (function (_super) {
tslib_1.__extends(FaceLandmark68TinyNet, _super); tslib_1.__extends(FaceLandmark68TinyNet, _super);
function FaceLandmark68TinyNet() { function FaceLandmark68TinyNet(faceFeatureExtractor) {
return _super.call(this, 'FaceLandmark68TinyNet') || this; if (faceFeatureExtractor === void 0) { faceFeatureExtractor = new TinyFaceFeatureExtractor_1.TinyFaceFeatureExtractor(); }
return _super.call(this, 'FaceLandmark68TinyNet', faceFeatureExtractor) || this;
} }
FaceLandmark68TinyNet.prototype.runNet = function (input) {
var params = this.params;
if (!params) {
throw new Error('FaceLandmark68TinyNet - load model before inference');
}
return tf.tidy(function () {
var batchTensor = input.toBatchTensor(112, true);
var meanRgb = [122.782, 117.001, 104.298];
var normalized = tfjs_image_recognition_base_1.normalize(batchTensor, meanRgb).div(tf.scalar(255));
var out = denseBlock(normalized, params.dense0, true);
out = denseBlock(out, params.dense1);
out = denseBlock(out, params.dense2);
out = tf.avgPool(out, [14, 14], [2, 2], 'valid');
return fullyConnectedLayer_1.fullyConnectedLayer(out.as2D(out.shape[0], -1), params.fc);
});
};
FaceLandmark68TinyNet.prototype.getDefaultModelName = function () { FaceLandmark68TinyNet.prototype.getDefaultModelName = function () {
return 'face_landmark_68_tiny_model'; return 'face_landmark_68_tiny_model';
}; };
FaceLandmark68TinyNet.prototype.extractParamsFromWeigthMap = function (weightMap) { FaceLandmark68TinyNet.prototype.getClassifierChannelsIn = function () {
return extractParamsFromWeigthMapTiny_1.extractParamsFromWeigthMapTiny(weightMap); return 128;
};
FaceLandmark68TinyNet.prototype.extractParams = function (weights) {
return extractParamsTiny_1.extractParamsTiny(weights);
}; };
return FaceLandmark68TinyNet; return FaceLandmark68TinyNet;
}(FaceLandmark68NetBase_1.FaceLandmark68NetBase)); }(FaceLandmark68NetBase_1.FaceLandmark68NetBase));
......
{"version":3,"file":"FaceLandmark68TinyNet.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/FaceLandmark68TinyNet.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAC5C,2EAAkE;AAGlE,mEAAkE;AAClE,yDAAwD;AACxD,iEAAgE;AAChE,6DAA4D;AAC5D,mFAAkF;AAGlF,oBACE,CAAc,EACd,gBAAmC,EACnC,YAA6B;IAA7B,6BAAA,EAAA,oBAA6B;IAE7B,OAAO,EAAE,CAAC,IAAI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AAqD;IAE9F,+BAAY,oBAA+E;QAA/E,qCAAA,EAAA,2BAAqD,mDAAwB,EAAE;eACzF,kBAAM,uBAAuB,EAAE,oBAAoB,CAAC;IACtD,CAAC;IAES,mDAAmB,GAA7B;QACE,OAAO,6BAA6B,CAAA;IACtC,CAAC;IAES,uDAAuB,GAAjC;QACE,OAAO,GAAG,CAAA;IACZ,CAAC;IACH,4BAAC;AAAD,CAAC,AAbD,CAA2C,6CAAqB,GAa/D;AAbY,sDAAqB"}
\ No newline at end of file \ No newline at end of file
{"version":3,"file":"depthwiseSeparableConv.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/depthwiseSeparableConv.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAG5C,gCACE,CAAc,EACd,MAA2B,EAC3B,MAAwB;IAExB,OAAO,EAAE,CAAC,IAAI,CAAC;QACb,IAAI,GAAG,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;QACjG,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;QAC9B,OAAO,GAAG,CAAA;IACZ,CAAC,CAAC,CAAA;AACJ,CAAC;AAVD,wDAUC"}
\ No newline at end of file
{"version":3,"file":"extractParams.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/extractParams.ts"],"names":[],"mappings":";;AAAA,2EAAkF;AAElF,yDAAwD;AAGxD,uBAA8B,OAAqB;IAEjD,IAAM,aAAa,GAAmB,EAAE,CAAA;IAElC,IAAA,iEAG4B,EAFhC,kCAAc,EACd,4CAAmB,CACa;IAE5B,IAAA,yEAG8C,EAFlD,sDAAwB,EACxB,oCAAe,CACmC;IAEpD,IAAM,MAAM,GAAG,wBAAwB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC9D,IAAM,MAAM,GAAG,wBAAwB,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;IACzD,IAAM,MAAM,GAAG,wBAAwB,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;IAC1D,IAAM,MAAM,GAAG,wBAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;IAC3D,IAAM,EAAE,GAAG,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAE1C,IAAI,mBAAmB,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,oCAAkC,mBAAmB,EAAE,CAAC,MAAQ,CAAC,CAAA;KAClF;IAED,OAAO;QACL,aAAa,eAAA;QACb,MAAM,EAAE,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,EAAE,IAAA,EAAE;KAC/C,CAAA;AACH,CAAC;AA5BD,sCA4BC"}
\ No newline at end of file
{"version":3,"file":"extractParamsFromWeigthMap.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/extractParamsFromWeigthMap.ts"],"names":[],"mappings":";;AACA,2EAAuF;AAEvF,yDAAwD;AAGxD,oCACE,SAA4B;IAG5B,IAAM,aAAa,GAAmB,EAAE,CAAA;IAElC,IAAA,oEAGyC,EAF7C,sDAAwB,EACxB,oCAAe,CAC8B;IAE/C,IAAM,MAAM,GAAG;QACb,MAAM,EAAE,wBAAwB,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChD,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC;QAC1C,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC;QAC1C,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC;QAC1C,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC;KAC1B,CAAA;IAED,wDAA0B,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;IAEpD,OAAO,EAAE,MAAM,QAAA,EAAE,aAAa,eAAA,EAAE,CAAA;AAClC,CAAC;AAtBD,gEAsBC"}
\ No newline at end of file
{"version":3,"file":"extractParamsFromWeigthMapTiny.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/extractParamsFromWeigthMapTiny.ts"],"names":[],"mappings":";;AACA,2EAAuF;AAEvF,yDAAwD;AAGxD,wCACE,SAA4B;IAG5B,IAAM,aAAa,GAAmB,EAAE,CAAA;IAElC,IAAA,oEAGyC,EAF7C,sDAAwB,EACxB,oCAAe,CAC8B;IAE/C,IAAM,MAAM,GAAG;QACb,MAAM,EAAE,wBAAwB,CAAC,QAAQ,EAAE,IAAI,CAAC;QAChD,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC;QAC1C,MAAM,EAAE,wBAAwB,CAAC,QAAQ,CAAC;QAC1C,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC;KAC1B,CAAA;IAED,wDAA0B,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;IAEpD,OAAO,EAAE,MAAM,QAAA,EAAE,aAAa,eAAA,EAAE,CAAA;AAClC,CAAC;AArBD,wEAqBC"}
\ No newline at end of file
{"version":3,"file":"extractParamsTiny.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/extractParamsTiny.ts"],"names":[],"mappings":";;AAAA,2EAAkF;AAElF,yDAAwD;AAGxD,2BAAkC,OAAqB;IAErD,IAAM,aAAa,GAAmB,EAAE,CAAA;IAElC,IAAA,iEAG4B,EAFhC,kCAAc,EACd,4CAAmB,CACa;IAE5B,IAAA,yEAG8C,EAFlD,sDAAwB,EACxB,oCAAe,CACmC;IAEpD,IAAM,MAAM,GAAG,wBAAwB,CAAC,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC9D,IAAM,MAAM,GAAG,wBAAwB,CAAC,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAA;IACzD,IAAM,MAAM,GAAG,wBAAwB,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;IAC1D,IAAM,EAAE,GAAG,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IAE1C,IAAI,mBAAmB,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,oCAAkC,mBAAmB,EAAE,CAAC,MAAQ,CAAC,CAAA;KAClF;IAED,OAAO;QACL,aAAa,eAAA;QACb,MAAM,EAAE,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,MAAM,QAAA,EAAE,EAAE,IAAA,EAAE;KACvC,CAAA;AACH,CAAC;AA3BD,8CA2BC"}
\ No newline at end of file
{"version":3,"file":"extractorsFactory.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/extractorsFactory.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAE5C,qDAA2F;AAI3F,2BAAkC,cAAsC,EAAE,aAA6B;IAErG,oCAAoC,UAAkB,EAAE,WAAmB,EAAE,YAAoB;QAC/F,IAAM,gBAAgB,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAA;QAC/F,IAAM,gBAAgB,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,UAAU,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAA;QAC/G,IAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAA;QAErD,aAAa,CAAC,IAAI,CAChB,EAAE,SAAS,EAAK,YAAY,sBAAmB,EAAE,EACjD,EAAE,SAAS,EAAK,YAAY,sBAAmB,EAAE,EACjD,EAAE,SAAS,EAAK,YAAY,UAAO,EAAE,CACtC,CAAA;QAED,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B,6BAAA,EAAA,oBAA6B;QAEtH,IAAA,kFAAuG,EAArG,gBAAK,EAAE,gBAAK,EAAE,gBAAK,CAAkF;QAC7G,IAAM,KAAK,GAAG,0BAA0B,CAAC,WAAW,EAAE,WAAW,EAAK,YAAY,WAAQ,CAAC,CAAA;QAE3F,OAAO,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,CAAA;IACvC,CAAC;IAED,OAAO;QACL,wBAAwB,0BAAA;QACxB,wBAAwB,0BAAA;QACxB,eAAe,iBAAA;KAChB,CAAA;AAEH,CAAC;AA9DD,8CA8DC"}
\ No newline at end of file
{"version":3,"file":"fullyConnectedLayer.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/fullyConnectedLayer.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAG5C,6BACE,CAAc,EACd,MAAgB;IAEhB,OAAO,EAAE,CAAC,IAAI,CAAC;QACb,OAAA,EAAE,CAAC,GAAG,CACJ,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,EAC5B,MAAM,CAAC,IAAI,CACZ;IAHD,CAGC,CACF,CAAA;AACH,CAAC;AAVD,kDAUC"}
\ No newline at end of file
...@@ -3,4 +3,3 @@ export * from './FaceLandmark68Net'; ...@@ -3,4 +3,3 @@ export * from './FaceLandmark68Net';
export * from './FaceLandmark68TinyNet'; export * from './FaceLandmark68TinyNet';
export declare class FaceLandmarkNet extends FaceLandmark68Net { export declare class FaceLandmarkNet extends FaceLandmark68Net {
} }
export declare function createFaceLandmarkNet(weights: Float32Array): FaceLandmarkNet;
...@@ -12,10 +12,4 @@ var FaceLandmarkNet = /** @class */ (function (_super) { ...@@ -12,10 +12,4 @@ var FaceLandmarkNet = /** @class */ (function (_super) {
return FaceLandmarkNet; return FaceLandmarkNet;
}(FaceLandmark68Net_1.FaceLandmark68Net)); }(FaceLandmark68Net_1.FaceLandmark68Net));
exports.FaceLandmarkNet = FaceLandmarkNet; exports.FaceLandmarkNet = FaceLandmarkNet;
function createFaceLandmarkNet(weights) {
var net = new FaceLandmarkNet();
net.extractWeights(weights);
return net;
}
exports.createFaceLandmarkNet = createFaceLandmarkNet;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/index.ts"],"names":[],"mappings":";;;AAAA,yDAAwD;AAExD,8DAAoC;AACpC,kEAAwC;AAExC;IAAqC,2CAAiB;IAAtD;;IAAwD,CAAC;IAAD,sBAAC;AAAD,CAAC,AAAzD,CAAqC,qCAAiB,GAAG;AAA5C,0CAAe;AAE5B,+BAAsC,OAAqB;IACzD,IAAM,GAAG,GAAG,IAAI,eAAe,EAAE,CAAA;IACjC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;IAC3B,OAAO,GAAG,CAAA;AACZ,CAAC;AAJD,sDAIC"} {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/index.ts"],"names":[],"mappings":";;;AAAA,yDAAwD;AAExD,8DAAoC;AACpC,kEAAwC;AAExC;IAAqC,2CAAiB;IAAtD;;IAAwD,CAAC;IAAD,sBAAC;AAAD,CAAC,AAAzD,CAAqC,qCAAiB,GAAG;AAA5C,0CAAe"}
\ No newline at end of file \ No newline at end of file
{"version":3,"file":"loadParamsFactory.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/loadParamsFactory.ts"],"names":[],"mappings":";;AACA,2EAAsF;AACtF,qDAA6E;AAI7E,2BAAkC,SAAc,EAAE,aAA6B;IAE7E,IAAM,kBAAkB,GAAG,uDAAyB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;IAE9E,2BAA2B,MAAc;QACvC,IAAM,OAAO,GAAG,kBAAkB,CAAiB,MAAM,aAAU,EAAE,CAAC,CAAC,CAAA;QACvE,IAAM,IAAI,GAAG,kBAAkB,CAAiB,MAAM,UAAO,EAAE,C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MAAM,WAAQ,CAAC,CAAA;QAE3D,OAAO,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,CAAA;IACvC,CAAC;IAED,yBAAyB,MAAc;QACrC,IAAM,OAAO,GAAG,kBAAkB,CAAiB,MAAM,aAAU,EAAE,CAAC,CAAC,CAAA;QACvE,IAAM,IAAI,GAAG,kBAAkB,CAAiB,MAAM,UAAO,EAAE,CAAC,CAAC,CAAA;QAEjE,OAAO,EAAE,OAAO,SAAA,EAAE,IAAI,MAAA,EAAE,CAAA;IAC1B,CAAC;IAED,OAAO;QACL,wBAAwB,0BAAA;QACxB,wBAAwB,0BAAA;QACxB,eAAe,iBAAA;KAChB,CAAA;AACH,CAAC;AAxDD,8CAwDC"}
\ No newline at end of file
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/faceLandmarkNet/types.ts"],"names":[],"mappings":""}
\ No newline at end of file
import * as tf from '@tensorflow/tfjs-core';
import { NetInput, NeuralNetwork } from 'tfjs-image-recognition-base';
import { FaceFeatureExtractorParams, IFaceFeatureExtractor, TinyFaceFeatureExtractorParams } from '../faceFeatureExtractor/types';
import { NetParams } from './types';
export declare abstract class FaceProcessor<TExtractorParams extends FaceFeatureExtractorParams | TinyFaceFeatureExtractorParams> extends NeuralNetwork<NetParams> {
protected _faceFeatureExtractor: IFaceFeatureExtractor<TExtractorParams>;
constructor(_name: string, faceFeatureExtractor: IFaceFeatureExtractor<TExtractorParams>);
readonly faceFeatureExtractor: IFaceFeatureExtractor<TExtractorParams>;
protected abstract getDefaultModelName(): string;
protected abstract getClassifierChannelsIn(): number;
protected abstract getClassifierChannelsOut(): number;
runNet(input: NetInput | tf.Tensor4D): tf.Tensor2D;
dispose(throwOnRedispose?: boolean): void;
loadClassifierParams(weights: Float32Array): void;
extractClassifierParams(weights: Float32Array): {
params: NetParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
protected extractParamsFromWeigthMap(weightMap: tf.NamedTensorMap): {
params: NetParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
protected extractParams(weights: Float32Array): {
params: NetParams;
paramMappings: {
originalPath?: string | undefined;
paramPath: string;
}[];
};
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var tf = require("@tensorflow/tfjs-core");
var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
var fullyConnectedLayer_1 = require("../common/fullyConnectedLayer");
var extractParams_1 = require("./extractParams");
var extractParamsFromWeigthMap_1 = require("./extractParamsFromWeigthMap");
var util_1 = require("./util");
var FaceProcessor = /** @class */ (function (_super) {
tslib_1.__extends(FaceProcessor, _super);
function FaceProcessor(_name, faceFeatureExtractor) {
var _this = _super.call(this, _name) || this;
_this._faceFeatureExtractor = faceFeatureExtractor;
return _this;
}
Object.defineProperty(FaceProcessor.prototype, "faceFeatureExtractor", {
get: function () {
return this._faceFeatureExtractor;
},
enumerable: true,
configurable: true
});
FaceProcessor.prototype.runNet = function (input) {
var _this = this;
var params = this.params;
if (!params) {
throw new Error(this._name + " - load model before inference");
}
return tf.tidy(function () {
var bottleneckFeatures = input instanceof tfjs_image_recognition_base_1.NetInput
? _this.faceFeatureExtractor.forwardInput(input)
: input;
return fullyConnectedLayer_1.fullyConnectedLayer(bottleneckFeatures.as2D(bottleneckFeatures.shape[0], -1), params.fc);
});
};
FaceProcessor.prototype.dispose = function (throwOnRedispose) {
if (throwOnRedispose === void 0) { throwOnRedispose = true; }
this.faceFeatureExtractor.dispose(throwOnRedispose);
_super.prototype.dispose.call(this, throwOnRedispose);
};
FaceProcessor.prototype.loadClassifierParams = function (weights) {
var _a = this.extractClassifierParams(weights), params = _a.params, paramMappings = _a.paramMappings;
this._params = params;
this._paramMappings = paramMappings;
};
FaceProcessor.prototype.extractClassifierParams = function (weights) {
return extractParams_1.extractParams(weights, this.getClassifierChannelsIn(), this.getClassifierChannelsOut());
};
FaceProcessor.prototype.extractParamsFromWeigthMap = function (weightMap) {
var _a = util_1.seperateWeightMaps(weightMap), featureExtractorMap = _a.featureExtractorMap, classifierMap = _a.classifierMap;
this.faceFeatureExtractor.loadFromWeightMap(featureExtractorMap);
return extractParamsFromWeigthMap_1.extractParamsFromWeigthMap(classifierMap);
};
FaceProcessor.prototype.extractParams = function (weights) {
var cIn = this.getClassifierChannelsIn();
var cOut = this.getClassifierChannelsOut();
var classifierWeightSize = (cOut * cIn) + cOut;
var featureExtractorWeights = weights.slice(0, weights.length - classifierWeightSize);
var classifierWeights = weights.slice(weights.length - classifierWeightSize);
this.faceFeatureExtractor.extractWeights(featureExtractorWeights);
return this.extractClassifierParams(classifierWeights);
};
return FaceProcessor;
}(tfjs_image_recognition_base_1.NeuralNetwork));
exports.FaceProcessor = FaceProcessor;
//# sourceMappingURL=FaceProcessor.js.map
\ No newline at end of file
{"version":3,"file":"FaceProcessor.js","sourceRoot":"","sources":["../../../src/faceProcessor/FaceProcessor.ts"],"names":[],"mappings":";;;AAAA,0CAA4C;AAC5C,2EAAsE;AAEtE,qEAAoE;AAMpE,iDAAgD;AAChD,2EAA0E;AAE1E,+BAA4C;AAE5C;IAGU,yCAAwB;IAIhC,uBAAY,KAAa,EAAE,oBAA6D;QAAxF,YACE,kBAAM,KAAK,CAAC,SAEb;QADC,KAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAA;;IACnD,CAAC;IAED,sBAAW,+CAAoB;aAA/B;YACE,OAAO,IAAI,CAAC,qBAAqB,CAAA;QACnC,CAAC;;;OAAA;IAMM,8BAAM,GAAb,UAAc,KAA6B;QAA3C,iBAcC;QAZS,IAAA,oBAAM,CAAS;QAEvB,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CAAI,IAAI,CAAC,KAAK,mCAAgC,CAAC,CAAA;SAC/D;QAED,OAAO,EAAE,CAAC,IAAI,CAAC;YACb,IAAM,kBAAkB,GAAG,KAAK,YAAY,sCAAQ;gBAClD,CAAC,CAAC,KAAI,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AA;QAEjD,IAAM,uBAAuB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,oBAAoB,CAAC,CAAA;QACvF,IAAM,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,oBAAoB,CAAC,CAAA;QAE9E,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,uBAAuB,CAAC,CAAA;QACjE,OAAO,IAAI,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAA;IACxD,CAAC;IACH,oBAAC;AAAD,CAAC,AAxED,CAGU,2CAAa,GAqEtB;AAxEqB,sCAAa"}
\ No newline at end of file
import { ParamMapping } from 'tfjs-image-recognition-base'; import { ParamMapping } from 'tfjs-image-recognition-base';
import { NetParams } from './types'; import { NetParams } from './types';
export declare function extractParams(weights: Float32Array): { export declare function extractParams(weights: Float32Array, channelsIn: number, channelsOut: number): {
params: NetParams; params: NetParams;
paramMappings: ParamMapping[]; paramMappings: ParamMapping[];
}; };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
var tfjs_tiny_yolov2_1 = require("tfjs-tiny-yolov2");
function extractParams(weights, channelsIn, channelsOut) {
var paramMappings = [];
var _a = tfjs_image_recognition_base_1.extractWeightsFactory(weights), extractWeights = _a.extractWeights, getRemainingWeights = _a.getRemainingWeights;
var extractFCParams = tfjs_tiny_yolov2_1.extractFCParamsFactory(extractWeights, paramMappings);
var fc = extractFCParams(channelsIn, channelsOut, 'fc');
if (getRemainingWeights().length !== 0) {
throw new Error("weights remaing after extract: " + getRemainingWeights().length);
}
return {
paramMappings: paramMappings,
params: { fc: fc }
};
}
exports.extractParams = extractParams;
//# sourceMappingURL=extractParams.js.map
\ No newline at end of file
{"version":3,"file":"extractParams.js","sourceRoot":"","sources":["../../../src/faceProcessor/extractParams.ts"],"names":[],"mappings":";;AAAA,2EAAkF;AAClF,qDAA0D;AAI1D,uBAA8B,OAAqB,EAAE,UAAkB,EAAE,WAAmB;IAE1F,IAAM,aAAa,GAAmB,EAAE,CAAA;IAElC,IAAA,iEAG4B,EAFhC,kCAAc,EACd,4CAAmB,CACa;IAElC,IAAM,eAAe,GAAG,yCAAsB,CAAC,cAAc,EAAE,aAAa,CAAC,CAAA;IAE7E,IAAM,EAAE,GAAG,eAAe,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,CAAC,CAAA;IAEzD,IAAI,mBAAmB,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,oCAAkC,mBAAmB,EAAE,CAAC,MAAQ,CAAC,CAAA;KAClF;IAED,OAAO;QACL,aAAa,eAAA;QACb,MAAM,EAAE,EAAE,EAAE,IAAA,EAAE;KACf,CAAA;AACH,CAAC;AArBD,sCAqBC"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tfjs_image_recognition_base_1 = require("tfjs-image-recognition-base");
function extractParamsFromWeigthMap(weightMap) {
var paramMappings = [];
var extractWeightEntry = tfjs_image_recognition_base_1.extractWeightEntryFactory(weightMap, paramMappings);
function extractFcParams(prefix) {
var weights = extractWeightEntry(prefix + "/weights", 2);
var bias = extractWeightEntry(prefix + "/bias", 1);
return { weights: weights, bias: bias };
}
var params = {
fc: extractFcParams('fc')
};
tfjs_image_recognition_base_1.disposeUnusedWeightTensors(weightMap, paramMappings);
return { params: params, paramMappings: paramMappings };
}
exports.extractParamsFromWeigthMap = extractParamsFromWeigthMap;
//# sourceMappingURL=extractParamsFromWeigthMap.js.map
\ No newline at end of file
{"version":3,"file":"extractParamsFromWeigthMap.js","sourceRoot":"","sources":["../../../src/faceProcessor/extractParamsFromWeigthMap.ts"],"names":[],"mappings":";;AACA,2EAAkH;AAKlH,oCACE,SAA4B;IAG5B,IAAM,aAAa,GAAmB,EAAE,CAAA;IAExC,IAAM,kBAAkB,GAAG,uDAAyB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;IAE9E,yBAAyB,MAAc;QACrC,IAAM,OAAO,GAAG,kBAAkB,CAAiB,MAAM,aAAU,EAAE,CAAC,CAAC,CAAA;QACvE,IAAM,IAAI,GAAG,kBAAkB,CAAiB,MAAM,UAAO,EAAE,CAAC,CAAC,CAAA;QACjE,OAAO,EAAE,OAAO,SAAA,EAAE,IAAI,MAAA,EAAE,CAAA;IAC1B,CAAC;IAED,IAAM,MAAM,GAAG;QACb,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC;KAC1B,CAAA;IAED,wDAA0B,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA;IAEpD,OAAO,EAAE,MAAM,QAAA,EAAE,aAAa,eAAA,EAAE,CAAA;AAClC,CAAC;AArBD,gEAqBC"}
\ No newline at end of file
export * from './FaceProcessor';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
tslib_1.__exportStar(require("./FaceProcessor"), exports);
//# sourceMappingURL=index.js.map
\ No newline at end of file
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.
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