PredictedBox.js 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. import { __extends } from "tslib";
  2. import { isValidProbablitiy } from '../utils';
  3. import { LabeledBox } from './LabeledBox';
  4. var PredictedBox = /** @class */ (function (_super) {
  5. __extends(PredictedBox, _super);
  6. function PredictedBox(box, label, score, classScore) {
  7. var _this = _super.call(this, box, label) || this;
  8. _this._score = score;
  9. _this._classScore = classScore;
  10. return _this;
  11. }
  12. PredictedBox.assertIsValidPredictedBox = function (box, callee) {
  13. LabeledBox.assertIsValidLabeledBox(box, callee);
  14. if (!isValidProbablitiy(box.score)
  15. || !isValidProbablitiy(box.classScore)) {
  16. throw new Error(callee + " - expected properties score (" + box.score + ") and (" + box.classScore + ") to be a number between [0, 1]");
  17. }
  18. };
  19. Object.defineProperty(PredictedBox.prototype, "score", {
  20. get: function () { return this._score; },
  21. enumerable: true,
  22. configurable: true
  23. });
  24. Object.defineProperty(PredictedBox.prototype, "classScore", {
  25. get: function () { return this._classScore; },
  26. enumerable: true,
  27. configurable: true
  28. });
  29. return PredictedBox;
  30. }(LabeledBox));
  31. export { PredictedBox };
  32. //# sourceMappingURL=PredictedBox.js.map