@timebutt/face-api.js
Version:
JavaScript API for face detection and face recognition in the browser with tensorflow.js
32 lines • 1.3 kB
JavaScript
import { __extends } from "tslib";
import { isValidProbablitiy } from '../utils';
import { LabeledBox } from './LabeledBox';
var PredictedBox = /** @class */ (function (_super) {
__extends(PredictedBox, _super);
function PredictedBox(box, label, score, classScore) {
var _this = _super.call(this, box, label) || this;
_this._score = score;
_this._classScore = classScore;
return _this;
}
PredictedBox.assertIsValidPredictedBox = function (box, callee) {
LabeledBox.assertIsValidLabeledBox(box, callee);
if (!isValidProbablitiy(box.score)
|| !isValidProbablitiy(box.classScore)) {
throw new Error("".concat(callee, " - expected properties score (").concat(box.score, ") and (").concat(box.classScore, ") to be a number between [0, 1]"));
}
};
Object.defineProperty(PredictedBox.prototype, "score", {
get: function () { return this._score; },
enumerable: false,
configurable: true
});
Object.defineProperty(PredictedBox.prototype, "classScore", {
get: function () { return this._classScore; },
enumerable: false,
configurable: true
});
return PredictedBox;
}(LabeledBox));
export { PredictedBox };
//# sourceMappingURL=PredictedBox.js.map