ObjectDetection.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var Box_1 = require("./Box");
  4. var Dimensions_1 = require("./Dimensions");
  5. var ObjectDetection = /** @class */ (function () {
  6. function ObjectDetection(score, classScore, className, relativeBox, imageDims) {
  7. this._imageDims = new Dimensions_1.Dimensions(imageDims.width, imageDims.height);
  8. this._score = score;
  9. this._classScore = classScore;
  10. this._className = className;
  11. this._box = new Box_1.Box(relativeBox).rescale(this._imageDims);
  12. }
  13. Object.defineProperty(ObjectDetection.prototype, "score", {
  14. get: function () { return this._score; },
  15. enumerable: true,
  16. configurable: true
  17. });
  18. Object.defineProperty(ObjectDetection.prototype, "classScore", {
  19. get: function () { return this._classScore; },
  20. enumerable: true,
  21. configurable: true
  22. });
  23. Object.defineProperty(ObjectDetection.prototype, "className", {
  24. get: function () { return this._className; },
  25. enumerable: true,
  26. configurable: true
  27. });
  28. Object.defineProperty(ObjectDetection.prototype, "box", {
  29. get: function () { return this._box; },
  30. enumerable: true,
  31. configurable: true
  32. });
  33. Object.defineProperty(ObjectDetection.prototype, "imageDims", {
  34. get: function () { return this._imageDims; },
  35. enumerable: true,
  36. configurable: true
  37. });
  38. Object.defineProperty(ObjectDetection.prototype, "imageWidth", {
  39. get: function () { return this.imageDims.width; },
  40. enumerable: true,
  41. configurable: true
  42. });
  43. Object.defineProperty(ObjectDetection.prototype, "imageHeight", {
  44. get: function () { return this.imageDims.height; },
  45. enumerable: true,
  46. configurable: true
  47. });
  48. Object.defineProperty(ObjectDetection.prototype, "relativeBox", {
  49. get: function () { return new Box_1.Box(this._box).rescale(this.imageDims.reverse()); },
  50. enumerable: true,
  51. configurable: true
  52. });
  53. ObjectDetection.prototype.forSize = function (width, height) {
  54. return new ObjectDetection(this.score, this.classScore, this.className, this.relativeBox, { width: width, height: height });
  55. };
  56. return ObjectDetection;
  57. }());
  58. exports.ObjectDetection = ObjectDetection;
  59. //# sourceMappingURL=ObjectDetection.js.map