ObjectDetection.js 2.2 KB

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