2020-08-20 02:05:34 +02:00
|
|
|
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
exports.TinyFaceDetector = void 0;
|
|
|
|
const classes_1 = require("../classes");
|
|
|
|
const TinyYolov2Base_1 = require("../tinyYolov2/TinyYolov2Base");
|
|
|
|
const const_1 = require("./const");
|
|
|
|
class TinyFaceDetector extends TinyYolov2Base_1.TinyYolov2Base {
|
2020-08-18 14:04:33 +02:00
|
|
|
constructor() {
|
|
|
|
const config = {
|
|
|
|
withSeparableConvs: true,
|
2020-08-20 02:05:34 +02:00
|
|
|
iouThreshold: const_1.IOU_THRESHOLD,
|
2020-08-18 14:04:33 +02:00
|
|
|
classes: ['face'],
|
2020-08-20 02:05:34 +02:00
|
|
|
anchors: const_1.BOX_ANCHORS,
|
|
|
|
meanRgb: const_1.MEAN_RGB,
|
2020-08-18 14:04:33 +02:00
|
|
|
isFirstLayerConv2d: true,
|
|
|
|
filterSizes: [3, 16, 32, 64, 128, 256, 512]
|
|
|
|
};
|
|
|
|
super(config);
|
|
|
|
}
|
|
|
|
get anchors() {
|
|
|
|
return this.config.anchors;
|
|
|
|
}
|
|
|
|
async locateFaces(input, forwardParams) {
|
|
|
|
const objectDetections = await this.detect(input, forwardParams);
|
2020-08-20 02:05:34 +02:00
|
|
|
return objectDetections.map(det => new classes_1.FaceDetection(det.score, det.relativeBox, { width: det.imageWidth, height: det.imageHeight }));
|
2020-08-18 14:04:33 +02:00
|
|
|
}
|
|
|
|
getDefaultModelName() {
|
|
|
|
return 'tiny_face_detector_model';
|
|
|
|
}
|
|
|
|
extractParamsFromWeigthMap(weightMap) {
|
|
|
|
return super.extractParamsFromWeigthMap(weightMap);
|
|
|
|
}
|
|
|
|
}
|
2020-08-20 02:05:34 +02:00
|
|
|
exports.TinyFaceDetector = TinyFaceDetector;
|
2020-08-18 14:04:33 +02:00
|
|
|
//# sourceMappingURL=TinyFaceDetector.js.map
|